From: Tom Lane Date: Mon, 7 Aug 2017 20:42:18 +0000 (-0400) Subject: Skip test for IPC::Run if user is overriding our search for PROVE. X-Git-Tag: REL_10_BETA3~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8014d2afa7b817c98544cace7efc337ee891aa57;p=postgresql Skip test for IPC::Run if user is overriding our search for PROVE. The check for IPC::Run we added in commit c254970ad is useful in simple cases, but there are real use-cases where "prove" is coming from a different Perl installation than the "perl" we want to use to build. In such cases asking whether "perl" knows about IPC::Run is irrelevant and can cause an unnecessary configure failure. Hence, if user has specified a value for PROVE, skip the IPC::Run check. Per discussion with Andrew Dunstan. Discussion: https://postgr.es/m/E1dcE5n-0005Sk-UE@gemulon.postgresql.org --- diff --git a/configure b/configure index e63496f591..63081bc2f2 100755 --- a/configure +++ b/configure @@ -16457,67 +16457,11 @@ 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 - for ac_prog in prove -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; 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_path_PROVE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PROVE in - [\\/]* | ?:[\\/]*) - ac_cv_path_PROVE="$PROVE" # Let the user override the test with a path. - ;; - *) - 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_path_PROVE="$as_dir/$ac_word$ac_exec_ext" - $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 - - ;; -esac -fi -PROVE=$ac_cv_path_PROVE -if test -n "$PROVE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5 -$as_echo "$PROVE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PROVE" && break -done - -else - # Report the value of PROVE in configure's output in all cases. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PROVE" >&5 -$as_echo_n "checking for PROVE... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5 -$as_echo "$PROVE" >&6; } -fi - - if test -z "$PROVE"; then - as_fn_error $? "prove not found" "$LINENO" 5 - fi - if test -z "$PERL"; then - as_fn_error $? "Perl not found" "$LINENO" 5 - fi - # Check for necessary modules @@ -16595,6 +16539,65 @@ 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 + if test -z "$PROVE"; then + for ac_prog in prove +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_path_PROVE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PROVE in + [\\/]* | ?:[\\/]*) + ac_cv_path_PROVE="$PROVE" # Let the user override the test with a path. + ;; + *) + 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_path_PROVE="$as_dir/$ac_word$ac_exec_ext" + $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 + + ;; +esac +fi +PROVE=$ac_cv_path_PROVE +if test -n "$PROVE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5 +$as_echo "$PROVE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PROVE" && break +done + +else + # Report the value of PROVE in configure's output in all cases. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PROVE" >&5 +$as_echo_n "checking for PROVE... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5 +$as_echo "$PROVE" >&6; } +fi + + if test -z "$PROVE"; then + as_fn_error $? "prove not found" "$LINENO" 5 + fi fi # Thread testing diff --git a/configure.in b/configure.in index 99480d695c..f4fd2c79c9 100644 --- a/configure.in +++ b/configure.in @@ -2134,16 +2134,19 @@ PGAC_PATH_PROGS(FOP, fop) # 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 + AX_PROG_PERL_MODULES(IPC::Run, , + AC_MSG_ERROR([Perl module IPC::Run is required to run TAP tests])) + fi + # Now make sure we know where prove is PGAC_PATH_PROGS(PROVE, prove) if test -z "$PROVE"; then AC_MSG_ERROR([prove not found]) fi - if test -z "$PERL"; then - AC_MSG_ERROR([Perl not found]) - fi - # Check for necessary modules - AX_PROG_PERL_MODULES(IPC::Run, , - AC_MSG_ERROR([Perl module IPC::Run is required to run TAP tests])) fi # Thread testing