2
2
# Attempt to guess a canonical system name.
3
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5
# 2011, 2012 Free Software Foundation, Inc.
9
9
# This file is free software; you can redistribute it and/or modify it
10
10
# under the terms of the GNU General Public License as published by
27
25
# the same distribution terms that you use for the rest of that program.
30
# Originally written by Per Bothner <per@bothner.com>.
31
# Please send patches to <config-patches@gnu.org>. Submit a context
32
# diff and a properly formatted ChangeLog entry.
28
# Originally written by Per Bothner. Please send patches (context
29
# diff format) to <config-patches@gnu.org> and include a ChangeLog
34
32
# This script attempts to guess a canonical system name similar to
35
33
# config.sub. If it succeeds, it prints the system name on stdout, and
36
34
# exits with 0. Otherwise, it exits with 1.
38
# The plan is that this can be called by configure scripts if you
39
# don't specify an explicit build system type.
36
# You can get the latest version of this script from:
37
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
41
39
me=`echo "$0" | sed -e 's,.*/,,'`
56
54
GNU config.guess ($timestamp)
58
56
Originally written by Per Bothner.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
57
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
58
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
60
59
Free Software Foundation, Inc.
62
61
This is free software; see the source for copying conditions. There is NO
139
138
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140
139
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142
case "${UNAME_MACHINE}" in
144
test -z "$VENDOR" && VENDOR=pc
147
test -z "$VENDOR" && VENDOR=unknown
150
test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
152
141
# Note: order is significant - the case branches are not exclusive.
154
143
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
156
145
# NetBSD (nbsd) targets should (where applicable) match one or
157
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
146
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
158
147
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
159
148
# switched to ELF, *-*-netbsd* would select the old
160
149
# object file format. This provides both forward
333
326
case `/usr/bin/uname -p` in
334
327
sparc) echo sparc-icl-nx7; exit ;;
330
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336
332
sun4H:SunOS:5.*:*)
337
333
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
339
335
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
340
336
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
343
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
338
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
339
echo i386-pc-auroraux${UNAME_RELEASE}
341
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
342
eval $set_cc_for_build
344
# If there is a compiler, see if it is configured for 64-bit objects.
345
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
346
# This test works for both compilers.
347
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
348
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
349
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
350
grep IS_64BIT_ARCH >/dev/null
355
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
345
357
sun4*:SunOS:6*:*)
346
358
# According to config.sub, this is the proper way to canonicalize
384
396
# MiNT. But MiNT is downward compatible to TOS, so this should
386
398
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
387
echo m68k-atari-mint${UNAME_RELEASE}
399
echo m68k-atari-mint${UNAME_RELEASE}
389
401
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
390
402
echo m68k-atari-mint${UNAME_RELEASE}
392
404
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
393
echo m68k-atari-mint${UNAME_RELEASE}
405
echo m68k-atari-mint${UNAME_RELEASE}
395
407
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
396
echo m68k-milan-mint${UNAME_RELEASE}
408
echo m68k-milan-mint${UNAME_RELEASE}
398
410
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
399
echo m68k-hades-mint${UNAME_RELEASE}
411
echo m68k-hades-mint${UNAME_RELEASE}
401
413
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
402
echo m68k-unknown-mint${UNAME_RELEASE}
414
echo m68k-unknown-mint${UNAME_RELEASE}
404
416
m68k:machten:*:*)
405
417
echo m68k-apple-machten${UNAME_RELEASE}
584
596
9000/[678][0-9][0-9])
585
597
if [ -x /usr/bin/getconf ]; then
586
598
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
587
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
588
case "${sc_cpu_version}" in
589
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
590
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
591
532) # CPU_PA_RISC2_0
592
case "${sc_kernel_bits}" in
593
32) HP_ARCH="hppa2.0n" ;;
594
64) HP_ARCH="hppa2.0w" ;;
599
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
600
case "${sc_cpu_version}" in
601
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
602
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
603
532) # CPU_PA_RISC2_0
604
case "${sc_kernel_bits}" in
605
32) HP_ARCH="hppa2.0n" ;;
606
64) HP_ARCH="hppa2.0w" ;;
595
607
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
599
611
if [ "${HP_ARCH}" = "" ]; then
600
612
eval $set_cc_for_build
601
sed 's/^ //' << EOF >$dummy.c
609
#if defined(_SC_KERNEL_BITS)
610
long bits = sysconf(_SC_KERNEL_BITS);
612
long cpu = sysconf (_SC_CPU_VERSION);
616
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
617
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
619
#if defined(_SC_KERNEL_BITS)
622
case 64: puts ("hppa2.0w"); break;
623
case 32: puts ("hppa2.0n"); break;
624
default: puts ("hppa2.0"); break;
626
#else /* !defined(_SC_KERNEL_BITS) */
627
puts ("hppa2.0"); break;
629
default: puts ("hppa1.0"); break;
613
sed 's/^ //' << EOF >$dummy.c
621
#if defined(_SC_KERNEL_BITS)
622
long bits = sysconf(_SC_KERNEL_BITS);
624
long cpu = sysconf (_SC_CPU_VERSION);
628
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
629
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
631
#if defined(_SC_KERNEL_BITS)
634
case 64: puts ("hppa2.0w"); break;
635
case 32: puts ("hppa2.0n"); break;
636
default: puts ("hppa2.0"); break;
638
#else /* !defined(_SC_KERNEL_BITS) */
639
puts ("hppa2.0"); break;
641
default: puts ("hppa1.0"); break;
634
646
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
635
647
test -z "$HP_ARCH" && HP_ARCH=hppa
760
772
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
761
773
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
762
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
763
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
764
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
774
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
775
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
776
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
766
778
5000:UNIX_System_V:4.*:*)
767
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
768
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
769
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
779
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
780
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
781
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
771
783
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
772
784
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
778
790
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
781
case ${UNAME_MACHINE} in
783
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
793
UNAME_PROCESSOR=`/usr/bin/uname -p`
794
case ${UNAME_PROCESSOR} in
785
796
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
787
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
798
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
791
802
echo ${UNAME_MACHINE}-pc-cygwin
794
805
echo ${UNAME_MACHINE}-pc-mingw32
808
echo ${UNAME_MACHINE}-pc-msys
797
# uname -m includes "-pc" on this system.
798
echo ${UNAME_MACHINE}-mingw32
811
# uname -m includes "-pc" on this system.
812
echo ${UNAME_MACHINE}-mingw32
801
815
echo ${UNAME_MACHINE}-pc-pw32
804
echo i586-pc-interix${UNAME_RELEASE}
806
EM64T:Interix*:[345]*)
807
echo x86_64-unknown-interix${UNAME_RELEASE}
818
case ${UNAME_MACHINE} in
820
echo i586-pc-interix${UNAME_RELEASE}
822
authenticamd | genuineintel | EM64T)
823
echo x86_64-unknown-interix${UNAME_RELEASE}
826
echo ia64-unknown-interix${UNAME_RELEASE}
809
829
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
810
830
echo i${UNAME_MACHINE}-pc-mks
812
835
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
813
836
# How do we know it's Interix rather than the generic POSIX subsystem?
814
837
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
839
862
echo ${UNAME_MACHINE}-pc-minix
842
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
845
echo cris-axis-linux-gnu
848
echo crisv32-axis-linux-gnu
851
echo frv-${VENDOR}-linux-gnu
854
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
857
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
860
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
863
eval $set_cc_for_build
864
sed 's/^ //' << EOF >$dummy.c
868
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
871
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
878
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
883
test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
886
eval $set_cc_for_build
887
sed 's/^ //' << EOF >$dummy.c
891
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
894
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
901
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
906
test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
909
echo or32-${VENDOR}-linux-gnu
912
echo powerpc-${VENDOR}-linux-gnu
915
echo powerpc64-${VENDOR}-linux-gnu
865
echo ${UNAME_MACHINE}-unknown-linux-gnu
867
aarch64_be:Linux:*:*)
868
UNAME_MACHINE=aarch64_be
869
echo ${UNAME_MACHINE}-unknown-linux-gnu
918
872
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
923
877
EV6) UNAME_MACHINE=alphaev6 ;;
924
878
EV67) UNAME_MACHINE=alphaev67 ;;
925
879
EV68*) UNAME_MACHINE=alphaev68 ;;
927
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
881
objdump --private-headers /bin/sh | grep -q ld.so.1
928
882
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
929
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
883
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
886
eval $set_cc_for_build
887
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
888
| grep -q __ARM_EABI__
890
echo ${UNAME_MACHINE}-unknown-linux-gnu
892
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
893
| grep -q __ARM_PCS_VFP
895
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
897
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
902
echo ${UNAME_MACHINE}-unknown-linux-gnu
905
echo ${UNAME_MACHINE}-axis-linux-gnu
908
echo ${UNAME_MACHINE}-axis-linux-gnu
911
echo ${UNAME_MACHINE}-unknown-linux-gnu
914
echo ${UNAME_MACHINE}-unknown-linux-gnu
918
eval $set_cc_for_build
919
sed 's/^ //' << EOF >$dummy.c
924
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
925
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
928
echo ${UNAME_MACHINE}-unknown-linux-gnu
931
echo ${UNAME_MACHINE}-unknown-linux-gnu
934
echo ${UNAME_MACHINE}-unknown-linux-gnu
936
mips:Linux:*:* | mips64:Linux:*:*)
937
eval $set_cc_for_build
938
sed 's/^ //' << EOF >$dummy.c
940
#undef ${UNAME_MACHINE}
941
#undef ${UNAME_MACHINE}el
942
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
943
CPU=${UNAME_MACHINE}el
945
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
952
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
953
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
956
echo ${UNAME_MACHINE}-unknown-linux-gnu
959
echo sparc-unknown-linux-gnu
961
parisc64:Linux:*:* | hppa64:Linux:*:*)
962
echo hppa64-unknown-linux-gnu
931
964
parisc:Linux:*:* | hppa:Linux:*:*)
932
965
# Look for CPU level
933
966
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
934
PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
935
PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
936
*) echo hppa-${VENDOR}-linux-gnu ;;
967
PA7*) echo hppa1.1-unknown-linux-gnu ;;
968
PA8*) echo hppa2.0-unknown-linux-gnu ;;
969
*) echo hppa-unknown-linux-gnu ;;
939
parisc64:Linux:*:* | hppa64:Linux:*:*)
940
echo hppa64-${VENDOR}-linux-gnu
973
echo powerpc64-unknown-linux-gnu
976
echo powerpc-unknown-linux-gnu
942
978
s390:Linux:*:* | s390x:Linux:*:*)
943
979
echo ${UNAME_MACHINE}-ibm-linux
946
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
982
echo ${UNAME_MACHINE}-unknown-linux-gnu
949
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
985
echo ${UNAME_MACHINE}-unknown-linux-gnu
951
987
sparc:Linux:*:* | sparc64:Linux:*:*)
952
echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
988
echo ${UNAME_MACHINE}-unknown-linux-gnu
991
echo ${UNAME_MACHINE}-unknown-linux-gnu
955
994
echo ${UNAME_MACHINE}-dec-linux-gnu
957
996
x86_64:Linux:*:*)
958
echo x86_64-${VENDOR}-linux-gnu
961
# The BFD linker knows what the default object file format is, so
962
# first see if it will tell us. cd to the root directory to prevent
963
# problems with other programs or directories called `ld' in the path.
964
# Set LC_ALL=C to ensure ld outputs messages in English.
965
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
966
| sed -ne '/supported targets:/!d
968
s/.*supported targets: *//
971
case "$ld_supported_targets" in
973
TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
976
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
979
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnucoff"
982
# Either a pre-BFD a.out linker (linux-gnuoldld) or
983
# one that does not give us useful --help.
984
echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
987
# Determine whether the default compiler is a.out or elf
988
eval $set_cc_for_build
989
sed 's/^ //' << EOF >$dummy.c
990
#include <features.h>
1002
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1012
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1017
test x"${LIBC}" != x && {
1018
echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
1021
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
997
echo ${UNAME_MACHINE}-unknown-linux-gnu
1000
echo ${UNAME_MACHINE}-unknown-linux-gnu
1023
1002
i*86:DYNIX/ptx:4*:*)
1024
1003
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1025
1004
# earlier versions are messed up and put the nodename in both
1129
1111
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1130
1112
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1131
1113
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1132
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1133
&& { echo i486-ncr-sysv4; exit; } ;;
1114
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1115
&& { echo i486-ncr-sysv4; exit; } ;;
1116
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1118
test -r /etc/.relid \
1119
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1120
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1121
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1122
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1123
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1124
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1125
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1134
1126
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1135
1127
echo m68k-unknown-lynxos${UNAME_RELEASE}