1
1
#! /bin/sh
2
2
# Attempt to guess a canonical system name.
3
- # Copyright 1992-2019 Free Software Foundation, Inc.
3
+ # Copyright 1992-2020 Free Software Foundation, Inc.
4
4
5
- timestamp=' 2019-04-28 '
5
+ timestamp=' 2020-01-01 '
6
6
7
7
# This file is free software; you can redistribute it and/or modify it
8
8
# under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
50
50
GNU config.guess ($timestamp )
51
51
52
52
Originally written by Per Bothner.
53
- Copyright 1992-2019 Free Software Foundation, Inc.
53
+ Copyright 1992-2020 Free Software Foundation, Inc.
54
54
55
55
This is free software; see the source for copying conditions. There is NO
56
56
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
99
99
trap ' test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
100
100
101
101
set_cc_for_build () {
102
+ # prevent multiple calls if $tmp is already set
103
+ test " $tmp " && return 0
102
104
: " ${TMPDIR=/ tmp} "
103
105
# shellcheck disable=SC2039
104
106
{ tmp=` (umask 077 && mktemp -d " $TMPDIR /cgXXXXXX" ) 2> /dev/null` && test -n " $tmp " && test -d " $tmp " ; } ||
@@ -262,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
262
264
* :SolidBSD:* :* )
263
265
echo " $UNAME_MACHINE " -unknown-solidbsd" $UNAME_RELEASE "
264
266
exit ;;
267
+ * :OS108:* :* )
268
+ echo " $UNAME_MACHINE " -unknown-os108_" $UNAME_RELEASE "
269
+ exit ;;
265
270
macppc:MirBSD:* :* )
266
271
echo powerpc-unknown-mirbsd" $UNAME_RELEASE "
267
272
exit ;;
@@ -271,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
271
276
* :Sortix:* :* )
272
277
echo " $UNAME_MACHINE " -unknown-sortix
273
278
exit ;;
279
+ * :Twizzler:* :* )
280
+ echo " $UNAME_MACHINE " -unknown-twizzler
281
+ exit ;;
274
282
* :Redox:* :* )
275
283
echo " $UNAME_MACHINE " -unknown-redox
276
284
exit ;;
277
285
mips:OSF1:* .* )
278
- echo mips-dec-osf1
279
- exit ;;
286
+ echo mips-dec-osf1
287
+ exit ;;
280
288
alpha:OSF1:* :* )
281
289
case $UNAME_RELEASE in
282
290
* 4.0)
918
926
echo " $UNAME_MACHINE " -unknown-linux-" $LIBC "
919
927
exit ;;
920
928
alpha:Linux:* :* )
921
- case ` sed -n ' /^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
929
+ case ` sed -n ' /^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2> /dev/null ` in
922
930
EV5) UNAME_MACHINE=alphaev5 ;;
923
931
EV56) UNAME_MACHINE=alphaev56 ;;
924
932
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -1325,38 +1333,39 @@ EOF
1325
1333
echo " $UNAME_MACHINE " -apple-rhapsody" $UNAME_RELEASE "
1326
1334
exit ;;
1327
1335
* :Darwin:* :* )
1328
- UNAME_PROCESSOR=` uname -p` || UNAME_PROCESSOR=unknown
1329
- set_cc_for_build
1330
- if test " $UNAME_PROCESSOR " = unknown ; then
1331
- UNAME_PROCESSOR=powerpc
1336
+ UNAME_PROCESSOR=` uname -p`
1337
+ case $UNAME_PROCESSOR in
1338
+ unknown) UNAME_PROCESSOR=powerpc ;;
1339
+ esac
1340
+ if command -v xcode-select > /dev/null 2> /dev/null && \
1341
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1342
+ # Avoid executing cc if there is no toolchain installed as
1343
+ # cc will be a stub that puts up a graphical alert
1344
+ # prompting the user to install developer tools.
1345
+ CC_FOR_BUILD=no_compiler_found
1346
+ else
1347
+ set_cc_for_build
1332
1348
fi
1333
- if test " ` echo " $UNAME_RELEASE " | sed -e ' s/\..*//' ` " -le 10 ; then
1334
- if [ " $CC_FOR_BUILD " != no_compiler_found ]; then
1335
- if (echo ' #ifdef __LP64__' ; echo IS_64BIT_ARCH; echo ' #endif' ) | \
1336
- (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
1337
- grep IS_64BIT_ARCH > /dev/null
1338
- then
1339
- case $UNAME_PROCESSOR in
1340
- i386) UNAME_PROCESSOR=x86_64 ;;
1341
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
1342
- esac
1343
- fi
1344
- # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1345
- if (echo ' #ifdef __POWERPC__' ; echo IS_PPC; echo ' #endif' ) | \
1346
- (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
1347
- grep IS_PPC > /dev/null
1348
- then
1349
- UNAME_PROCESSOR=powerpc
1350
- fi
1349
+ if [ " $CC_FOR_BUILD " != no_compiler_found ]; then
1350
+ if (echo ' #ifdef __LP64__' ; echo IS_64BIT_ARCH; echo ' #endif' ) | \
1351
+ (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
1352
+ grep IS_64BIT_ARCH > /dev/null
1353
+ then
1354
+ case $UNAME_PROCESSOR in
1355
+ i386) UNAME_PROCESSOR=x86_64 ;;
1356
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
1357
+ esac
1358
+ fi
1359
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1360
+ if (echo ' #ifdef __POWERPC__' ; echo IS_PPC; echo ' #endif' ) | \
1361
+ (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
1362
+ grep IS_PPC > /dev/null
1363
+ then
1364
+ UNAME_PROCESSOR=powerpc
1351
1365
fi
1352
1366
elif test " $UNAME_PROCESSOR " = i386 ; then
1353
- # Avoid executing cc on OS X 10.9, as it ships with a stub
1354
- # that puts up a graphical alert prompting to install
1355
- # developer tools. Any system running Mac OS X 10.7 or
1356
- # later (Darwin 11 and later) is required to have a 64-bit
1357
- # processor. This is not true of the ARM version of Darwin
1358
- # that Apple uses in portable devices.
1359
- UNAME_PROCESSOR=x86_64
1367
+ # uname -m returns i386 or x86_64
1368
+ UNAME_PROCESSOR=$UNAME_MACHINE
1360
1369
fi
1361
1370
echo " $UNAME_PROCESSOR " -apple-darwin" $UNAME_RELEASE "
1362
1371
exit ;;
0 commit comments