VPATH build from a tarball fails with some gmake versions
I tried doing a VPATH build referencing a source directory that I'd distclean'd
but not maintainer-clean'd, which should simulate the case of a VPATH
build from a tarball. I was quite surprised that it fell over:
...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -I. -I/home/postgres/pgsql/src/bin/psql -I/home/postgres/pgsql/src/interfaces/libpq -I../../../src/include -I/home/postgres/pgsql/src/include -D_GNU_SOURCE -c -o sql_help.o sql_help.c
gcc: sql_help.c: No such file or directory
gcc: no input files
make[3]: *** [sql_help.o] Error 1
make[3]: Leaving directory `/home/postgres/buildroot/src/bin/psql'
gmake should be generating a path to sql_help.c, since that exists
in the corresponding source directory, but it does not. I can reproduce
this on RHEL6 with make-3.81-23, but not on Fedora 26 with make-4.2.1-2,
and (curiously) also not on High Sierra with Apple's copy of make 3.81.
I wonder how many other people see it.
The attached patch seems to fix it, indicating that there's something
about the rules relating sql_help.c and sql_help.h that is confusing
make, such that turning sql_help.c into the primary target for the
create_help rule removes the confusion.
Comments?
regards, tom lane
Attachments:
switch-sql-help-h-and-c.patchtext/x-diff; charset=us-ascii; name=switch-sql-help-h-and-c.patchDownload+6-6
On Thu, Mar 1, 2018 at 9:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
I tried doing a VPATH build referencing a source directory that I'd distclean'd
but not maintainer-clean'd, which should simulate the case of a VPATH
build from a tarball. I was quite surprised that it fell over:...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -I. -I/home/postgres/pgsql/src/bin/psql -I/home/postgres/pgsql/src/interfaces/libpq -I../../../src/include -I/home/postgres/pgsql/src/include -D_GNU_SOURCE -c -o sql_help.o sql_help.c
gcc: sql_help.c: No such file or directory
gcc: no input files
make[3]: *** [sql_help.o] Error 1
make[3]: Leaving directory `/home/postgres/buildroot/src/bin/psql'gmake should be generating a path to sql_help.c, since that exists
in the corresponding source directory, but it does not. I can reproduce
this on RHEL6 with make-3.81-23, but not on Fedora 26 with make-4.2.1-2,
and (curiously) also not on High Sierra with Apple's copy of make 3.81.
I wonder how many other people see it.The attached patch seems to fix it, indicating that there's something
about the rules relating sql_help.c and sql_help.h that is confusing
make, such that turning sql_help.c into the primary target for the
create_help rule removes the confusion.
Very odd. I can't reproduce it on Centos6 with make 3.81.23 and a
downloaded tarball.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services