* config.guess (set_cc_for_build): Guard against $CC_FOR_BUILD,

$HOST_CC and $CC being undefined by using ${var-} style expansion.
	(*:NetBSD:*:*): Likewise for $abi.
	* testsuite/config-guess.sh: Run config.guess under `sh -eu'.
This commit is contained in:
Ben Elliston 2018-05-19 18:58:37 +10:00
parent 32d5bd9cec
commit 382847f038
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2018-05-19 Ben Elliston <bje@gnu.org>
* config.guess (set_cc_for_build): Guard against $CC_FOR_BUILD,
$HOST_CC and $CC being undefined by using ${var-} style expansion.
(*:NetBSD:*:*): Likewise for $abi.
* testsuite/config-guess.sh: Run config.guess under `sh -eu'.
2018-05-19 Ben Elliston <bje@gnu.org>
* testsuite/config-guess.sh: Set -eu for robustness. Run

6
config.guess vendored
View File

@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2018 Free Software Foundation, Inc.
timestamp='2018-03-08'
timestamp='2018-05-19'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -106,7 +106,7 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c" ;
for c in cc gcc c89 c99 ; do
if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
@ -237,7 +237,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "$machine-${os}${release}${abi}"
echo "$machine-${os}${release}${abi-}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`

View File

@ -30,7 +30,7 @@ run_config_guess()
[ \$1 = -p ] && echo "@PROCESSOR@" && exit 0
EOF
chmod +x uname
output=$(sh -e ../config.guess 2>/dev/null)
output=$(sh -eu ../config.guess 2>/dev/null)
if test $? != 0 ; then
echo "FAIL: unable to guess $machine:$release:$system:$version"
rc=1