Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcKsK-0002Ql-2Q for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2017 00:17:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dcKsJ-0007HZ-2f for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2017 00:17:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcKsH-0007FE-7L for pgsql-hackers@postgresql.org; Tue, 01 Aug 2017 00:17:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcKsD-00050t-9C for pgsql-hackers@postgresql.org; Tue, 01 Aug 2017 00:17:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v710HGZm008924; Mon, 31 Jul 2017 20:17:16 -0400 From: Tom Lane To: Peter Eisentraut cc: Noah Misch , Andrew Dunstan , pgsql-hackers@postgresql.org Subject: Re: PL_stashcache, or, what's our minimum Perl version? In-reply-to: <18305.1501534485@sss.pgh.pa.us> References: <20540.1501210115@sss.pgh.pa.us> <16894.1501392088@sss.pgh.pa.us> <20170730154814.GA2636941@rfd.leadboat.com> <22744.1501430710@sss.pgh.pa.us> <20170730163054.GA2630977@rfd.leadboat.com> <25937.1501433410@sss.pgh.pa.us> <9072.1501527316@sss.pgh.pa.us> <90a92a7d-938e-507a-3bd7-ecd2b4004689@2ndquadrant.com> <14432.1501529890@sss.pgh.pa.us> <7fbd4508-23c5-f426-d374-6c72e20bbce9@2ndquadrant.com> <18305.1501534485@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 31 Jul 2017 16:54:45 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <8850.1501546579.0@sss.pgh.pa.us> Date: Mon, 31 Jul 2017 20:17:16 -0400 Message-ID: <8923.1501546636@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8850.1501546579.1@sss.pgh.pa.us> I wrote: > If we need to fix things so that AC_PATH_PROG will honor a non-path > input value, then let's do that. But let's not make the build system > shakier/less reproducible than it is already. > I suggest that we could inject logic like this: > if VARIABLE-is-set-and-value-isn't-already-absolute; then > VARIABLE=`which $VARIABLE 2>/dev/null` > fi > in front of the existing logic for AC_PATH_PROG(VARIABLE,...). > Maybe "which" isn't the best tool for the job, not sure. Concretely, how about something like the attached? BTW, I haven't done it here, but I wonder whether we should not make PGAC_PATH_PROGS invoke AC_ARG_VAR on the target variable, so that configure knows that it should be treated as affecting results caching. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="ac-path-prog-fix.patch"; charset="us-ascii" Content-ID: <8850.1501546579.2@sss.pgh.pa.us> Content-Description: ac-path-prog-fix.patch Content-Transfer-Encoding: quoted-printable diff --git a/config/docbook.m4 b/config/docbook.m4 index c485eaf..f9307f3 100644 *** a/config/docbook.m4 --- b/config/docbook.m4 *************** *** 3,9 **** # PGAC_PROG_NSGMLS # ---------------- AC_DEFUN([PGAC_PROG_NSGMLS], ! [AC_PATH_PROGS([NSGMLS], [onsgmls nsgmls])]) =20=20 =20=20 # PGAC_CHECK_DOCBOOK(VERSION) --- 3,9 ---- # PGAC_PROG_NSGMLS # ---------------- AC_DEFUN([PGAC_PROG_NSGMLS], ! [PGAC_PATH_PROGS(NSGMLS, [onsgmls nsgmls])]) =20=20 =20=20 # PGAC_CHECK_DOCBOOK(VERSION) diff --git a/config/perl.m4 b/config/perl.m4 index 9706c4d..e44ca94 100644 *** a/config/perl.m4 --- b/config/perl.m4 *************** *** 4,13 **** # PGAC_PATH_PERL # -------------- AC_DEFUN([PGAC_PATH_PERL], ! [# Let the user override the search ! if test -z "$PERL"; then ! AC_PATH_PROG(PERL, perl) ! fi =20=20 if test "$PERL"; then pgac_perl_version=3D`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[= a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']` --- 4,10 ---- # PGAC_PATH_PERL # -------------- AC_DEFUN([PGAC_PATH_PERL], ! [PGAC_PATH_PROGS(PERL, perl) =20=20 if test "$PERL"; then pgac_perl_version=3D`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[= a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']` diff --git a/config/programs.m4 b/config/programs.m4 index b7deb86..0b0098e 100644 *** a/config/programs.m4 --- b/config/programs.m4 *************** *** 1,6 **** --- 1,23 ---- # config/programs.m4 =20=20 =20=20 + # PGAC_PATH_PROGS + # --------------- + # This wrapper for AC_PATH_PROGS behaves like that macro except in the ca= se + # where VARIABLE is already set but is not set to an absolute path. We w= ill + # attempt to make it into an absolute path using "which". If that fails, + # we ignore the existing value, which is the behavior of AC_PATH_PROGS. +=20 + AC_DEFUN([PGAC_PATH_PROGS], + [# If user is trying to override the search for $1, make sure that + # the variable's value is an absolute path. + if test -n "$$1"; then + $1=3D`which "$$1" 2>/dev/null` + fi + AC_PATH_PROGS($@)dnl + ]) +=20 +=20 # PGAC_PATH_BISON # --------------- # Look for Bison, set the output variable BISON to its path if found. *************** *** 8,17 **** # Note we do not accept other implementations of yacc. =20=20 AC_DEFUN([PGAC_PATH_BISON], ! [# Let the user override the search ! if test -z "$BISON"; then ! AC_PATH_PROGS(BISON, bison) ! fi =20=20 if test "$BISON"; then pgac_bison_version=3D`$BISON --version 2>/dev/null | sed q` --- 25,31 ---- # Note we do not accept other implementations of yacc. =20=20 AC_DEFUN([PGAC_PATH_BISON], ! [PGAC_PATH_PROGS(BISON, bison) =20=20 if test "$BISON"; then pgac_bison_version=3D`$BISON --version 2>/dev/null | sed q` *************** if test -z "$BISON"; then *** 41,47 **** *** PostgreSQL then you do not need to worry about this, because the Bison *** output is pre-generated.)]) fi ! # We don't need AC_SUBST(BISON) because AC_PATH_PROG did it AC_SUBST(BISONFLAGS) ])# PGAC_PATH_BISON =20=20 --- 55,61 ---- *** PostgreSQL then you do not need to worry about this, because the Bison *** output is pre-generated.)]) fi ! # We don't need AC_SUBST(BISON) because PGAC_PATH_PROGS did it AC_SUBST(BISONFLAGS) ])# PGAC_PATH_BISON =20=20 *************** AC_DEFUN([PGAC_CHECK_GETTEXT], *** 229,235 **** [AC_MSG_ERROR([a gettext implementation is required for = NLS])]) AC_CHECK_HEADER([libintl.h], [], [AC_MSG_ERROR([header file is required for = NLS])]) ! AC_PATH_PROGS(MSGFMT, msgfmt) if test -z "$MSGFMT"; then AC_MSG_ERROR([msgfmt is required for NLS]) fi --- 243,249 ---- [AC_MSG_ERROR([a gettext implementation is required for = NLS])]) AC_CHECK_HEADER([libintl.h], [], [AC_MSG_ERROR([header file is required for = NLS])]) ! PGAC_PATH_PROGS(MSGFMT, msgfmt) if test -z "$MSGFMT"; then AC_MSG_ERROR([msgfmt is required for NLS]) fi *************** AC_DEFUN([PGAC_CHECK_GETTEXT], *** 238,245 **** pgac_cv_msgfmt_flags=3D-c fi]) AC_SUBST(MSGFMT_FLAGS, $pgac_cv_msgfmt_flags) ! AC_PATH_PROGS(MSGMERGE, msgmerge) ! AC_PATH_PROGS(XGETTEXT, xgettext) ])# PGAC_CHECK_GETTEXT =20=20 =20=20 --- 252,259 ---- pgac_cv_msgfmt_flags=3D-c fi]) AC_SUBST(MSGFMT_FLAGS, $pgac_cv_msgfmt_flags) ! PGAC_PATH_PROGS(MSGMERGE, msgmerge) ! PGAC_PATH_PROGS(XGETTEXT, xgettext) ])# PGAC_CHECK_GETTEXT =20=20 =20=20 diff --git a/config/python.m4 b/config/python.m4 index 953d709..f3c7642 100644 *** a/config/python.m4 --- b/config/python.m4 *************** *** 6,15 **** =20=20 # PGAC_PATH_PYTHON # ---------------- ! # Look for Python and set the output variable 'PYTHON' ! # to 'python' if found, empty otherwise. AC_DEFUN([PGAC_PATH_PYTHON], ! [AC_PATH_PROG(PYTHON, python) if test x"$PYTHON" =3D x""; then AC_MSG_ERROR([Python not found]) fi --- 6,15 ---- =20=20 # PGAC_PATH_PYTHON # ---------------- ! # Look for Python and set the output variable 'PYTHON' if found, ! # fail otherwise. AC_DEFUN([PGAC_PATH_PYTHON], ! [PGAC_PATH_PROGS(PYTHON, python) if test x"$PYTHON" =3D x""; then AC_MSG_ERROR([Python not found]) fi diff --git a/config/tcl.m4 b/config/tcl.m4 index 907deb9..a4bf231 100644 *** a/config/tcl.m4 --- b/config/tcl.m4 *************** *** 4,10 **** =20=20 =20=20 AC_DEFUN([PGAC_PATH_TCLSH], ! [AC_PATH_PROGS(TCLSH, [tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8= .4 tclsh84]) if test x"$TCLSH" =3D x""; then AC_MSG_ERROR([Tcl shell not found]) fi --- 4,10 ---- =20=20 =20=20 AC_DEFUN([PGAC_PATH_TCLSH], ! [PGAC_PATH_PROGS(TCLSH, [tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tcls= h8.4 tclsh84]) if test x"$TCLSH" =3D x""; then AC_MSG_ERROR([Tcl shell not found]) fi diff --git a/configure.in b/configure.in index abfc7b5..a0f0f85 100644 *** a/configure.in --- b/configure.in *************** PGAC_ARG_BOOL(enable, profiling, no, *** 218,232 **** # PGAC_ARG_BOOL(enable, coverage, no, [build with coverage testing instrumentation], ! [AC_PATH_PROGS(GCOV, gcov) if test -z "$GCOV"; then AC_MSG_ERROR([gcov not found]) fi ! AC_PATH_PROGS(LCOV, lcov) if test -z "$LCOV"; then AC_MSG_ERROR([lcov not found]) fi ! AC_PATH_PROGS(GENHTML, genhtml) if test -z "$GENHTML"; then AC_MSG_ERROR([genhtml not found]) fi]) --- 218,232 ---- # PGAC_ARG_BOOL(enable, coverage, no, [build with coverage testing instrumentation], ! [PGAC_PATH_PROGS(GCOV, gcov) if test -z "$GCOV"; then AC_MSG_ERROR([gcov not found]) fi ! PGAC_PATH_PROGS(LCOV, lcov) if test -z "$LCOV"; then AC_MSG_ERROR([lcov not found]) fi ! PGAC_PATH_PROGS(GENHTML, genhtml) if test -z "$GENHTML"; then AC_MSG_ERROR([genhtml not found]) fi]) *************** AC_SUBST(enable_coverage) *** 237,243 **** # PGAC_ARG_BOOL(enable, dtrace, no, [build with DTrace support], ! [AC_PATH_PROGS(DTRACE, dtrace) if test -z "$DTRACE"; then AC_MSG_ERROR([dtrace not found]) fi --- 237,243 ---- # PGAC_ARG_BOOL(enable, dtrace, no, [build with DTrace support], ! [PGAC_PATH_PROGS(DTRACE, dtrace) if test -z "$DTRACE"; then AC_MSG_ERROR([dtrace not found]) fi *************** PGAC_ARG_BOOL(with, libxml, no, [build w *** 816,822 **** [AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML = support. (--with-libxml)])]) =20=20 if test "$with_libxml" =3D yes ; then ! AC_PATH_PROGS(XML2_CONFIG, xml2-config) if test -n "$XML2_CONFIG"; then for pgac_option in `$XML2_CONFIG --cflags`; do case $pgac_option in --- 816,822 ---- [AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML = support. (--with-libxml)])]) =20=20 if test "$with_libxml" =3D yes ; then ! PGAC_PATH_PROGS(XML2_CONFIG, xml2-config) if test -n "$XML2_CONFIG"; then for pgac_option in `$XML2_CONFIG --cflags`; do case $pgac_option in *************** case $INSTALL in *** 912,918 **** esac AC_SUBST(install_bin) =20=20 ! AC_PATH_PROG(TAR, tar) AC_PROG_LN_S AC_PROG_AWK AC_PROG_MKDIR_P --- 912,918 ---- esac AC_SUBST(install_bin) =20=20 ! PGAC_PATH_PROGS(TAR, tar) AC_PROG_LN_S AC_PROG_AWK AC_PROG_MKDIR_P *************** if test "$with_python" =3D yes; then *** 948,954 **** fi =20=20 if test "$cross_compiling" =3D yes && test -z "$with_system_tzdata"; then ! AC_PATH_PROG(ZIC, zic) if test -z "$ZIC"; then AC_MSG_ERROR([ When cross-compiling, either use the option --with-system-tzdata to use --- 948,954 ---- fi =20=20 if test "$cross_compiling" =3D yes && test -z "$with_system_tzdata"; then ! PGAC_PATH_PROGS(ZIC, zic) if test -z "$ZIC"; then AC_MSG_ERROR([ When cross-compiling, either use the option --with-system-tzdata to use *************** fi *** 2119,2135 **** # PGAC_PROG_NSGMLS PGAC_CHECK_DOCBOOK(4.2) ! AC_PATH_PROGS(DBTOEPUB, dbtoepub) ! AC_PATH_PROGS(XMLLINT, xmllint) ! AC_PATH_PROGS(XSLTPROC, xsltproc) ! AC_PATH_PROGS(OSX, [osx sgml2xml sx]) ! AC_PATH_PROGS(FOP, fop) =20=20 # # Check for test tools # if test "$enable_tap_tests" =3D yes; then ! AC_PATH_PROGS(PROVE, prove) if test -z "$PROVE"; then AC_MSG_ERROR([prove not found]) fi --- 2119,2135 ---- # PGAC_PROG_NSGMLS PGAC_CHECK_DOCBOOK(4.2) ! PGAC_PATH_PROGS(DBTOEPUB, dbtoepub) ! PGAC_PATH_PROGS(XMLLINT, xmllint) ! PGAC_PATH_PROGS(XSLTPROC, xsltproc) ! PGAC_PATH_PROGS(OSX, [osx sgml2xml sx]) ! PGAC_PATH_PROGS(FOP, fop) =20=20 # # Check for test tools # if test "$enable_tap_tests" =3D yes; then ! PGAC_PATH_PROGS(PROVE, prove) if test -z "$PROVE"; then AC_MSG_ERROR([prove not found]) fi ------- =_aaaaaaaaaa0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers ------- =_aaaaaaaaaa0--