1
1
#! /bin/sh
2
2
# Attempt to guess a canonical system name.
3
- # Copyright 1992-2018 Free Software Foundation, Inc.
3
+ # Copyright 1992-2019 Free Software Foundation, Inc.
4
4
5
- timestamp=' 2018-06-26 '
5
+ timestamp=' 2019-01-03 '
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-2018 Free Software Foundation, Inc.
53
+ Copyright 1992-2019 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."
@@ -84,8 +84,6 @@ if test $# != 0; then
84
84
exit 1
85
85
fi
86
86
87
- trap ' exit 1' 1 2 15
88
-
89
87
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90
88
# compiler to aid in system detection is discouraged as it requires
91
89
# temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,38 @@ trap 'exit 1' 1 2 15
96
94
97
95
# Portable tmp directory creation inspired by the Autoconf team.
98
96
99
- set_cc_for_build='
100
- trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101
- trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102
- : ${TMPDIR=/tmp} ;
103
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107
- dummy=$tmp/dummy ;
108
- tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109
- case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
110
- ,,) echo "int x;" > "$dummy.c" ;
111
- for c in cc gcc c89 c99 ; do
112
- if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
113
- CC_FOR_BUILD="$c"; break ;
114
- fi ;
115
- done ;
116
- if test x"$CC_FOR_BUILD" = x ; then
117
- CC_FOR_BUILD=no_compiler_found ;
118
- fi
119
- ;;
120
- ,,*) CC_FOR_BUILD=$CC ;;
121
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
122
- esac ; set_cc_for_build= ;'
97
+ tmp=
98
+ # shellcheck disable=SC2172
99
+ trap ' test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
100
+
101
+ set_cc_for_build () {
102
+ : " ${TMPDIR=/ tmp} "
103
+ # shellcheck disable=SC2039
104
+ { tmp=` (umask 077 && mktemp -d " $TMPDIR /cgXXXXXX" ) 2> /dev/null` && test -n " $tmp " && test -d " $tmp " ; } ||
105
+ { test -n " $RANDOM " && tmp=$TMPDIR /cg$$ -$RANDOM && (umask 077 && mkdir " $tmp " 2> /dev/null) ; } ||
106
+ { tmp=$TMPDIR /cg-$$ && (umask 077 && mkdir " $tmp " 2> /dev/null) && echo " Warning: creating insecure temp directory" >&2 ; } ||
107
+ { echo " $me : cannot create a temporary directory in $TMPDIR " >&2 ; exit 1 ; }
108
+ dummy=$tmp /dummy
109
+ case ${CC_FOR_BUILD-} ,${HOST_CC-} ,${CC-} in
110
+ ,,) echo " int x;" > " $dummy .c"
111
+ for driver in cc gcc c89 c99 ; do
112
+ if ($driver -c -o " $dummy .o" " $dummy .c" ) > /dev/null 2>&1 ; then
113
+ CC_FOR_BUILD=" $driver "
114
+ break
115
+ fi
116
+ done
117
+ if test x" $CC_FOR_BUILD " = x ; then
118
+ CC_FOR_BUILD=no_compiler_found
119
+ fi
120
+ ;;
121
+ ,,* ) CC_FOR_BUILD=$CC ;;
122
+ ,* ,* ) CC_FOR_BUILD=$HOST_CC ;;
123
+ esac
124
+ }
123
125
124
126
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125
127
# (ghazi@noc.rutgers.edu 1994-08-24)
126
- if ( test -f /.attbin/uname) > /dev/null 2>&1 ; then
128
+ if test -f /.attbin/uname ; then
127
129
PATH=$PATH :/.attbin ; export PATH
128
130
fi
129
131
@@ -138,7 +140,7 @@ Linux|GNU|GNU/*)
138
140
# We could probably try harder.
139
141
LIBC=gnu
140
142
141
- eval " $ set_cc_for_build"
143
+ set_cc_for_build
142
144
cat << -EOF > "$dummy .c"
143
145
#include <features.h>
144
146
#if defined(__UCLIBC__)
@@ -199,7 +201,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
199
201
os=netbsdelf
200
202
;;
201
203
arm* |i386|m68k|ns32k|sh3* |sparc|vax)
202
- eval " $ set_cc_for_build"
204
+ set_cc_for_build
203
205
if echo __ELF__ | $CC_FOR_BUILD -E - 2> /dev/null \
204
206
| grep -q __ELF__
205
207
then
@@ -383,13 +385,26 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
383
385
echo sparc-hal-solaris2" ` echo " $UNAME_RELEASE " | sed -e ' s/[^.]*//' ` "
384
386
exit ;;
385
387
sun4* :SunOS:5.* :* | tadpole* :SunOS:5.* :* )
386
- echo sparc-sun-solaris2" ` echo " $UNAME_RELEASE " | sed -e ' s/[^.]*//' ` "
388
+ set_cc_for_build
389
+ SUN_ARCH=sparc
390
+ # If there is a compiler, see if it is configured for 64-bit objects.
391
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
392
+ # This test works for both compilers.
393
+ if [ " $CC_FOR_BUILD " != no_compiler_found ]; then
394
+ if (echo ' #ifdef __sparcv9' ; echo IS_64BIT_ARCH; echo ' #endif' ) | \
395
+ (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
396
+ grep IS_64BIT_ARCH > /dev/null
397
+ then
398
+ SUN_ARCH=sparcv9
399
+ fi
400
+ fi
401
+ echo " $SUN_ARCH " -sun-solaris2" ` echo " $UNAME_RELEASE " | sed -e ' s/[^.]*//' ` "
387
402
exit ;;
388
403
i86pc:AuroraUX:5.* :* | i86xen:AuroraUX:5.* :* )
389
404
echo i386-pc-auroraux" $UNAME_RELEASE "
390
405
exit ;;
391
406
i86pc:SunOS:5.* :* | i86xen:SunOS:5.* :* )
392
- eval " $ set_cc_for_build"
407
+ set_cc_for_build
393
408
SUN_ARCH=i386
394
409
# If there is a compiler, see if it is configured for 64-bit objects.
395
410
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -482,7 +497,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
482
497
echo clipper-intergraph-clix" $UNAME_RELEASE "
483
498
exit ;;
484
499
mips:* :* :UMIPS | mips:* :* :RISCos)
485
- eval " $ set_cc_for_build"
500
+ set_cc_for_build
486
501
sed ' s/^ //' << EOF > "$dummy .c"
487
502
#ifdef __cplusplus
488
503
#include <stdio.h> /* for printf() prototype */
579
594
exit ;;
580
595
* :AIX:2:3)
581
596
if grep bos325 /usr/include/stdio.h > /dev/null 2>&1 ; then
582
- eval " $ set_cc_for_build"
597
+ set_cc_for_build
583
598
sed ' s/^ //' << EOF > "$dummy .c"
584
599
#include <sys/systemcfg.h>
585
600
660
675
esac
661
676
fi
662
677
if [ " $HP_ARCH " = " " ]; then
663
- eval " $ set_cc_for_build"
678
+ set_cc_for_build
664
679
sed ' s/^ //' << EOF > "$dummy .c"
665
680
666
681
#define _HPUX_SOURCE
700
715
esac
701
716
if [ " $HP_ARCH " = hppa2.0w ]
702
717
then
703
- eval " $ set_cc_for_build"
718
+ set_cc_for_build
704
719
705
720
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
706
721
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
726
741
echo ia64-hp-hpux" $HPUX_REV "
727
742
exit ;;
728
743
3050* :HI-UX:* :* )
729
- eval " $ set_cc_for_build"
744
+ set_cc_for_build
730
745
sed ' s/^ //' << EOF > "$dummy .c"
731
746
#include <unistd.h>
732
747
int
840
855
* :BSD/OS:* :* )
841
856
echo " $UNAME_MACHINE " -unknown-bsdi" $UNAME_RELEASE "
842
857
exit ;;
858
+ arm:FreeBSD:* :* )
859
+ UNAME_PROCESSOR=` uname -p`
860
+ set_cc_for_build
861
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2> /dev/null \
862
+ | grep -q __ARM_PCS_VFP
863
+ then
864
+ echo " ${UNAME_PROCESSOR} " -unknown-freebsd" ` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' ` " -gnueabi
865
+ else
866
+ echo " ${UNAME_PROCESSOR} " -unknown-freebsd" ` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' ` " -gnueabihf
867
+ fi
868
+ exit ;;
843
869
* :FreeBSD:* :* )
844
870
UNAME_PROCESSOR=` /usr/bin/uname -p`
845
871
case " $UNAME_PROCESSOR " in
881
907
echo " $UNAME_MACHINE " -pc-uwin
882
908
exit ;;
883
909
amd64:CYGWIN* :* :* | x86_64:CYGWIN* :* :* )
884
- echo x86_64-unknown -cygwin
910
+ echo x86_64-pc -cygwin
885
911
exit ;;
886
912
prep* :SunOS:5.* :* )
887
913
echo powerpcle-unknown-solaris2" ` echo " $UNAME_RELEASE " | sed -e ' s/[^.]*//' ` "
922
948
echo " $UNAME_MACHINE " -unknown-linux-" $LIBC "
923
949
exit ;;
924
950
arm* :Linux:* :* )
925
- eval " $ set_cc_for_build"
951
+ set_cc_for_build
926
952
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2> /dev/null \
927
953
| grep -q __ARM_EABI__
928
954
then
971
997
echo " $UNAME_MACHINE " -unknown-linux-" $LIBC "
972
998
exit ;;
973
999
mips:Linux:* :* | mips64:Linux:* :* )
974
- eval " $ set_cc_for_build"
1000
+ set_cc_for_build
975
1001
sed ' s/^ //' << EOF > "$dummy .c"
976
1002
#undef CPU
977
1003
#undef ${UNAME_MACHINE}
@@ -1285,7 +1311,7 @@ EOF
1285
1311
exit ;;
1286
1312
* :Darwin:* :* )
1287
1313
UNAME_PROCESSOR=` uname -p` || UNAME_PROCESSOR=unknown
1288
- eval " $ set_cc_for_build"
1314
+ set_cc_for_build
1289
1315
if test " $UNAME_PROCESSOR " = unknown ; then
1290
1316
UNAME_PROCESSOR=powerpc
1291
1317
fi
@@ -1358,6 +1384,7 @@ EOF
1358
1384
# "uname -m" is not consistent, so use $cputype instead. 386
1359
1385
# is converted to i386 for consistency with other x86
1360
1386
# operating systems.
1387
+ # shellcheck disable=SC2154
1361
1388
if test " $cputype " = 386; then
1362
1389
UNAME_MACHINE=i386
1363
1390
else
@@ -1414,6 +1441,9 @@ EOF
1414
1441
amd64:Isilon\ OneFS:* :* )
1415
1442
echo x86_64-unknown-onefs
1416
1443
exit ;;
1444
+ * :Unleashed:* :* )
1445
+ echo " $UNAME_MACHINE " -unknown-unleashed" $UNAME_RELEASE "
1446
+ exit ;;
1417
1447
esac
1418
1448
1419
1449
echo " $0 : unable to guess system type" >&2
0 commit comments