11#! /bin/sh
22# Attempt to guess a canonical system name.
3- # Copyright 1992-2019 Free Software Foundation, Inc.
3+ # Copyright 1992-2020 Free Software Foundation, Inc.
44
5- timestamp=' 2019-03-04 '
5+ timestamp=' 2020-04-26 '
66
77# This file is free software; you can redistribute it and/or modify it
88# under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
5050GNU config.guess ($timestamp )
5151
5252Originally written by Per Bothner.
53- Copyright 1992-2019 Free Software Foundation, Inc.
53+ Copyright 1992-2020 Free Software Foundation, Inc.
5454
5555This is free software; see the source for copying conditions. There is NO
5656warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
9999trap ' test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
100100
101101set_cc_for_build () {
102+ # prevent multiple calls if $tmp is already set
103+ test " $tmp " && return 0
102104 : " ${TMPDIR=/ tmp} "
103105 # shellcheck disable=SC2039
104106 { 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
262264 * :SolidBSD:* :* )
263265 echo " $UNAME_MACHINE " -unknown-solidbsd" $UNAME_RELEASE "
264266 exit ;;
267+ * :OS108:* :* )
268+ echo " $UNAME_MACHINE " -unknown-os108_" $UNAME_RELEASE "
269+ exit ;;
265270 macppc:MirBSD:* :* )
266271 echo powerpc-unknown-mirbsd" $UNAME_RELEASE "
267272 exit ;;
@@ -271,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
271276 * :Sortix:* :* )
272277 echo " $UNAME_MACHINE " -unknown-sortix
273278 exit ;;
279+ * :Twizzler:* :* )
280+ echo " $UNAME_MACHINE " -unknown-twizzler
281+ exit ;;
274282 * :Redox:* :* )
275283 echo " $UNAME_MACHINE " -unknown-redox
276284 exit ;;
277285 mips:OSF1:* .* )
278- echo mips-dec-osf1
279- exit ;;
286+ echo mips-dec-osf1
287+ exit ;;
280288 alpha:OSF1:* :* )
281289 case $UNAME_RELEASE in
282290 * 4.0)
918926 echo " $UNAME_MACHINE " -unknown-linux-" $LIBC "
919927 exit ;;
920928 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
922930 EV5) UNAME_MACHINE=alphaev5 ;;
923931 EV56) UNAME_MACHINE=alphaev56 ;;
924932 PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -1325,38 +1333,39 @@ EOF
13251333 echo " $UNAME_MACHINE " -apple-rhapsody" $UNAME_RELEASE "
13261334 exit ;;
13271335 * :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
13321348 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
13511365 fi
13521366 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
13601369 fi
13611370 echo " $UNAME_PROCESSOR " -apple-darwin" $UNAME_RELEASE "
13621371 exit ;;
@@ -1468,6 +1477,14 @@ cat > "$dummy.c" <<EOF
14681477#include <sys/types.h>
14691478#include <sys/utsname.h>
14701479#endif
1480+ #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1481+ #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1482+ #include <signal.h>
1483+ #if defined(_SIZE_T_) || defined(SIGLOST)
1484+ #include <sys/utsname.h>
1485+ #endif
1486+ #endif
1487+ #endif
14711488main ()
14721489{
14731490#if defined (sony)
@@ -1554,19 +1571,24 @@ main ()
15541571#else
15551572 printf ("vax-dec-bsd\n"); exit (0);
15561573#endif
1574+ #else
1575+ #if defined(_SIZE_T_) || defined(SIGLOST)
1576+ struct utsname un;
1577+ uname (&un);
1578+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
15571579#else
15581580 printf ("vax-dec-ultrix\n"); exit (0);
15591581#endif
15601582#endif
1583+ #endif
15611584#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
15621585#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1563- #include <signal.h>
1564- #if defined(_SIZE_T_) /* >= ULTRIX4 */
1565- printf ("mips-dec-ultrix4\n"); exit (0);
1586+ #if defined(_SIZE_T_) || defined(SIGLOST)
1587+ struct utsname *un;
1588+ uname (&un);
1589+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
15661590#else
1567- #if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST)
1568- printf ("mips-dec-ultrix3\n"); exit (0);
1569- #endif
1591+ printf ("mips-dec-ultrix\n"); exit (0);
15701592#endif
15711593#endif
15721594#endif
@@ -1607,6 +1629,12 @@ copies of config.guess and config.sub with the latest versions from:
16071629 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
16081630and
16091631 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1632+ EOF
1633+
1634+ year=` echo $timestamp | sed ' s,-.*,,' `
1635+ # shellcheck disable=SC2003
1636+ if test " ` expr " \` date +%Y\` " - " $year " ` " -lt 3 ; then
1637+ cat >&2 << EOF
16101638
16111639If $0 has already been updated, send the following data and any
16121640information you think might be pertinent to config-patches@gnu.org to
@@ -1634,6 +1662,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
16341662UNAME_SYSTEM = "$UNAME_SYSTEM "
16351663UNAME_VERSION = "$UNAME_VERSION "
16361664EOF
1665+ fi
16371666
16381667exit 1
16391668
0 commit comments