Improve test for working bash and allow path to be specified on command line

This commit is contained in:
rfm 2025-03-09 15:09:05 +00:00
parent 4602023a70
commit e3bbdd276b
3 changed files with 163 additions and 74 deletions

145
configure vendored
View file

@ -618,8 +618,8 @@ ac_default_prefix=NONE
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
MISSINGBASH MISSINGBASH
TESTPROG
SHELLPROG SHELLPROG
TESTPROG
LATEX2HTML LATEX2HTML
clean_target_vendor clean_target_vendor
clean_target_cpu clean_target_cpu
@ -830,6 +830,7 @@ enable_native_objc_exceptions
enable_debug_by_default enable_debug_by_default
enable_strip_makefiles enable_strip_makefiles
enable_parallel_building enable_parallel_building
with_bash_path
' '
ac_precious_vars='build_alias ac_precious_vars='build_alias
host_alias host_alias
@ -1657,8 +1658,9 @@ Optional Packages:
--with-libdir=FILE --with-libdir=FILE
Set the variant of the /lib directory to use. This is useful on systems which support Set the variant of the /lib directory to use. This is useful on systems
more than one binary format requiring separate libraries. The default is lib. which support more than one binary format requiring separate libraries.
The default is lib.
Example: --with-libdir=lib64 Example: --with-libdir=lib64
@ -1718,6 +1720,12 @@ Optional Packages:
--with-runtime-abi When using the ng runtime library, allows control --with-runtime-abi When using the ng runtime library, allows control
over the -fobjc-runtime= flag passed to clang. over the -fobjc-runtime= flag passed to clang.
--with-bash-path=PATH
Set the path to the bash executable to use. This is useful on systems
which do not have a reasonably recent version of bash in their path.
Example: --with-bash-path=/opt/homebrew/bin/bash
Some influential environment variables: Some influential environment variables:
CC C compiler command CC C compiler command
CFLAGS C compiler flags CFLAGS C compiler flags
@ -9974,51 +9982,6 @@ done
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# For test framework # For test framework
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_SHELLPROG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $SHELLPROG in
[\\/]* | ?:[\\/]*)
ac_cv_path_SHELLPROG="$SHELLPROG" # 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
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
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_SHELLPROG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$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
SHELLPROG=$ac_cv_path_SHELLPROG
if test -n "$SHELLPROG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHELLPROG" >&5
printf "%s\n" "$SHELLPROG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
# Extract the first word of "test", so it can be a program name with args. # Extract the first word of "test", so it can be a program name with args.
set dummy test; ac_word=$2 set dummy test; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@ -10064,12 +10027,98 @@ printf "%s\n" "no" >&6; }
fi fi
# Check whether --with-bash-path was given.
if test ${with_bash_path+y}
then :
withval=$with_bash_path; SHELLPROG="$withval"
else $as_nop
SHELLPROG=
fi
if test x"$SHELLPROG" = x""; then
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_SHELLPROG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $SHELLPROG in
[\\/]* | ?:[\\/]*)
ac_cv_path_SHELLPROG="$SHELLPROG" # 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
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
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_SHELLPROG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$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
SHELLPROG=$ac_cv_path_SHELLPROG
if test -n "$SHELLPROG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHELLPROG" >&5
printf "%s\n" "$SHELLPROG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
else
if test ! -x $SHELLPROG
then
echo "Unable to find executable bash program at $SHELLPROG."
SHELLPROG=
fi
fi
if test x"$SHELLPROG" = x""; then if test x"$SHELLPROG" = x""; then
echo "Unable to find the bash program (needed for testsuite)." echo "Unable to find the bash program (needed for testsuite)."
SHELLPROG=/bin/sh SHELLPROG=/bin/sh
MISSINGBASH=YES MISSINGBASH=YES
else else
MISSINGBASH=NO MISSINGBASH=NO
BVER=`$SHELLPROG -c 'echo $BASH_VERSION'`
BMAJ=`echo $BVER | sed -e 's/\..*//'`
BMIN=`echo $BVER | sed -e 's/^[0-9]\+\.\([0-9]\+\).*/\1/'`
if test ${BMAJ} -lt 4
then
MISSINGBASH=YES
else
if test ${BMAJ} -eq 4 -a ${BMIN} -lt 3
then
MISSINGBASH=YES
fi
fi
if test ${MISSINGBASH} = "YES"
then
echo "The bash progrem version is too old (needed for testsuite)."
SHELLPROG=/bin/sh
fi
fi
if test ${MISSINGBASH} = "YES"
then
echo "Please configure using --with-bash-path= to specify a modernish"
echo "bash program (version 4.3 or later)."
SHELLPROG=/bin/sh
fi fi

View file

@ -396,8 +396,9 @@ fi
AC_MSG_CHECKING([for architecture-specific lib path]) AC_MSG_CHECKING([for architecture-specific lib path])
AC_ARG_WITH(libdir,[ AC_ARG_WITH(libdir,[
--with-libdir=FILE --with-libdir=FILE
Set the variant of the /lib directory to use. This is useful on systems which support Set the variant of the /lib directory to use. This is useful on systems
more than one binary format requiring separate libraries. The default is lib. which support more than one binary format requiring separate libraries.
The default is lib.
Example: --with-libdir=lib64 Example: --with-libdir=lib64
], ],
LIBDIR="$withval",LIBDIR="lib") LIBDIR="$withval",LIBDIR="lib")
@ -1778,14 +1779,53 @@ AC_CHECK_PROGS(LATEX2HTML, latex2html)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# For test framework # For test framework
#-------------------------------------------------------------------- #--------------------------------------------------------------------
AC_PATH_PROG(SHELLPROG, bash)
AC_PATH_PROG(TESTPROG, test) AC_PATH_PROG(TESTPROG, test)
AC_ARG_WITH(bash-path,[
--with-bash-path=PATH
Set the path to the bash executable to use. This is useful on systems
which do not have a reasonably recent version of bash in their path.
Example: --with-bash-path=/opt/homebrew/bin/bash
],
SHELLPROG="$withval",SHELLPROG=)
if test x"$SHELLPROG" = x""; then
AC_PATH_PROG(SHELLPROG, bash)
else
if test ! -x $SHELLPROG
then
echo "Unable to find executable bash program at $SHELLPROG."
SHELLPROG=
fi
fi
if test x"$SHELLPROG" = x""; then if test x"$SHELLPROG" = x""; then
echo "Unable to find the bash program (needed for testsuite)." echo "Unable to find the bash program (needed for testsuite)."
SHELLPROG=/bin/sh SHELLPROG=/bin/sh
MISSINGBASH=YES MISSINGBASH=YES
else else
MISSINGBASH=NO MISSINGBASH=NO
BVER=`$SHELLPROG -c 'echo $BASH_VERSION'`
BMAJ=`echo $BVER | sed -e 's/\..*//'`
BMIN=`echo $BVER | sed -e 's/^[[0-9]]\+\.\([[0-9]]\+\).*/\1/'`
if test ${BMAJ} -lt 4
then
MISSINGBASH=YES
else
if test ${BMAJ} -eq 4 -a ${BMIN} -lt 3
then
MISSINGBASH=YES
fi
fi
if test ${MISSINGBASH} = "YES"
then
echo "The bash progrem version is too old (needed for testsuite)."
SHELLPROG=/bin/sh
fi
fi
if test ${MISSINGBASH} = "YES"
then
echo "Please configure using --with-bash-path= to specify a modernish"
echo "bash program (version 4.3 or later)."
SHELLPROG=/bin/sh
fi fi
AC_SUBST(MISSINGBASH) AC_SUBST(MISSINGBASH)