8174069: Verify that bash is at least version 3.2

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2017-02-07 12:17:59 +01:00
parent 184939a7e2
commit 2fd4131668
2 changed files with 27 additions and 1 deletions

View File

@ -1202,6 +1202,18 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
# Check for support for specific options in bash
AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
[
# Check bash version
# Extra [ ] to stop m4 mangling
[ BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ]
AC_MSG_CHECKING([bash version])
AC_MSG_RESULT([$BASH_VER])
BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
AC_MSG_ERROR([bash version 3.2 or better is required])
fi
# Test if bash supports pipefail.
AC_MSG_CHECKING([if bash supports pipefail])
if ${BASH} -c 'set -o pipefail'; then

View File

@ -5170,7 +5170,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1486175373
DATE_WHEN_GENERATED=1486465953
###############################################################################
#
@ -24092,6 +24092,20 @@ $as_echo "$tool_specified" >&6; }
fi
# Check bash version
# Extra [ ] to stop m4 mangling
BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5
$as_echo_n "checking bash version... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5
$as_echo "$BASH_VER" >&6; }
BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5
fi
# Test if bash supports pipefail.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5
$as_echo_n "checking if bash supports pipefail... " >&6; }