mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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
This commit is contained in:
110
configure
vendored
110
configure
vendored
@ -19410,98 +19410,7 @@ fi
|
||||
# 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.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Make sure we have perl
|
||||
if test -z "$PERL"; then
|
||||
# Extract the first word of "perl", so it can be a program name with args.
|
||||
set dummy perl; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_prog_PERL+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if test -n "$PERL"; then
|
||||
ac_cv_prog_PERL="$PERL" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_prog_PERL="perl"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
fi
|
||||
fi
|
||||
PERL=$ac_cv_prog_PERL
|
||||
if test -n "$PERL"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
|
||||
$as_echo "$PERL" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if test "x$PERL" != x; then
|
||||
ax_perl_modules_failed=0
|
||||
for ax_perl_module in 'IPC::Run 0.79' 'Test::More 0.98' 'Time::HiRes 1.52' ; do
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5
|
||||
$as_echo_n "checking for perl module $ax_perl_module... " >&6; }
|
||||
|
||||
# Would be nice to log result here, but can't rely on autoconf internals
|
||||
modversion=`$PERL -e "use $ax_perl_module; my \\\$x=q($ax_perl_module); \\\$x =~ s/ .*//; \\\$x .= q(::VERSION); eval qq{print \\\\$\\\$x\\n}; exit;" 2>/dev/null`
|
||||
if test $? -ne 0; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; };
|
||||
ax_perl_modules_failed=1
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $modversion" >&5
|
||||
$as_echo "$modversion" >&6; };
|
||||
fi
|
||||
done
|
||||
|
||||
# Run optional shell commands
|
||||
if test "$ax_perl_modules_failed" = 0; then
|
||||
:
|
||||
|
||||
else
|
||||
:
|
||||
as_fn_error $? "Additional Perl modules are required to run TAP tests" "$LINENO" 5
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5
|
||||
$as_echo "$as_me: WARNING: could not find perl" >&2;}
|
||||
fi
|
||||
fi
|
||||
# Now make sure we know where prove is
|
||||
# Make sure we know where prove is.
|
||||
if test -z "$PROVE"; then
|
||||
for ac_prog in prove
|
||||
do
|
||||
@ -19559,6 +19468,23 @@ fi
|
||||
if test -z "$PROVE"; then
|
||||
as_fn_error $? "prove not found" "$LINENO" 5
|
||||
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.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl modules required for TAP tests" >&5
|
||||
$as_echo_n "checking for Perl modules required for TAP tests... " >&6; }
|
||||
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" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
# on failure, though, show the results to the user
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $modulestderr" >&5
|
||||
$as_echo "$modulestderr" >&6; }
|
||||
as_fn_error $? "Additional Perl modules are required to run TAP tests" "$LINENO" 5
|
||||
fi
|
||||
fi
|
||||
|
||||
# If compiler will take -Wl,--as-needed (or various platform-specific
|
||||
|
Reference in New Issue
Block a user