Mercurial > hg > CbC > CbC_gcc
comparison config.guess @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 # Attempt to guess a canonical system name. | 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-07-24' |
6 | 6 |
7 # This file is free software; you can redistribute it and/or modify it | 7 # This file is free software; you can redistribute it and/or modify it |
8 # under the terms of the GNU General Public License as published by | 8 # under the terms of the GNU General Public License as published by |
9 # the Free Software Foundation; either version 3 of the License, or | 9 # the Free Software Foundation; either version 3 of the License, or |
10 # (at your option) any later version. | 10 # (at your option) any later version. |
48 | 48 |
49 version="\ | 49 version="\ |
50 GNU config.guess ($timestamp) | 50 GNU config.guess ($timestamp) |
51 | 51 |
52 Originally written by Per Bothner. | 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 This is free software; see the source for copying conditions. There is NO | 55 This is free software; see the source for copying conditions. There is NO |
56 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | 56 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
57 | 57 |
58 help=" | 58 help=" |
82 if test $# != 0; then | 82 if test $# != 0; then |
83 echo "$me: too many arguments$help" >&2 | 83 echo "$me: too many arguments$help" >&2 |
84 exit 1 | 84 exit 1 |
85 fi | 85 fi |
86 | 86 |
87 trap 'exit 1' 1 2 15 | |
88 | |
89 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a | 87 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
90 # compiler to aid in system detection is discouraged as it requires | 88 # compiler to aid in system detection is discouraged as it requires |
91 # temporary files to be created and, as you can see below, it is a | 89 # temporary files to be created and, as you can see below, it is a |
92 # headache to deal with in a portable fashion. | 90 # headache to deal with in a portable fashion. |
93 | 91 |
94 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still | 92 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still |
95 # use `HOST_CC' if defined, but it is deprecated. | 93 # use `HOST_CC' if defined, but it is deprecated. |
96 | 94 |
97 # Portable tmp directory creation inspired by the Autoconf team. | 95 # Portable tmp directory creation inspired by the Autoconf team. |
98 | 96 |
99 set_cc_for_build=' | 97 tmp= |
100 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; | 98 # shellcheck disable=SC2172 |
101 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; | 99 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 |
102 : ${TMPDIR=/tmp} ; | 100 |
103 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || | 101 set_cc_for_build() { |
104 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || | 102 : "${TMPDIR=/tmp}" |
105 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || | 103 # shellcheck disable=SC2039 |
106 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; | 104 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
107 dummy=$tmp/dummy ; | 105 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || |
108 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; | 106 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || |
109 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in | 107 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } |
110 ,,) echo "int x;" > "$dummy.c" ; | 108 dummy=$tmp/dummy |
111 for c in cc gcc c89 c99 ; do | 109 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in |
112 if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then | 110 ,,) echo "int x;" > "$dummy.c" |
113 CC_FOR_BUILD="$c"; break ; | 111 for driver in cc gcc c89 c99 ; do |
114 fi ; | 112 if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then |
115 done ; | 113 CC_FOR_BUILD="$driver" |
116 if test x"$CC_FOR_BUILD" = x ; then | 114 break |
117 CC_FOR_BUILD=no_compiler_found ; | 115 fi |
118 fi | 116 done |
119 ;; | 117 if test x"$CC_FOR_BUILD" = x ; then |
120 ,,*) CC_FOR_BUILD=$CC ;; | 118 CC_FOR_BUILD=no_compiler_found |
121 ,*,*) CC_FOR_BUILD=$HOST_CC ;; | 119 fi |
122 esac ; set_cc_for_build= ;' | 120 ;; |
121 ,,*) CC_FOR_BUILD=$CC ;; | |
122 ,*,*) CC_FOR_BUILD=$HOST_CC ;; | |
123 esac | |
124 } | |
123 | 125 |
124 # This is needed to find uname on a Pyramid OSx when run in the BSD universe. | 126 # This is needed to find uname on a Pyramid OSx when run in the BSD universe. |
125 # (ghazi@noc.rutgers.edu 1994-08-24) | 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 PATH=$PATH:/.attbin ; export PATH | 129 PATH=$PATH:/.attbin ; export PATH |
128 fi | 130 fi |
129 | 131 |
130 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown | 132 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
131 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown | 133 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
136 Linux|GNU|GNU/*) | 138 Linux|GNU|GNU/*) |
137 # If the system lacks a compiler, then just pick glibc. | 139 # If the system lacks a compiler, then just pick glibc. |
138 # We could probably try harder. | 140 # We could probably try harder. |
139 LIBC=gnu | 141 LIBC=gnu |
140 | 142 |
141 eval "$set_cc_for_build" | 143 set_cc_for_build |
142 cat <<-EOF > "$dummy.c" | 144 cat <<-EOF > "$dummy.c" |
143 #include <features.h> | 145 #include <features.h> |
144 #if defined(__UCLIBC__) | 146 #if defined(__UCLIBC__) |
145 LIBC=uclibc | 147 LIBC=uclibc |
146 #elif defined(__dietlibc__) | 148 #elif defined(__dietlibc__) |
197 case "$UNAME_MACHINE_ARCH" in | 199 case "$UNAME_MACHINE_ARCH" in |
198 earm*) | 200 earm*) |
199 os=netbsdelf | 201 os=netbsdelf |
200 ;; | 202 ;; |
201 arm*|i386|m68k|ns32k|sh3*|sparc|vax) | 203 arm*|i386|m68k|ns32k|sh3*|sparc|vax) |
202 eval "$set_cc_for_build" | 204 set_cc_for_build |
203 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | 205 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
204 | grep -q __ELF__ | 206 | grep -q __ELF__ |
205 then | 207 then |
206 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). | 208 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). |
207 # Return netbsd for either. FIX? | 209 # Return netbsd for either. FIX? |
258 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" | 260 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" |
259 exit ;; | 261 exit ;; |
260 *:SolidBSD:*:*) | 262 *:SolidBSD:*:*) |
261 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" | 263 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" |
262 exit ;; | 264 exit ;; |
265 *:OS108:*:*) | |
266 echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" | |
267 exit ;; | |
263 macppc:MirBSD:*:*) | 268 macppc:MirBSD:*:*) |
264 echo powerpc-unknown-mirbsd"$UNAME_RELEASE" | 269 echo powerpc-unknown-mirbsd"$UNAME_RELEASE" |
265 exit ;; | 270 exit ;; |
266 *:MirBSD:*:*) | 271 *:MirBSD:*:*) |
267 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" | 272 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" |
271 exit ;; | 276 exit ;; |
272 *:Redox:*:*) | 277 *:Redox:*:*) |
273 echo "$UNAME_MACHINE"-unknown-redox | 278 echo "$UNAME_MACHINE"-unknown-redox |
274 exit ;; | 279 exit ;; |
275 mips:OSF1:*.*) | 280 mips:OSF1:*.*) |
276 echo mips-dec-osf1 | 281 echo mips-dec-osf1 |
277 exit ;; | 282 exit ;; |
278 alpha:OSF1:*:*) | 283 alpha:OSF1:*:*) |
279 case $UNAME_RELEASE in | 284 case $UNAME_RELEASE in |
280 *4.0) | 285 *4.0) |
281 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` | 286 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
282 ;; | 287 ;; |
387 exit ;; | 392 exit ;; |
388 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) | 393 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) |
389 echo i386-pc-auroraux"$UNAME_RELEASE" | 394 echo i386-pc-auroraux"$UNAME_RELEASE" |
390 exit ;; | 395 exit ;; |
391 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) | 396 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
392 eval "$set_cc_for_build" | 397 set_cc_for_build |
393 SUN_ARCH=i386 | 398 SUN_ARCH=i386 |
394 # If there is a compiler, see if it is configured for 64-bit objects. | 399 # If there is a compiler, see if it is configured for 64-bit objects. |
395 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. | 400 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. |
396 # This test works for both compilers. | 401 # This test works for both compilers. |
397 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | 402 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then |
480 exit ;; | 485 exit ;; |
481 2020:CLIX:*:* | 2430:CLIX:*:*) | 486 2020:CLIX:*:* | 2430:CLIX:*:*) |
482 echo clipper-intergraph-clix"$UNAME_RELEASE" | 487 echo clipper-intergraph-clix"$UNAME_RELEASE" |
483 exit ;; | 488 exit ;; |
484 mips:*:*:UMIPS | mips:*:*:RISCos) | 489 mips:*:*:UMIPS | mips:*:*:RISCos) |
485 eval "$set_cc_for_build" | 490 set_cc_for_build |
486 sed 's/^ //' << EOF > "$dummy.c" | 491 sed 's/^ //' << EOF > "$dummy.c" |
487 #ifdef __cplusplus | 492 #ifdef __cplusplus |
488 #include <stdio.h> /* for printf() prototype */ | 493 #include <stdio.h> /* for printf() prototype */ |
489 int main (int argc, char *argv[]) { | 494 int main (int argc, char *argv[]) { |
490 #else | 495 #else |
577 fi | 582 fi |
578 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" | 583 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" |
579 exit ;; | 584 exit ;; |
580 *:AIX:2:3) | 585 *:AIX:2:3) |
581 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then | 586 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then |
582 eval "$set_cc_for_build" | 587 set_cc_for_build |
583 sed 's/^ //' << EOF > "$dummy.c" | 588 sed 's/^ //' << EOF > "$dummy.c" |
584 #include <sys/systemcfg.h> | 589 #include <sys/systemcfg.h> |
585 | 590 |
586 main() | 591 main() |
587 { | 592 { |
658 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 | 663 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 |
659 esac ;; | 664 esac ;; |
660 esac | 665 esac |
661 fi | 666 fi |
662 if [ "$HP_ARCH" = "" ]; then | 667 if [ "$HP_ARCH" = "" ]; then |
663 eval "$set_cc_for_build" | 668 set_cc_for_build |
664 sed 's/^ //' << EOF > "$dummy.c" | 669 sed 's/^ //' << EOF > "$dummy.c" |
665 | 670 |
666 #define _HPUX_SOURCE | 671 #define _HPUX_SOURCE |
667 #include <stdlib.h> | 672 #include <stdlib.h> |
668 #include <unistd.h> | 673 #include <unistd.h> |
698 test -z "$HP_ARCH" && HP_ARCH=hppa | 703 test -z "$HP_ARCH" && HP_ARCH=hppa |
699 fi ;; | 704 fi ;; |
700 esac | 705 esac |
701 if [ "$HP_ARCH" = hppa2.0w ] | 706 if [ "$HP_ARCH" = hppa2.0w ] |
702 then | 707 then |
703 eval "$set_cc_for_build" | 708 set_cc_for_build |
704 | 709 |
705 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating | 710 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating |
706 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler | 711 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler |
707 # generating 64-bit code. GNU and HP use different nomenclature: | 712 # generating 64-bit code. GNU and HP use different nomenclature: |
708 # | 713 # |
724 ia64:HP-UX:*:*) | 729 ia64:HP-UX:*:*) |
725 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` | 730 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` |
726 echo ia64-hp-hpux"$HPUX_REV" | 731 echo ia64-hp-hpux"$HPUX_REV" |
727 exit ;; | 732 exit ;; |
728 3050*:HI-UX:*:*) | 733 3050*:HI-UX:*:*) |
729 eval "$set_cc_for_build" | 734 set_cc_for_build |
730 sed 's/^ //' << EOF > "$dummy.c" | 735 sed 's/^ //' << EOF > "$dummy.c" |
731 #include <unistd.h> | 736 #include <unistd.h> |
732 int | 737 int |
733 main () | 738 main () |
734 { | 739 { |
838 echo sparc-unknown-bsdi"$UNAME_RELEASE" | 843 echo sparc-unknown-bsdi"$UNAME_RELEASE" |
839 exit ;; | 844 exit ;; |
840 *:BSD/OS:*:*) | 845 *:BSD/OS:*:*) |
841 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" | 846 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" |
842 exit ;; | 847 exit ;; |
848 arm:FreeBSD:*:*) | |
849 UNAME_PROCESSOR=`uname -p` | |
850 set_cc_for_build | |
851 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | |
852 | grep -q __ARM_PCS_VFP | |
853 then | |
854 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi | |
855 else | |
856 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf | |
857 fi | |
858 exit ;; | |
843 *:FreeBSD:*:*) | 859 *:FreeBSD:*:*) |
844 UNAME_PROCESSOR=`/usr/bin/uname -p` | 860 UNAME_PROCESSOR=`/usr/bin/uname -p` |
845 case "$UNAME_PROCESSOR" in | 861 case "$UNAME_PROCESSOR" in |
846 amd64) | 862 amd64) |
847 UNAME_PROCESSOR=x86_64 ;; | 863 UNAME_PROCESSOR=x86_64 ;; |
879 esac ;; | 895 esac ;; |
880 i*:UWIN*:*) | 896 i*:UWIN*:*) |
881 echo "$UNAME_MACHINE"-pc-uwin | 897 echo "$UNAME_MACHINE"-pc-uwin |
882 exit ;; | 898 exit ;; |
883 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) | 899 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) |
884 echo x86_64-unknown-cygwin | 900 echo x86_64-pc-cygwin |
885 exit ;; | 901 exit ;; |
886 prep*:SunOS:5.*:*) | 902 prep*:SunOS:5.*:*) |
887 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" | 903 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" |
888 exit ;; | 904 exit ;; |
889 *:GNU:*:*) | 905 *:GNU:*:*) |
920 exit ;; | 936 exit ;; |
921 arc:Linux:*:* | arceb:Linux:*:*) | 937 arc:Linux:*:* | arceb:Linux:*:*) |
922 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | 938 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
923 exit ;; | 939 exit ;; |
924 arm*:Linux:*:*) | 940 arm*:Linux:*:*) |
925 eval "$set_cc_for_build" | 941 set_cc_for_build |
926 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | 942 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
927 | grep -q __ARM_EABI__ | 943 | grep -q __ARM_EABI__ |
928 then | 944 then |
929 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | 945 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
930 else | 946 else |
969 exit ;; | 985 exit ;; |
970 m68*:Linux:*:*) | 986 m68*:Linux:*:*) |
971 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | 987 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
972 exit ;; | 988 exit ;; |
973 mips:Linux:*:* | mips64:Linux:*:*) | 989 mips:Linux:*:* | mips64:Linux:*:*) |
974 eval "$set_cc_for_build" | 990 set_cc_for_build |
991 IS_GLIBC=0 | |
992 test x"${LIBC}" = xgnu && IS_GLIBC=1 | |
975 sed 's/^ //' << EOF > "$dummy.c" | 993 sed 's/^ //' << EOF > "$dummy.c" |
976 #undef CPU | 994 #undef CPU |
977 #undef ${UNAME_MACHINE} | 995 #undef mips |
978 #undef ${UNAME_MACHINE}el | 996 #undef mipsel |
997 #undef mips64 | |
998 #undef mips64el | |
999 #if ${IS_GLIBC} && defined(_ABI64) | |
1000 LIBCABI=gnuabi64 | |
1001 #else | |
1002 #if ${IS_GLIBC} && defined(_ABIN32) | |
1003 LIBCABI=gnuabin32 | |
1004 #else | |
1005 LIBCABI=${LIBC} | |
1006 #endif | |
1007 #endif | |
1008 | |
1009 #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 | |
1010 CPU=mipsisa64r6 | |
1011 #else | |
1012 #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 | |
1013 CPU=mipsisa32r6 | |
1014 #else | |
1015 #if defined(__mips64) | |
1016 CPU=mips64 | |
1017 #else | |
1018 CPU=mips | |
1019 #endif | |
1020 #endif | |
1021 #endif | |
1022 | |
979 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | 1023 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
980 CPU=${UNAME_MACHINE}el | 1024 MIPS_ENDIAN=el |
981 #else | 1025 #else |
982 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | 1026 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
983 CPU=${UNAME_MACHINE} | 1027 MIPS_ENDIAN= |
984 #else | 1028 #else |
985 CPU= | 1029 MIPS_ENDIAN= |
986 #endif | 1030 #endif |
987 #endif | 1031 #endif |
988 EOF | 1032 EOF |
989 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" | 1033 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" |
990 test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } | 1034 test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } |
991 ;; | 1035 ;; |
992 mips64el:Linux:*:*) | 1036 mips64el:Linux:*:*) |
993 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" | 1037 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
994 exit ;; | 1038 exit ;; |
995 openrisc*:Linux:*:*) | 1039 openrisc*:Linux:*:*) |
1098 case `/bin/uname -X | grep "^Machine"` in | 1142 case `/bin/uname -X | grep "^Machine"` in |
1099 *486*) UNAME_MACHINE=i486 ;; | 1143 *486*) UNAME_MACHINE=i486 ;; |
1100 *Pentium) UNAME_MACHINE=i586 ;; | 1144 *Pentium) UNAME_MACHINE=i586 ;; |
1101 *Pent*|*Celeron) UNAME_MACHINE=i686 ;; | 1145 *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
1102 esac | 1146 esac |
1103 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" | 1147 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" |
1104 exit ;; | 1148 exit ;; |
1105 i*86:*:3.2:*) | 1149 i*86:*:3.2:*) |
1106 if test -f /usr/options/cb.name; then | 1150 if test -f /usr/options/cb.name; then |
1107 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` | 1151 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
1108 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" | 1152 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" |
1282 exit ;; | 1326 exit ;; |
1283 *:Rhapsody:*:*) | 1327 *:Rhapsody:*:*) |
1284 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" | 1328 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" |
1285 exit ;; | 1329 exit ;; |
1286 *:Darwin:*:*) | 1330 *:Darwin:*:*) |
1287 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | 1331 UNAME_PROCESSOR=`uname -p` |
1288 eval "$set_cc_for_build" | 1332 case $UNAME_PROCESSOR in |
1289 if test "$UNAME_PROCESSOR" = unknown ; then | 1333 unknown) UNAME_PROCESSOR=powerpc ;; |
1290 UNAME_PROCESSOR=powerpc | 1334 esac |
1291 fi | 1335 if command -v xcode-select > /dev/null 2> /dev/null && \ |
1292 if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then | 1336 ! xcode-select --print-path > /dev/null 2> /dev/null ; then |
1293 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | 1337 # Avoid executing cc if there is no toolchain installed as |
1294 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | 1338 # cc will be a stub that puts up a graphical alert |
1295 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | 1339 # prompting the user to install developer tools. |
1296 grep IS_64BIT_ARCH >/dev/null | 1340 CC_FOR_BUILD=no_compiler_found |
1297 then | 1341 else |
1298 case $UNAME_PROCESSOR in | 1342 set_cc_for_build |
1299 i386) UNAME_PROCESSOR=x86_64 ;; | 1343 fi |
1300 powerpc) UNAME_PROCESSOR=powerpc64 ;; | 1344 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then |
1301 esac | 1345 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
1302 fi | 1346 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ |
1303 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc | 1347 grep IS_64BIT_ARCH >/dev/null |
1304 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ | 1348 then |
1305 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | 1349 case $UNAME_PROCESSOR in |
1306 grep IS_PPC >/dev/null | 1350 i386) UNAME_PROCESSOR=x86_64 ;; |
1307 then | 1351 powerpc) UNAME_PROCESSOR=powerpc64 ;; |
1308 UNAME_PROCESSOR=powerpc | 1352 esac |
1309 fi | 1353 fi |
1354 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc | |
1355 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ | |
1356 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1357 grep IS_PPC >/dev/null | |
1358 then | |
1359 UNAME_PROCESSOR=powerpc | |
1310 fi | 1360 fi |
1311 elif test "$UNAME_PROCESSOR" = i386 ; then | 1361 elif test "$UNAME_PROCESSOR" = i386 ; then |
1312 # Avoid executing cc on OS X 10.9, as it ships with a stub | 1362 # uname -m returns i386 or x86_64 |
1313 # that puts up a graphical alert prompting to install | 1363 UNAME_PROCESSOR=$UNAME_MACHINE |
1314 # developer tools. Any system running Mac OS X 10.7 or | |
1315 # later (Darwin 11 and later) is required to have a 64-bit | |
1316 # processor. This is not true of the ARM version of Darwin | |
1317 # that Apple uses in portable devices. | |
1318 UNAME_PROCESSOR=x86_64 | |
1319 fi | 1364 fi |
1320 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" | 1365 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" |
1321 exit ;; | 1366 exit ;; |
1322 *:procnto*:*:* | *:QNX:[0123456789]*:*) | 1367 *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1323 UNAME_PROCESSOR=`uname -p` | 1368 UNAME_PROCESSOR=`uname -p` |
1356 exit ;; | 1401 exit ;; |
1357 *:Plan9:*:*) | 1402 *:Plan9:*:*) |
1358 # "uname -m" is not consistent, so use $cputype instead. 386 | 1403 # "uname -m" is not consistent, so use $cputype instead. 386 |
1359 # is converted to i386 for consistency with other x86 | 1404 # is converted to i386 for consistency with other x86 |
1360 # operating systems. | 1405 # operating systems. |
1406 # shellcheck disable=SC2154 | |
1361 if test "$cputype" = 386; then | 1407 if test "$cputype" = 386; then |
1362 UNAME_MACHINE=i386 | 1408 UNAME_MACHINE=i386 |
1363 else | 1409 else |
1364 UNAME_MACHINE="$cputype" | 1410 UNAME_MACHINE="$cputype" |
1365 fi | 1411 fi |
1412 echo "$UNAME_MACHINE"-unknown-esx | 1458 echo "$UNAME_MACHINE"-unknown-esx |
1413 exit ;; | 1459 exit ;; |
1414 amd64:Isilon\ OneFS:*:*) | 1460 amd64:Isilon\ OneFS:*:*) |
1415 echo x86_64-unknown-onefs | 1461 echo x86_64-unknown-onefs |
1416 exit ;; | 1462 exit ;; |
1463 *:Unleashed:*:*) | |
1464 echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" | |
1465 exit ;; | |
1417 esac | 1466 esac |
1467 | |
1468 # No uname command or uname output not recognized. | |
1469 set_cc_for_build | |
1470 cat > "$dummy.c" <<EOF | |
1471 #ifdef _SEQUENT_ | |
1472 #include <sys/types.h> | |
1473 #include <sys/utsname.h> | |
1474 #endif | |
1475 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) | |
1476 #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) | |
1477 #include <signal.h> | |
1478 #if defined(_SIZE_T_) || defined(SIGLOST) | |
1479 #include <sys/utsname.h> | |
1480 #endif | |
1481 #endif | |
1482 #endif | |
1483 main () | |
1484 { | |
1485 #if defined (sony) | |
1486 #if defined (MIPSEB) | |
1487 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, | |
1488 I don't know.... */ | |
1489 printf ("mips-sony-bsd\n"); exit (0); | |
1490 #else | |
1491 #include <sys/param.h> | |
1492 printf ("m68k-sony-newsos%s\n", | |
1493 #ifdef NEWSOS4 | |
1494 "4" | |
1495 #else | |
1496 "" | |
1497 #endif | |
1498 ); exit (0); | |
1499 #endif | |
1500 #endif | |
1501 | |
1502 #if defined (NeXT) | |
1503 #if !defined (__ARCHITECTURE__) | |
1504 #define __ARCHITECTURE__ "m68k" | |
1505 #endif | |
1506 int version; | |
1507 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | |
1508 if (version < 4) | |
1509 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | |
1510 else | |
1511 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); | |
1512 exit (0); | |
1513 #endif | |
1514 | |
1515 #if defined (MULTIMAX) || defined (n16) | |
1516 #if defined (UMAXV) | |
1517 printf ("ns32k-encore-sysv\n"); exit (0); | |
1518 #else | |
1519 #if defined (CMU) | |
1520 printf ("ns32k-encore-mach\n"); exit (0); | |
1521 #else | |
1522 printf ("ns32k-encore-bsd\n"); exit (0); | |
1523 #endif | |
1524 #endif | |
1525 #endif | |
1526 | |
1527 #if defined (__386BSD__) | |
1528 printf ("i386-pc-bsd\n"); exit (0); | |
1529 #endif | |
1530 | |
1531 #if defined (sequent) | |
1532 #if defined (i386) | |
1533 printf ("i386-sequent-dynix\n"); exit (0); | |
1534 #endif | |
1535 #if defined (ns32000) | |
1536 printf ("ns32k-sequent-dynix\n"); exit (0); | |
1537 #endif | |
1538 #endif | |
1539 | |
1540 #if defined (_SEQUENT_) | |
1541 struct utsname un; | |
1542 | |
1543 uname(&un); | |
1544 if (strncmp(un.version, "V2", 2) == 0) { | |
1545 printf ("i386-sequent-ptx2\n"); exit (0); | |
1546 } | |
1547 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ | |
1548 printf ("i386-sequent-ptx1\n"); exit (0); | |
1549 } | |
1550 printf ("i386-sequent-ptx\n"); exit (0); | |
1551 #endif | |
1552 | |
1553 #if defined (vax) | |
1554 #if !defined (ultrix) | |
1555 #include <sys/param.h> | |
1556 #if defined (BSD) | |
1557 #if BSD == 43 | |
1558 printf ("vax-dec-bsd4.3\n"); exit (0); | |
1559 #else | |
1560 #if BSD == 199006 | |
1561 printf ("vax-dec-bsd4.3reno\n"); exit (0); | |
1562 #else | |
1563 printf ("vax-dec-bsd\n"); exit (0); | |
1564 #endif | |
1565 #endif | |
1566 #else | |
1567 printf ("vax-dec-bsd\n"); exit (0); | |
1568 #endif | |
1569 #else | |
1570 #if defined(_SIZE_T_) || defined(SIGLOST) | |
1571 struct utsname un; | |
1572 uname (&un); | |
1573 printf ("vax-dec-ultrix%s\n", un.release); exit (0); | |
1574 #else | |
1575 printf ("vax-dec-ultrix\n"); exit (0); | |
1576 #endif | |
1577 #endif | |
1578 #endif | |
1579 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) | |
1580 #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) | |
1581 #if defined(_SIZE_T_) || defined(SIGLOST) | |
1582 struct utsname *un; | |
1583 uname (&un); | |
1584 printf ("mips-dec-ultrix%s\n", un.release); exit (0); | |
1585 #else | |
1586 printf ("mips-dec-ultrix\n"); exit (0); | |
1587 #endif | |
1588 #endif | |
1589 #endif | |
1590 | |
1591 #if defined (alliant) && defined (i860) | |
1592 printf ("i860-alliant-bsd\n"); exit (0); | |
1593 #endif | |
1594 | |
1595 exit (1); | |
1596 } | |
1597 EOF | |
1598 | |
1599 $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && | |
1600 { echo "$SYSTEM_NAME"; exit; } | |
1601 | |
1602 # Apollos put the system type in the environment. | |
1603 test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } | |
1418 | 1604 |
1419 echo "$0: unable to guess system type" >&2 | 1605 echo "$0: unable to guess system type" >&2 |
1420 | 1606 |
1421 case "$UNAME_MACHINE:$UNAME_SYSTEM" in | 1607 case "$UNAME_MACHINE:$UNAME_SYSTEM" in |
1422 mips:Linux | mips64:Linux) | 1608 mips:Linux | mips64:Linux) |