]> granicus.if.org Git - postgresql/commitdiff
Fix misplacement of submake-generated-headers prerequisites.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 1 Oct 2016 17:35:13 +0000 (13:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 1 Oct 2016 17:35:20 +0000 (13:35 -0400)
The sequence "configure; cd src/pl/plpython; make -j" failed due to
trying to compile plpython's .o files before the generated headers
finished building.  (This is an important real-world case, since it's
the typical second step when building both plpython2 and plpython3.)
This happens because the submake-generated-headers target is not
placed in a way to make it a prerequisite to compiling the .o files.
Fix that.

Checking other uses of submake-generated-headers, I noted that the one
attached to pg_regress was similarly misplaced; but it's actually not
needed at all for pg_regress.o, rather regress.o, so move it to be a
prerequisite of that.

Back-patch to 9.6 where submake-generated-headers was introduced
(by commit 548af97fc).  It's not immediately clear to me why the
previous coding didn't have the same issue; but since we've not
had field reports of plpython make failing, leave it alone in the
older branches.

Pavel Raiskup and Tom Lane

Discussion: <1925924.izSMJEZO3x@unused-4-107.brq.redhat.com>

src/pl/plpython/Makefile
src/test/regress/GNUmakefile

index 647b4b1b96fc759f99bd60c6bfebd55eddbc60ca..7680d49cb6997d5533a4f265e841e4f01d7d3a1a 100644 (file)
@@ -95,7 +95,9 @@ REGRESS_PLPYTHON3_MANGLE := $(REGRESS)
 
 include $(top_srcdir)/src/Makefile.shlib
 
-all: submake-generated-headers all-lib
+all: all-lib
+
+$(OBJS): | submake-generated-headers
 
 
 install: all install-lib install-data
index 6a275cb729c255b384a7498fe037d42b292fbe43..469b0937a23258eaf9b03d7ef68a9815a4b96734 100644 (file)
@@ -36,7 +36,7 @@ EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
 
 all: pg_regress$(X)
 
-pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport submake-generated-headers
+pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport
        $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
 
 # dependencies ensure that path changes propagate
@@ -65,6 +65,8 @@ include $(top_srcdir)/src/Makefile.shlib
 
 all: all-lib
 
+$(OBJS): | submake-generated-headers
+
 # Test input and expected files.  These are created by pg_regress itself, so we
 # don't have a rule to create them.  We do need rules to clean them however.
 input_files = $(patsubst $(srcdir)/input/%.source,sql/%.sql, $(wildcard $(srcdir)/input/*.source))