1 | #! /bin/sh |
1 | #! /bin/sh |
2 | # Attempt to guess a canonical system name. |
2 | # Attempt to guess a canonical system name. |
3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
|
|
4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, |
|
|
5 | # 2011 Free Software Foundation, Inc. |
3 | # Copyright 1992-2014 Free Software Foundation, Inc. |
6 | |
4 | |
7 | timestamp='2011-11-11' |
5 | timestamp='2014-03-23' |
8 | |
6 | |
9 | # 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 |
10 | # 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 |
11 | # the Free Software Foundation; either version 3 of the License, or |
9 | # the Free Software Foundation; either version 3 of the License, or |
12 | # (at your option) any later version. |
10 | # (at your option) any later version. |
… | |
… | |
15 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | # General Public License for more details. |
15 | # General Public License for more details. |
18 | # |
16 | # |
19 | # You should have received a copy of the GNU General Public License |
17 | # You should have received a copy of the GNU General Public License |
20 | # along with this program; if not, write to the Free Software |
18 | # along with this program; if not, see <http://www.gnu.org/licenses/>. |
21 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
|
|
22 | # 02110-1301, USA. |
|
|
23 | # |
19 | # |
24 | # As a special exception to the GNU General Public License, if you |
20 | # As a special exception to the GNU General Public License, if you |
25 | # distribute this file as part of a program that contains a |
21 | # distribute this file as part of a program that contains a |
26 | # configuration script generated by Autoconf, you may include it under |
22 | # configuration script generated by Autoconf, you may include it under |
27 | # the same distribution terms that you use for the rest of that program. |
23 | # the same distribution terms that you use for the rest of that |
28 | |
24 | # program. This Exception is an additional permission under section 7 |
29 | |
25 | # of the GNU General Public License, version 3 ("GPLv3"). |
30 | # Originally written by Per Bothner. Please send patches (context |
|
|
31 | # diff format) to <config-patches@gnu.org> and include a ChangeLog |
|
|
32 | # entry. |
|
|
33 | # |
26 | # |
34 | # This script attempts to guess a canonical system name similar to |
27 | # Originally written by Per Bothner. |
35 | # config.sub. If it succeeds, it prints the system name on stdout, and |
|
|
36 | # exits with 0. Otherwise, it exits with 1. |
|
|
37 | # |
28 | # |
38 | # You can get the latest version of this script from: |
29 | # You can get the latest version of this script from: |
39 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
30 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
|
|
31 | # |
|
|
32 | # Please send patches with a ChangeLog entry to config-patches@gnu.org. |
|
|
33 | |
40 | |
34 | |
41 | me=`echo "$0" | sed -e 's,.*/,,'` |
35 | me=`echo "$0" | sed -e 's,.*/,,'` |
42 | |
36 | |
43 | usage="\ |
37 | usage="\ |
44 | Usage: $0 [OPTION] |
38 | Usage: $0 [OPTION] |
… | |
… | |
54 | |
48 | |
55 | version="\ |
49 | version="\ |
56 | GNU config.guess ($timestamp) |
50 | GNU config.guess ($timestamp) |
57 | |
51 | |
58 | Originally written by Per Bothner. |
52 | Originally written by Per Bothner. |
59 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
53 | Copyright 1992-2014 Free Software Foundation, Inc. |
60 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free |
|
|
61 | Software Foundation, Inc. |
|
|
62 | |
54 | |
63 | 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 |
64 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
56 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
65 | |
57 | |
66 | help=" |
58 | help=" |
… | |
… | |
138 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
130 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
139 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
131 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
140 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
132 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
141 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
133 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
142 | |
134 | |
|
|
135 | case "${UNAME_SYSTEM}" in |
|
|
136 | Linux|GNU|GNU/*) |
|
|
137 | # If the system lacks a compiler, then just pick glibc. |
|
|
138 | # We could probably try harder. |
|
|
139 | LIBC=gnu |
|
|
140 | |
|
|
141 | eval $set_cc_for_build |
|
|
142 | cat <<-EOF > $dummy.c |
|
|
143 | #include <features.h> |
|
|
144 | #if defined(__UCLIBC__) |
|
|
145 | LIBC=uclibc |
|
|
146 | #elif defined(__dietlibc__) |
|
|
147 | LIBC=dietlibc |
|
|
148 | #else |
|
|
149 | LIBC=gnu |
|
|
150 | #endif |
|
|
151 | EOF |
|
|
152 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` |
|
|
153 | ;; |
|
|
154 | esac |
|
|
155 | |
143 | # Note: order is significant - the case branches are not exclusive. |
156 | # Note: order is significant - the case branches are not exclusive. |
144 | |
157 | |
145 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
158 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
146 | *:NetBSD:*:*) |
159 | *:NetBSD:*:*) |
147 | # NetBSD (nbsd) targets should (where applicable) match one or |
160 | # NetBSD (nbsd) targets should (where applicable) match one or |
148 | # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, |
161 | # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, |
149 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
162 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
150 | # switched to ELF, *-*-netbsd* would select the old |
163 | # switched to ELF, *-*-netbsd* would select the old |
151 | # object file format. This provides both forward |
164 | # object file format. This provides both forward |
152 | # compatibility and a consistent mechanism for selecting the |
165 | # compatibility and a consistent mechanism for selecting the |
153 | # object file format. |
166 | # object file format. |
… | |
… | |
199 | esac |
212 | esac |
200 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
213 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
201 | # contains redundant information, the shorter form: |
214 | # contains redundant information, the shorter form: |
202 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
215 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
203 | echo "${machine}-${os}${release}" |
216 | echo "${machine}-${os}${release}" |
|
|
217 | exit ;; |
|
|
218 | *:Bitrig:*:*) |
|
|
219 | UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` |
|
|
220 | echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} |
204 | exit ;; |
221 | exit ;; |
205 | *:OpenBSD:*:*) |
222 | *:OpenBSD:*:*) |
206 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
223 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
207 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
224 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
208 | exit ;; |
225 | exit ;; |
… | |
… | |
302 | echo powerpc-ibm-os400 |
319 | echo powerpc-ibm-os400 |
303 | exit ;; |
320 | exit ;; |
304 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
321 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
305 | echo arm-acorn-riscix${UNAME_RELEASE} |
322 | echo arm-acorn-riscix${UNAME_RELEASE} |
306 | exit ;; |
323 | exit ;; |
307 | arm:riscos:*:*|arm:RISCOS:*:*) |
324 | arm*:riscos:*:*|arm*:RISCOS:*:*) |
308 | echo arm-unknown-riscos |
325 | echo arm-unknown-riscos |
309 | exit ;; |
326 | exit ;; |
310 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
327 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
311 | echo hppa1.1-hitachi-hiuxmpp |
328 | echo hppa1.1-hitachi-hiuxmpp |
312 | exit ;; |
329 | exit ;; |
… | |
… | |
801 | esac |
818 | esac |
802 | exit ;; |
819 | exit ;; |
803 | i*:CYGWIN*:*) |
820 | i*:CYGWIN*:*) |
804 | echo ${UNAME_MACHINE}-pc-cygwin |
821 | echo ${UNAME_MACHINE}-pc-cygwin |
805 | exit ;; |
822 | exit ;; |
|
|
823 | *:MINGW64*:*) |
|
|
824 | echo ${UNAME_MACHINE}-pc-mingw64 |
|
|
825 | exit ;; |
806 | *:MINGW*:*) |
826 | *:MINGW*:*) |
807 | echo ${UNAME_MACHINE}-pc-mingw32 |
827 | echo ${UNAME_MACHINE}-pc-mingw32 |
808 | exit ;; |
828 | exit ;; |
809 | i*:MSYS*:*) |
829 | *:MSYS*:*) |
810 | echo ${UNAME_MACHINE}-pc-msys |
830 | echo ${UNAME_MACHINE}-pc-msys |
811 | exit ;; |
831 | exit ;; |
812 | i*:windows32*:*) |
832 | i*:windows32*:*) |
813 | # uname -m includes "-pc" on this system. |
833 | # uname -m includes "-pc" on this system. |
814 | echo ${UNAME_MACHINE}-mingw32 |
834 | echo ${UNAME_MACHINE}-mingw32 |
… | |
… | |
852 | prep*:SunOS:5.*:*) |
872 | prep*:SunOS:5.*:*) |
853 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
873 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
854 | exit ;; |
874 | exit ;; |
855 | *:GNU:*:*) |
875 | *:GNU:*:*) |
856 | # the GNU system |
876 | # the GNU system |
857 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` |
877 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` |
858 | exit ;; |
878 | exit ;; |
859 | *:GNU/*:*:*) |
879 | *:GNU/*:*:*) |
860 | # other systems with GNU libc and userland |
880 | # other systems with GNU libc and userland |
861 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu |
881 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} |
862 | exit ;; |
882 | exit ;; |
863 | i*86:Minix:*:*) |
883 | i*86:Minix:*:*) |
864 | echo ${UNAME_MACHINE}-pc-minix |
884 | echo ${UNAME_MACHINE}-pc-minix |
|
|
885 | exit ;; |
|
|
886 | aarch64:Linux:*:*) |
|
|
887 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
|
|
888 | exit ;; |
|
|
889 | aarch64_be:Linux:*:*) |
|
|
890 | UNAME_MACHINE=aarch64_be |
|
|
891 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
865 | exit ;; |
892 | exit ;; |
866 | alpha:Linux:*:*) |
893 | alpha:Linux:*:*) |
867 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
894 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
868 | EV5) UNAME_MACHINE=alphaev5 ;; |
895 | EV5) UNAME_MACHINE=alphaev5 ;; |
869 | EV56) UNAME_MACHINE=alphaev56 ;; |
896 | EV56) UNAME_MACHINE=alphaev56 ;; |
… | |
… | |
872 | EV6) UNAME_MACHINE=alphaev6 ;; |
899 | EV6) UNAME_MACHINE=alphaev6 ;; |
873 | EV67) UNAME_MACHINE=alphaev67 ;; |
900 | EV67) UNAME_MACHINE=alphaev67 ;; |
874 | EV68*) UNAME_MACHINE=alphaev68 ;; |
901 | EV68*) UNAME_MACHINE=alphaev68 ;; |
875 | esac |
902 | esac |
876 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
903 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
877 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
904 | if test "$?" = 0 ; then LIBC="gnulibc1" ; fi |
878 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
905 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
|
|
906 | exit ;; |
|
|
907 | arc:Linux:*:* | arceb:Linux:*:*) |
|
|
908 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
879 | exit ;; |
909 | exit ;; |
880 | arm*:Linux:*:*) |
910 | arm*:Linux:*:*) |
881 | eval $set_cc_for_build |
911 | eval $set_cc_for_build |
882 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
912 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
883 | | grep -q __ARM_EABI__ |
913 | | grep -q __ARM_EABI__ |
884 | then |
914 | then |
885 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
915 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
886 | else |
916 | else |
887 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ |
917 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ |
888 | | grep -q __ARM_PCS_VFP |
918 | | grep -q __ARM_PCS_VFP |
889 | then |
919 | then |
890 | echo ${UNAME_MACHINE}-unknown-linux-gnueabi |
920 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi |
891 | else |
921 | else |
892 | echo ${UNAME_MACHINE}-unknown-linux-gnueabihf |
922 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf |
893 | fi |
923 | fi |
894 | fi |
924 | fi |
895 | exit ;; |
925 | exit ;; |
896 | avr32*:Linux:*:*) |
926 | avr32*:Linux:*:*) |
897 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
927 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
898 | exit ;; |
928 | exit ;; |
899 | cris:Linux:*:*) |
929 | cris:Linux:*:*) |
900 | echo cris-axis-linux-gnu |
930 | echo ${UNAME_MACHINE}-axis-linux-${LIBC} |
901 | exit ;; |
931 | exit ;; |
902 | crisv32:Linux:*:*) |
932 | crisv32:Linux:*:*) |
903 | echo crisv32-axis-linux-gnu |
933 | echo ${UNAME_MACHINE}-axis-linux-${LIBC} |
904 | exit ;; |
934 | exit ;; |
905 | frv:Linux:*:*) |
935 | frv:Linux:*:*) |
906 | echo frv-unknown-linux-gnu |
936 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
907 | exit ;; |
937 | exit ;; |
908 | hexagon:Linux:*:*) |
938 | hexagon:Linux:*:*) |
909 | echo hexagon-unknown-linux-gnu |
939 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
910 | exit ;; |
940 | exit ;; |
911 | i*86:Linux:*:*) |
941 | i*86:Linux:*:*) |
912 | LIBC=gnu |
|
|
913 | eval $set_cc_for_build |
|
|
914 | sed 's/^ //' << EOF >$dummy.c |
|
|
915 | #ifdef __dietlibc__ |
|
|
916 | LIBC=dietlibc |
|
|
917 | #endif |
|
|
918 | EOF |
|
|
919 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` |
|
|
920 | echo "${UNAME_MACHINE}-pc-linux-${LIBC}" |
942 | echo ${UNAME_MACHINE}-pc-linux-${LIBC} |
921 | exit ;; |
943 | exit ;; |
922 | ia64:Linux:*:*) |
944 | ia64:Linux:*:*) |
923 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
945 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
924 | exit ;; |
946 | exit ;; |
925 | m32r*:Linux:*:*) |
947 | m32r*:Linux:*:*) |
926 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
948 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
927 | exit ;; |
949 | exit ;; |
928 | m68*:Linux:*:*) |
950 | m68*:Linux:*:*) |
929 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
951 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
930 | exit ;; |
952 | exit ;; |
931 | mips:Linux:*:* | mips64:Linux:*:*) |
953 | mips:Linux:*:* | mips64:Linux:*:*) |
932 | eval $set_cc_for_build |
954 | eval $set_cc_for_build |
933 | sed 's/^ //' << EOF >$dummy.c |
955 | sed 's/^ //' << EOF >$dummy.c |
934 | #undef CPU |
956 | #undef CPU |
… | |
… | |
943 | CPU= |
965 | CPU= |
944 | #endif |
966 | #endif |
945 | #endif |
967 | #endif |
946 | EOF |
968 | EOF |
947 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
969 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
948 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } |
970 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
949 | ;; |
971 | ;; |
950 | or32:Linux:*:*) |
972 | openrisc*:Linux:*:*) |
951 | echo or32-unknown-linux-gnu |
973 | echo or1k-unknown-linux-${LIBC} |
|
|
974 | exit ;; |
|
|
975 | or32:Linux:*:* | or1k*:Linux:*:*) |
|
|
976 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
952 | exit ;; |
977 | exit ;; |
953 | padre:Linux:*:*) |
978 | padre:Linux:*:*) |
954 | echo sparc-unknown-linux-gnu |
979 | echo sparc-unknown-linux-${LIBC} |
955 | exit ;; |
980 | exit ;; |
956 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
981 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
957 | echo hppa64-unknown-linux-gnu |
982 | echo hppa64-unknown-linux-${LIBC} |
958 | exit ;; |
983 | exit ;; |
959 | parisc:Linux:*:* | hppa:Linux:*:*) |
984 | parisc:Linux:*:* | hppa:Linux:*:*) |
960 | # Look for CPU level |
985 | # Look for CPU level |
961 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
986 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
962 | PA7*) echo hppa1.1-unknown-linux-gnu ;; |
987 | PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; |
963 | PA8*) echo hppa2.0-unknown-linux-gnu ;; |
988 | PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; |
964 | *) echo hppa-unknown-linux-gnu ;; |
989 | *) echo hppa-unknown-linux-${LIBC} ;; |
965 | esac |
990 | esac |
966 | exit ;; |
991 | exit ;; |
967 | ppc64:Linux:*:*) |
992 | ppc64:Linux:*:*) |
968 | echo powerpc64-unknown-linux-gnu |
993 | echo powerpc64-unknown-linux-${LIBC} |
969 | exit ;; |
994 | exit ;; |
970 | ppc:Linux:*:*) |
995 | ppc:Linux:*:*) |
971 | echo powerpc-unknown-linux-gnu |
996 | echo powerpc-unknown-linux-${LIBC} |
|
|
997 | exit ;; |
|
|
998 | ppc64le:Linux:*:*) |
|
|
999 | echo powerpc64le-unknown-linux-${LIBC} |
|
|
1000 | exit ;; |
|
|
1001 | ppcle:Linux:*:*) |
|
|
1002 | echo powerpcle-unknown-linux-${LIBC} |
972 | exit ;; |
1003 | exit ;; |
973 | s390:Linux:*:* | s390x:Linux:*:*) |
1004 | s390:Linux:*:* | s390x:Linux:*:*) |
974 | echo ${UNAME_MACHINE}-ibm-linux |
1005 | echo ${UNAME_MACHINE}-ibm-linux-${LIBC} |
975 | exit ;; |
1006 | exit ;; |
976 | sh64*:Linux:*:*) |
1007 | sh64*:Linux:*:*) |
977 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
1008 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
978 | exit ;; |
1009 | exit ;; |
979 | sh*:Linux:*:*) |
1010 | sh*:Linux:*:*) |
980 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
1011 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
981 | exit ;; |
1012 | exit ;; |
982 | sparc:Linux:*:* | sparc64:Linux:*:*) |
1013 | sparc:Linux:*:* | sparc64:Linux:*:*) |
983 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
1014 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
984 | exit ;; |
1015 | exit ;; |
985 | tile*:Linux:*:*) |
1016 | tile*:Linux:*:*) |
986 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
1017 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
987 | exit ;; |
1018 | exit ;; |
988 | vax:Linux:*:*) |
1019 | vax:Linux:*:*) |
989 | echo ${UNAME_MACHINE}-dec-linux-gnu |
1020 | echo ${UNAME_MACHINE}-dec-linux-${LIBC} |
990 | exit ;; |
1021 | exit ;; |
991 | x86_64:Linux:*:*) |
1022 | x86_64:Linux:*:*) |
992 | echo x86_64-unknown-linux-gnu |
1023 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
993 | exit ;; |
1024 | exit ;; |
994 | xtensa*:Linux:*:*) |
1025 | xtensa*:Linux:*:*) |
995 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
1026 | echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
996 | exit ;; |
1027 | exit ;; |
997 | i*86:DYNIX/ptx:4*:*) |
1028 | i*86:DYNIX/ptx:4*:*) |
998 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
1029 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
999 | # earlier versions are messed up and put the nodename in both |
1030 | # earlier versions are messed up and put the nodename in both |
1000 | # sysname and nodename. |
1031 | # sysname and nodename. |
… | |
… | |
1194 | echo i586-pc-beos |
1225 | echo i586-pc-beos |
1195 | exit ;; |
1226 | exit ;; |
1196 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. |
1227 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. |
1197 | echo i586-pc-haiku |
1228 | echo i586-pc-haiku |
1198 | exit ;; |
1229 | exit ;; |
|
|
1230 | x86_64:Haiku:*:*) |
|
|
1231 | echo x86_64-unknown-haiku |
|
|
1232 | exit ;; |
1199 | SX-4:SUPER-UX:*:*) |
1233 | SX-4:SUPER-UX:*:*) |
1200 | echo sx4-nec-superux${UNAME_RELEASE} |
1234 | echo sx4-nec-superux${UNAME_RELEASE} |
1201 | exit ;; |
1235 | exit ;; |
1202 | SX-5:SUPER-UX:*:*) |
1236 | SX-5:SUPER-UX:*:*) |
1203 | echo sx5-nec-superux${UNAME_RELEASE} |
1237 | echo sx5-nec-superux${UNAME_RELEASE} |
… | |
… | |
1220 | *:Rhapsody:*:*) |
1254 | *:Rhapsody:*:*) |
1221 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
1255 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
1222 | exit ;; |
1256 | exit ;; |
1223 | *:Darwin:*:*) |
1257 | *:Darwin:*:*) |
1224 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
1258 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
1225 | case $UNAME_PROCESSOR in |
|
|
1226 | i386) |
|
|
1227 | eval $set_cc_for_build |
1259 | eval $set_cc_for_build |
|
|
1260 | if test "$UNAME_PROCESSOR" = unknown ; then |
|
|
1261 | UNAME_PROCESSOR=powerpc |
|
|
1262 | fi |
|
|
1263 | if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then |
1228 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then |
1264 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then |
1229 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
1265 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ |
1230 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ |
1266 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ |
1231 | grep IS_64BIT_ARCH >/dev/null |
1267 | grep IS_64BIT_ARCH >/dev/null |
1232 | then |
1268 | then |
|
|
1269 | case $UNAME_PROCESSOR in |
|
|
1270 | i386) UNAME_PROCESSOR=x86_64 ;; |
|
|
1271 | powerpc) UNAME_PROCESSOR=powerpc64 ;; |
|
|
1272 | esac |
|
|
1273 | fi |
|
|
1274 | fi |
|
|
1275 | elif test "$UNAME_PROCESSOR" = i386 ; then |
|
|
1276 | # Avoid executing cc on OS X 10.9, as it ships with a stub |
|
|
1277 | # that puts up a graphical alert prompting to install |
|
|
1278 | # developer tools. Any system running Mac OS X 10.7 or |
|
|
1279 | # later (Darwin 11 and later) is required to have a 64-bit |
|
|
1280 | # processor. This is not true of the ARM version of Darwin |
|
|
1281 | # that Apple uses in portable devices. |
1233 | UNAME_PROCESSOR="x86_64" |
1282 | UNAME_PROCESSOR=x86_64 |
1234 | fi |
1283 | fi |
1235 | fi ;; |
|
|
1236 | unknown) UNAME_PROCESSOR=powerpc ;; |
|
|
1237 | esac |
|
|
1238 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
1284 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
1239 | exit ;; |
1285 | exit ;; |
1240 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1286 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
1241 | UNAME_PROCESSOR=`uname -p` |
1287 | UNAME_PROCESSOR=`uname -p` |
1242 | if test "$UNAME_PROCESSOR" = "x86"; then |
1288 | if test "$UNAME_PROCESSOR" = "x86"; then |
… | |
… | |
1249 | echo i386-pc-qnx |
1295 | echo i386-pc-qnx |
1250 | exit ;; |
1296 | exit ;; |
1251 | NEO-?:NONSTOP_KERNEL:*:*) |
1297 | NEO-?:NONSTOP_KERNEL:*:*) |
1252 | echo neo-tandem-nsk${UNAME_RELEASE} |
1298 | echo neo-tandem-nsk${UNAME_RELEASE} |
1253 | exit ;; |
1299 | exit ;; |
1254 | NSE-?:NONSTOP_KERNEL:*:*) |
1300 | NSE-*:NONSTOP_KERNEL:*:*) |
1255 | echo nse-tandem-nsk${UNAME_RELEASE} |
1301 | echo nse-tandem-nsk${UNAME_RELEASE} |
1256 | exit ;; |
1302 | exit ;; |
1257 | NSR-?:NONSTOP_KERNEL:*:*) |
1303 | NSR-?:NONSTOP_KERNEL:*:*) |
1258 | echo nsr-tandem-nsk${UNAME_RELEASE} |
1304 | echo nsr-tandem-nsk${UNAME_RELEASE} |
1259 | exit ;; |
1305 | exit ;; |
… | |
… | |
1318 | echo ${UNAME_MACHINE}-pc-rdos |
1364 | echo ${UNAME_MACHINE}-pc-rdos |
1319 | exit ;; |
1365 | exit ;; |
1320 | i*86:AROS:*:*) |
1366 | i*86:AROS:*:*) |
1321 | echo ${UNAME_MACHINE}-pc-aros |
1367 | echo ${UNAME_MACHINE}-pc-aros |
1322 | exit ;; |
1368 | exit ;; |
|
|
1369 | x86_64:VMkernel:*:*) |
|
|
1370 | echo ${UNAME_MACHINE}-unknown-esx |
|
|
1371 | exit ;; |
1323 | esac |
1372 | esac |
1324 | |
|
|
1325 | #echo '(No uname command or uname output not recognized.)' 1>&2 |
|
|
1326 | #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 |
|
|
1327 | |
|
|
1328 | eval $set_cc_for_build |
|
|
1329 | cat >$dummy.c <<EOF |
|
|
1330 | #ifdef _SEQUENT_ |
|
|
1331 | # include <sys/types.h> |
|
|
1332 | # include <sys/utsname.h> |
|
|
1333 | #endif |
|
|
1334 | main () |
|
|
1335 | { |
|
|
1336 | #if defined (sony) |
|
|
1337 | #if defined (MIPSEB) |
|
|
1338 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, |
|
|
1339 | I don't know.... */ |
|
|
1340 | printf ("mips-sony-bsd\n"); exit (0); |
|
|
1341 | #else |
|
|
1342 | #include <sys/param.h> |
|
|
1343 | printf ("m68k-sony-newsos%s\n", |
|
|
1344 | #ifdef NEWSOS4 |
|
|
1345 | "4" |
|
|
1346 | #else |
|
|
1347 | "" |
|
|
1348 | #endif |
|
|
1349 | ); exit (0); |
|
|
1350 | #endif |
|
|
1351 | #endif |
|
|
1352 | |
|
|
1353 | #if defined (__arm) && defined (__acorn) && defined (__unix) |
|
|
1354 | printf ("arm-acorn-riscix\n"); exit (0); |
|
|
1355 | #endif |
|
|
1356 | |
|
|
1357 | #if defined (hp300) && !defined (hpux) |
|
|
1358 | printf ("m68k-hp-bsd\n"); exit (0); |
|
|
1359 | #endif |
|
|
1360 | |
|
|
1361 | #if defined (NeXT) |
|
|
1362 | #if !defined (__ARCHITECTURE__) |
|
|
1363 | #define __ARCHITECTURE__ "m68k" |
|
|
1364 | #endif |
|
|
1365 | int version; |
|
|
1366 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; |
|
|
1367 | if (version < 4) |
|
|
1368 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); |
|
|
1369 | else |
|
|
1370 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); |
|
|
1371 | exit (0); |
|
|
1372 | #endif |
|
|
1373 | |
|
|
1374 | #if defined (MULTIMAX) || defined (n16) |
|
|
1375 | #if defined (UMAXV) |
|
|
1376 | printf ("ns32k-encore-sysv\n"); exit (0); |
|
|
1377 | #else |
|
|
1378 | #if defined (CMU) |
|
|
1379 | printf ("ns32k-encore-mach\n"); exit (0); |
|
|
1380 | #else |
|
|
1381 | printf ("ns32k-encore-bsd\n"); exit (0); |
|
|
1382 | #endif |
|
|
1383 | #endif |
|
|
1384 | #endif |
|
|
1385 | |
|
|
1386 | #if defined (__386BSD__) |
|
|
1387 | printf ("i386-pc-bsd\n"); exit (0); |
|
|
1388 | #endif |
|
|
1389 | |
|
|
1390 | #if defined (sequent) |
|
|
1391 | #if defined (i386) |
|
|
1392 | printf ("i386-sequent-dynix\n"); exit (0); |
|
|
1393 | #endif |
|
|
1394 | #if defined (ns32000) |
|
|
1395 | printf ("ns32k-sequent-dynix\n"); exit (0); |
|
|
1396 | #endif |
|
|
1397 | #endif |
|
|
1398 | |
|
|
1399 | #if defined (_SEQUENT_) |
|
|
1400 | struct utsname un; |
|
|
1401 | |
|
|
1402 | uname(&un); |
|
|
1403 | |
|
|
1404 | if (strncmp(un.version, "V2", 2) == 0) { |
|
|
1405 | printf ("i386-sequent-ptx2\n"); exit (0); |
|
|
1406 | } |
|
|
1407 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ |
|
|
1408 | printf ("i386-sequent-ptx1\n"); exit (0); |
|
|
1409 | } |
|
|
1410 | printf ("i386-sequent-ptx\n"); exit (0); |
|
|
1411 | |
|
|
1412 | #endif |
|
|
1413 | |
|
|
1414 | #if defined (vax) |
|
|
1415 | # if !defined (ultrix) |
|
|
1416 | # include <sys/param.h> |
|
|
1417 | # if defined (BSD) |
|
|
1418 | # if BSD == 43 |
|
|
1419 | printf ("vax-dec-bsd4.3\n"); exit (0); |
|
|
1420 | # else |
|
|
1421 | # if BSD == 199006 |
|
|
1422 | printf ("vax-dec-bsd4.3reno\n"); exit (0); |
|
|
1423 | # else |
|
|
1424 | printf ("vax-dec-bsd\n"); exit (0); |
|
|
1425 | # endif |
|
|
1426 | # endif |
|
|
1427 | # else |
|
|
1428 | printf ("vax-dec-bsd\n"); exit (0); |
|
|
1429 | # endif |
|
|
1430 | # else |
|
|
1431 | printf ("vax-dec-ultrix\n"); exit (0); |
|
|
1432 | # endif |
|
|
1433 | #endif |
|
|
1434 | |
|
|
1435 | #if defined (alliant) && defined (i860) |
|
|
1436 | printf ("i860-alliant-bsd\n"); exit (0); |
|
|
1437 | #endif |
|
|
1438 | |
|
|
1439 | exit (1); |
|
|
1440 | } |
|
|
1441 | EOF |
|
|
1442 | |
|
|
1443 | $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && |
|
|
1444 | { echo "$SYSTEM_NAME"; exit; } |
|
|
1445 | |
|
|
1446 | # Apollos put the system type in the environment. |
|
|
1447 | |
|
|
1448 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } |
|
|
1449 | |
|
|
1450 | # Convex versions that predate uname can use getsysinfo(1) |
|
|
1451 | |
|
|
1452 | if [ -x /usr/convex/getsysinfo ] |
|
|
1453 | then |
|
|
1454 | case `getsysinfo -f cpu_type` in |
|
|
1455 | c1*) |
|
|
1456 | echo c1-convex-bsd |
|
|
1457 | exit ;; |
|
|
1458 | c2*) |
|
|
1459 | if getsysinfo -f scalar_acc |
|
|
1460 | then echo c32-convex-bsd |
|
|
1461 | else echo c2-convex-bsd |
|
|
1462 | fi |
|
|
1463 | exit ;; |
|
|
1464 | c34*) |
|
|
1465 | echo c34-convex-bsd |
|
|
1466 | exit ;; |
|
|
1467 | c38*) |
|
|
1468 | echo c38-convex-bsd |
|
|
1469 | exit ;; |
|
|
1470 | c4*) |
|
|
1471 | echo c4-convex-bsd |
|
|
1472 | exit ;; |
|
|
1473 | esac |
|
|
1474 | fi |
|
|
1475 | |
1373 | |
1476 | cat >&2 <<EOF |
1374 | cat >&2 <<EOF |
1477 | $0: unable to guess system type |
1375 | $0: unable to guess system type |
1478 | |
1376 | |
1479 | This script, last modified $timestamp, has failed to recognize |
1377 | This script, last modified $timestamp, has failed to recognize |