]> granicus.if.org Git - postgresql/commitdiff
Fix build problems in commit aa65de042f5828968f2f6cd65f45c543a40cc3e6.
authorRobert Haas <rhaas@postgresql.org>
Fri, 11 Sep 2015 18:53:41 +0000 (14:53 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 11 Sep 2015 18:56:17 +0000 (14:56 -0400)
The previous way didn't work for vpath builds, and make distprep was
busted too.

Reported off-list by Andres Freund.

src/backend/Makefile
src/backend/storage/lmgr/Makefile
src/backend/storage/lmgr/generate-lwlocknames.pl
src/backend/storage/lmgr/lwlock.c
src/include/storage/lwlock.h

index f872deb188b42c7c010c9dd32c7ab238a067be57..fb60420b6f11acee444ef80eb821c20ff580b7b5 100644 (file)
@@ -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
index 3ad7535d74d7671082d36be494bc1de6b4659157..cd6ec73f08f10c10978e248d7c6194f205bd51ae 100644 (file)
@@ -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
 
index 3af2347c2ccfca7540e605ded754d9694e7b22d9..8b7e1d198f86ff2723b81b949ad34d58f040fc1b 100644 (file)
@@ -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>)
 {
index db10a96123002b0b91fc99f7bb1abd28003a46e4..9179d1b356b930dd2de5682e8b57c72daad1fa2a 100644 (file)
@@ -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;
index 00435b062f004a386cc3c60c590c059a6dfe6616..4653e099b0dba11519bbad59622e4a32b0ce5ff2 100644 (file)
@@ -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