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, 2007, 2008, 2009, 2010,
5
# 2011 Free Software Foundation, Inc.
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5
# 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
56
56
GNU config.guess ($timestamp)
58
58
Originally written by Per Bothner.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
61
Software Foundation, Inc.
59
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
63
62
This is free software; see the source for copying conditions. There is NO
64
63
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
140
139
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
141
140
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
143
case "${UNAME_SYSTEM}" in
145
eval $set_cc_for_build
146
cat <<-EOF > $dummy.c
147
#include <features.h>
149
# ifdef __UCLIBC_CONFIG_VERSION__
150
LIBC=uclibc __UCLIBC_CONFIG_VERSION__
162
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
166
142
# Note: order is significant - the case branches are not exclusive.
168
144
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
293
269
# A Xn.n version is an unreleased experimental baselevel.
294
270
# 1.2 uses "1.2" for uname -r.
295
271
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
296
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
300
273
Alpha\ *:Windows_NT*:*)
301
274
# How do we know it's Interix rather than the generic POSIX subsystem?
302
275
# Should we change UNAME_MACHINE based on the output of uname instead
421
394
# MiNT. But MiNT is downward compatible to TOS, so this should
423
396
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
424
echo m68k-atari-mint${UNAME_RELEASE}
397
echo m68k-atari-mint${UNAME_RELEASE}
426
399
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
427
400
echo m68k-atari-mint${UNAME_RELEASE}
429
402
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
430
echo m68k-atari-mint${UNAME_RELEASE}
403
echo m68k-atari-mint${UNAME_RELEASE}
432
405
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
433
echo m68k-milan-mint${UNAME_RELEASE}
406
echo m68k-milan-mint${UNAME_RELEASE}
435
408
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
436
echo m68k-hades-mint${UNAME_RELEASE}
409
echo m68k-hades-mint${UNAME_RELEASE}
438
411
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
439
echo m68k-unknown-mint${UNAME_RELEASE}
412
echo m68k-unknown-mint${UNAME_RELEASE}
441
414
m68k:machten:*:*)
442
415
echo m68k-apple-machten${UNAME_RELEASE}
507
480
echo m88k-motorola-sysv3
510
# DG/UX returns AViiON for all architectures
511
UNAME_PROCESSOR=`/usr/bin/uname -p`
483
# DG/UX returns AViiON for all architectures
484
UNAME_PROCESSOR=`/usr/bin/uname -p`
512
485
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
514
487
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
621
594
9000/[678][0-9][0-9])
622
595
if [ -x /usr/bin/getconf ]; then
623
596
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
624
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
625
case "${sc_cpu_version}" in
626
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
627
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
628
532) # CPU_PA_RISC2_0
629
case "${sc_kernel_bits}" in
630
32) HP_ARCH="hppa2.0n" ;;
631
64) HP_ARCH="hppa2.0w" ;;
597
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
598
case "${sc_cpu_version}" in
599
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
600
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
601
532) # CPU_PA_RISC2_0
602
case "${sc_kernel_bits}" in
603
32) HP_ARCH="hppa2.0n" ;;
604
64) HP_ARCH="hppa2.0w" ;;
632
605
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
636
609
if [ "${HP_ARCH}" = "" ]; then
637
610
eval $set_cc_for_build
638
sed 's/^ //' << EOF >$dummy.c
646
#if defined(_SC_KERNEL_BITS)
647
long bits = sysconf(_SC_KERNEL_BITS);
649
long cpu = sysconf (_SC_CPU_VERSION);
653
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
654
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
656
#if defined(_SC_KERNEL_BITS)
659
case 64: puts ("hppa2.0w"); break;
660
case 32: puts ("hppa2.0n"); break;
661
default: puts ("hppa2.0"); break;
663
#else /* !defined(_SC_KERNEL_BITS) */
664
puts ("hppa2.0"); break;
666
default: puts ("hppa1.0"); break;
611
sed 's/^ //' << EOF >$dummy.c
619
#if defined(_SC_KERNEL_BITS)
620
long bits = sysconf(_SC_KERNEL_BITS);
622
long cpu = sysconf (_SC_CPU_VERSION);
626
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
627
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
629
#if defined(_SC_KERNEL_BITS)
632
case 64: puts ("hppa2.0w"); break;
633
case 32: puts ("hppa2.0n"); break;
634
default: puts ("hppa2.0"); break;
636
#else /* !defined(_SC_KERNEL_BITS) */
637
puts ("hppa2.0"); break;
639
default: puts ("hppa1.0"); break;
671
644
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
672
645
test -z "$HP_ARCH" && HP_ARCH=hppa
758
731
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
759
732
echo c1-convex-bsd
761
734
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
762
735
if getsysinfo -f scalar_acc
763
736
then echo c32-convex-bsd
764
737
else echo c2-convex-bsd
767
740
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
768
741
echo c34-convex-bsd
770
743
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
771
744
echo c38-convex-bsd
773
746
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
774
747
echo c4-convex-bsd
777
750
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
797
770
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
798
771
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
799
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
800
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
801
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
772
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
773
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
774
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
803
776
5000:UNIX_System_V:4.*:*)
804
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
805
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
806
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
777
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
778
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
779
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
808
781
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
809
782
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
831
804
echo ${UNAME_MACHINE}-pc-mingw32
834
# uname -m includes "-pc" on this system.
835
echo ${UNAME_MACHINE}-mingw32
807
# uname -m includes "-pc" on this system.
808
echo ${UNAME_MACHINE}-mingw32
838
811
echo ${UNAME_MACHINE}-pc-pw32
841
case ${UNAME_MACHINE} in
814
case ${UNAME_MACHINE} in
843
816
echo i586-pc-interix${UNAME_RELEASE}
878
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
851
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
881
854
# other systems with GNU libc and userland
882
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
855
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
885
858
echo ${UNAME_MACHINE}-pc-minix
893
866
EV6) UNAME_MACHINE=alphaev6 ;;
894
867
EV67) UNAME_MACHINE=alphaev67 ;;
895
868
EV68*) UNAME_MACHINE=alphaev68 ;;
897
870
objdump --private-headers /bin/sh | grep -q ld.so.1
898
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
899
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
871
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
872
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
902
875
eval $set_cc_for_build
903
876
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
904
877
| grep -q __ARM_EABI__
906
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
879
echo ${UNAME_MACHINE}-unknown-linux-gnu
908
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
909
| grep -q __ARM_PCS_VFP
911
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
913
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
881
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
917
884
avr32*:Linux:*:*)
918
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
885
echo ${UNAME_MACHINE}-unknown-linux-gnu
921
echo cris-axis-linux-${LIBC}
888
echo cris-axis-linux-gnu
923
890
crisv32:Linux:*:*)
924
echo crisv32-axis-linux-${LIBC}
891
echo crisv32-axis-linux-gnu
927
echo frv-unknown-linux-${LIBC}
894
echo frv-unknown-linux-gnu
930
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
898
eval $set_cc_for_build
899
sed 's/^ //' << EOF >$dummy.c
904
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
905
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
933
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
908
echo ${UNAME_MACHINE}-unknown-linux-gnu
936
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
911
echo ${UNAME_MACHINE}-unknown-linux-gnu
939
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
914
echo ${UNAME_MACHINE}-unknown-linux-gnu
941
916
mips:Linux:*:* | mips64:Linux:*:*)
942
917
eval $set_cc_for_build
957
932
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
958
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
933
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
961
echo or32-unknown-linux-${LIBC}
936
echo or32-unknown-linux-gnu
964
echo sparc-unknown-linux-${LIBC}
939
echo sparc-unknown-linux-gnu
966
941
parisc64:Linux:*:* | hppa64:Linux:*:*)
967
echo hppa64-unknown-linux-${LIBC}
942
echo hppa64-unknown-linux-gnu
969
944
parisc:Linux:*:* | hppa:Linux:*:*)
970
945
# Look for CPU level
971
946
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
972
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
973
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
974
*) echo hppa-unknown-linux-${LIBC} ;;
947
PA7*) echo hppa1.1-unknown-linux-gnu ;;
948
PA8*) echo hppa2.0-unknown-linux-gnu ;;
949
*) echo hppa-unknown-linux-gnu ;;
978
echo powerpc64-unknown-linux-${LIBC}
953
echo powerpc64-unknown-linux-gnu
981
echo powerpc-unknown-linux-${LIBC}
956
echo powerpc-unknown-linux-gnu
983
958
s390:Linux:*:* | s390x:Linux:*:*)
984
959
echo ${UNAME_MACHINE}-ibm-linux
987
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
962
echo ${UNAME_MACHINE}-unknown-linux-gnu
990
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
965
echo ${UNAME_MACHINE}-unknown-linux-gnu
992
967
sparc:Linux:*:* | sparc64:Linux:*:*)
993
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
996
968
echo ${UNAME_MACHINE}-unknown-linux-gnu
999
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
971
echo ${UNAME_MACHINE}-dec-linux-gnu
1001
973
x86_64:Linux:*:*)
1002
echo x86_64-unknown-linux-${LIBC}
974
echo x86_64-unknown-linux-gnu
1004
976
xtensa*:Linux:*:*)
1005
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977
echo ${UNAME_MACHINE}-unknown-linux-gnu
1007
979
i*86:DYNIX/ptx:4*:*)
1008
980
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1011
983
echo i386-sequent-sysv4
1013
985
i*86:UNIX_SV:4.2MP:2.*)
1014
# Unixware is an offshoot of SVR4, but it has its own version
1015
# number series starting with 2...
1016
# I am not positive that other SVR4 systems won't match this,
986
# Unixware is an offshoot of SVR4, but it has its own version
987
# number series starting with 2...
988
# I am not positive that other SVR4 systems won't match this,
1017
989
# I just have to hope. -- rms.
1018
# Use sysv4.2uw... so that sysv4* matches it.
990
# Use sysv4.2uw... so that sysv4* matches it.
1019
991
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1049
1021
i*86:*:5:[678]*)
1050
# UnixWare 7.x, OpenUNIX and OpenServer 6.
1022
# UnixWare 7.x, OpenUNIX and OpenServer 6.
1051
1023
case `/bin/uname -X | grep "^Machine"` in
1052
1024
*486*) UNAME_MACHINE=i486 ;;
1053
1025
*Pentium) UNAME_MACHINE=i586 ;;
1077
1049
# Left here for compatibility:
1078
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1079
# the processor, so we play safe by assuming i586.
1050
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1051
# the processor, so we play safe by assuming i586.
1080
1052
# Note: whatever this is, it MUST be the same as what config.sub
1081
1053
# prints for the "djgpp" host, or else GDB configury will decide that
1082
1054
# this is a cross-build.
1083
1055
echo i586-pc-msdosdjgpp
1085
1057
Intel:Mach:3*:*)
1086
1058
echo i386-pc-mach3
1116
1088
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1117
1089
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1118
1090
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1119
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1120
&& { echo i486-ncr-sysv4; exit; } ;;
1091
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1092
&& { echo i486-ncr-sysv4; exit; } ;;
1121
1093
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1123
1095
test -r /etc/.relid \
1160
1132
echo ns32k-sni-sysv
1163
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1164
# says <Richard.M.Bartel@ccMail.Census.GOV>
1165
echo i586-unisys-sysv4
1135
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1136
# says <Richard.M.Bartel@ccMail.Census.GOV>
1137
echo i586-unisys-sysv4
1167
1139
*:UNIX_System_V:4*:FTX*)
1168
1140
# From Gerald Hewes <hewes@openmarket.com>.
1169
1141
# How about differentiating between stratus architectures? -djm
1190
1162
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1191
1163
if [ -d /usr/nec ]; then
1192
echo mips-nec-sysv${UNAME_RELEASE}
1164
echo mips-nec-sysv${UNAME_RELEASE}
1194
echo mips-unknown-sysv${UNAME_RELEASE}
1166
echo mips-unknown-sysv${UNAME_RELEASE}
1197
1169
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1198
1170
echo powerpc-be-beos
1306
1275
echo pdp10-unknown-its
1309
echo mips-sei-seiux${UNAME_RELEASE}
1278
echo mips-sei-seiux${UNAME_RELEASE}
1311
1280
*:DragonFly:*:*)
1312
1281
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1315
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1284
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1316
1285
case "${UNAME_MACHINE}" in
1317
1286
A*) echo alpha-dec-vms ; exit ;;
1318
1287
I*) echo ia64-dec-vms ; exit ;;