aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-09-11 14:53:41 -0400
committerRobert Haas <rhaas@postgresql.org>2015-09-11 14:56:17 -0400
commit2ccc4e972eb85829a8fe8d39fc5ce4d770ac2e2e (patch)
tree790b7afe295d4509fcce7b710cdf968b1ec4acdc /src
parent5cd6538345858aec128945b58265a8d5560777dc (diff)
downloadpostgresql-2ccc4e972eb85829a8fe8d39fc5ce4d770ac2e2e.tar.gz
postgresql-2ccc4e972eb85829a8fe8d39fc5ce4d770ac2e2e.zip
Fix build problems in commit aa65de042f5828968f2f6cd65f45c543a40cc3e6.
The previous way didn't work for vpath builds, and make distprep was busted too. Reported off-list by Andres Freund.
Diffstat (limited to 'src')
-rw-r--r--src/backend/Makefile2
-rw-r--r--src/backend/storage/lmgr/Makefile3
-rw-r--r--src/backend/storage/lmgr/generate-lwlocknames.pl2
-rw-r--r--src/backend/storage/lmgr/lwlock.c3
-rw-r--r--src/include/storage/lwlock.h3
5 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile
index f872deb188b..fb60420b6f1 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -200,7 +200,7 @@ distprep:
$(MAKE) -C bootstrap bootparse.c bootscanner.c
$(MAKE) -C catalog schemapg.h postgres.bki postgres.description postgres.shdescription
$(MAKE) -C replication repl_gram.c repl_scanner.c
- $(MAKE) -C storage lwlocknames.h
+ $(MAKE) -C storage/lmgr lwlocknames.h
$(MAKE) -C utils fmgrtab.c fmgroids.h errcodes.h
$(MAKE) -C utils/misc guc-file.c
$(MAKE) -C utils/sort qsort_tuple.c
diff --git a/src/backend/storage/lmgr/Makefile b/src/backend/storage/lmgr/Makefile
index 3ad7535d74d..cd6ec73f08f 100644
--- a/src/backend/storage/lmgr/Makefile
+++ b/src/backend/storage/lmgr/Makefile
@@ -12,7 +12,8 @@ subdir = src/backend/storage/lmgr
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-OBJS = lmgr.o lock.o proc.o deadlock.o lwlock.o spin.o s_lock.o predicate.o
+OBJS = lmgr.o lock.o proc.o deadlock.o lwlock.o lwlocknames.o spin.o \
+ s_lock.o predicate.o
include $(top_srcdir)/src/backend/common.mk
diff --git a/src/backend/storage/lmgr/generate-lwlocknames.pl b/src/backend/storage/lmgr/generate-lwlocknames.pl
index 3af2347c2cc..8b7e1d198f8 100644
--- a/src/backend/storage/lmgr/generate-lwlocknames.pl
+++ b/src/backend/storage/lmgr/generate-lwlocknames.pl
@@ -23,7 +23,7 @@ print H $autogen;
print H "/* there is deliberately not an #ifndef LWLOCKNAMES_H here */\n\n";
print C $autogen, "\n";
-print C "static char *MainLWLockNames[] = {";
+print C "char *MainLWLockNames[] = {";
while (<$lwlocknames>)
{
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index db10a961230..9179d1b356b 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -95,9 +95,6 @@
#include "utils/hsearch.h"
#endif
-/* Constants for lwlock names */
-#include "lwlocknames.c"
-
/* We use the ShmemLock spinlock to protect LWLockAssign */
extern slock_t *ShmemLock;
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index 00435b062f0..4653e099b0d 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -90,9 +90,10 @@ typedef union LWLockPadded
char pad[LWLOCK_PADDED_SIZE];
} LWLockPadded;
extern PGDLLIMPORT LWLockPadded *MainLWLockArray;
+extern char *MainLWLockNames[];
/* Names for fixed lwlocks */
-#include "lwlocknames.h"
+#include "storage/lwlocknames.h"
/*
* It's a bit odd to declare NUM_BUFFER_PARTITIONS and NUM_LOCK_PARTITIONS