summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-11-22 12:54:52 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-11-22 12:54:52 -0500
commitc4fe3199a6d65212537a59eb0d7e6fad22b9e903 (patch)
tree8056c48812b97b79981182c2d27d6928f89d81b2 /configure.ac
parent2fed48f48f7f2f7a6d6f6d020f046efe3c249828 (diff)
downloadpostgresql-c4fe3199a6d65212537a59eb0d7e6fad22b9e903.tar.gz
Probe $PROVE not $PERL while checking for modules needed by TAP tests.
Normally "prove" and "perl" come from the same Perl installation, but we support the case where they don't (mainly because the MSys buildfarm animals need this). In that case, AX_PROG_PERL_MODULES is completely the wrong thing to use, because it's checking what "perl" has. Instead, make a little TAP test script including the required modules, and run that under "prove". We don't need ax_prog_perl_modules.m4 at all after this change, so remove it. Back-patch to all supported branches, for the buildfarm's benefit. (In v10, this also back-patches the effects of commit 264eb03aa.) Andrew Dunstan and Tom Lane, per an observation by Noah Misch Discussion: https://postgr.es/m/E1moZHS-0002Cu-Ei@gemulon.postgresql.org
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 15 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 95e5169c4f..b50130b323 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2377,23 +2377,25 @@ PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
# Check for test tools
#
if test "$enable_tap_tests" = yes; then
- # Check for necessary modules, unless user has specified the "prove" to use;
- # in that case it's her responsibility to have a working configuration.
- # (prove might be part of a different Perl installation than perl, eg on
- # MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.)
- if test -z "$PROVE"; then
- # Test::More and Time::HiRes are supposed to be part of core Perl,
- # but some distros omit them in a minimal installation.
- # The required minimum versions are all quite ancient now, but specify
- # them anyway for documentation's sake.
- AX_PROG_PERL_MODULES([IPC::Run=0.79 Test::More=0.98 Time::HiRes=1.52], ,
- [AC_MSG_ERROR([Additional Perl modules are required to run TAP tests])])
- fi
- # Now make sure we know where prove is
+ # Make sure we know where prove is.
PGAC_PATH_PROGS(PROVE, prove)
if test -z "$PROVE"; then
AC_MSG_ERROR([prove not found])
fi
+ # Check for necessary Perl modules. You might think we should use
+ # AX_PROG_PERL_MODULES here, but prove might be part of a different Perl
+ # installation than perl, eg on MSys, so we have to check using prove.
+ AC_MSG_CHECKING(for Perl modules required for TAP tests)
+ [modulestderr=`"$PROVE" "$srcdir/config/check_modules.pl" 2>&1 >/dev/null`]
+ if test $? -eq 0; then
+ # log the module version details, but don't show them interactively
+ echo "$modulestderr" >&AS_MESSAGE_LOG_FD
+ AC_MSG_RESULT(yes)
+ else
+ # on failure, though, show the results to the user
+ AC_MSG_RESULT([$modulestderr])
+ AC_MSG_ERROR([Additional Perl modules are required to run TAP tests])
+ fi
fi
# If compiler will take -Wl,--as-needed (or various platform-specific