2
2
# Attempt to guess a canonical system name.
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4
4
# Free Software Foundation, Inc.
6
8
# This file is free software; you can redistribute it and/or modify it
7
9
# under the terms of the GNU General Public License as published by
8
10
# the Free Software Foundation; either version 2 of the License, or
23
25
# the same distribution terms that you use for the rest of that program.
25
27
# Written by Per Bothner <bothner@cygnus.com>.
26
# The master version of this file is at the FSF in /home/gd/gnu/lib.
27
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
28
# Please send patches to <config-patches@gnu.org>.
29
30
# This script attempts to guess a canonical system name similar to
30
31
# config.sub. If it succeeds, it prints the system name on stdout, and
37
38
# (but try to keep the structure clean).
41
me=`echo "$0" | sed -e 's,.*/,,'`
46
Output the configuration name of this system.
49
-h, --help print this help, then exit
50
-V, --version print version number, then exit"
53
Try \`$me --help' for more information."
56
while test $# -gt 0 ; do
58
--version | --vers* | -V )
59
echo "$version" ; exit 0 ;;
61
echo "$usage"; exit 0 ;;
62
-- ) # Stop option processing
64
- ) # Use stdin as input.
68
echo "$me: invalid option $1"
77
echo "$me: too many arguments$help" >&2
40
81
# Use $HOST_CC if defined. $CC may point to a cross-compiler
41
82
if test x"$CC_FOR_BUILD" = x; then
42
83
if test x"$HOST_CC" != x; then
68
109
# Note: order is significant - the case branches are not exclusive.
70
111
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
113
# Netbsd (nbsd) targets should (where applicable) match one or
114
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
115
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
116
# switched to ELF, *-*-netbsd* would select the old
117
# object file format. This provides both forward
118
# compatibility and a consistent mechanism for selecting the
119
# object file format.
120
# Determine the machine/vendor (is the vendor relevant).
121
case "${UNAME_MACHINE}" in
122
amiga) machine=m68k-unknown ;;
123
arm32) machine=arm-unknown ;;
124
atari*) machine=m68k-atari ;;
125
sun3*) machine=m68k-sun ;;
126
mac68k) machine=m68k-apple ;;
127
macppc) machine=powerpc-apple ;;
128
hp3[0-9][05]) machine=m68k-hp ;;
129
ibmrt|romp-ibm) machine=romp-ibm ;;
130
*) machine=${UNAME_MACHINE}-unknown ;;
132
# The Operating System including object format.
133
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
134
| grep __ELF__ >/dev/null
136
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
137
# Return netbsd for either. FIX?
143
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
144
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
145
# contains redundant information, the shorter form:
146
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
147
echo "${machine}-${os}${release}"
72
150
if test $UNAME_RELEASE = "V4.0"; then
73
151
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
77
155
# A Xn.n version is an unreleased experimental baselevel.
78
156
# 1.2 uses "1.2" for uname -r.
79
157
cat <<EOF >$dummy.s
160
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
85
.long 0x47e03d80 # implver $0
87
.long 0x47e20c21 # amask $2,$1
167
.frame \$30,16,\$26,0
170
.long 0x47e03d80 # implver \$0
172
.long 0x47e20c21 # amask \$2,\$1
96
182
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
97
183
if test "$?" = 0 ; then
101
186
UNAME_MACHINE="alpha"
104
189
UNAME_MACHINE="alphaev5"
107
192
UNAME_MACHINE="alphaev56"
110
195
UNAME_MACHINE="alphapca56"
113
198
UNAME_MACHINE="alphaev6"
201
UNAME_MACHINE="alphaev67"
117
205
rm -f $dummy.s $dummy
156
241
wgrisc:OpenBSD:*:*)
157
242
echo mipsel-unknown-openbsd${UNAME_RELEASE}
245
echo i370-ibm-openedition
159
247
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
160
248
echo arm-acorn-riscix${UNAME_RELEASE}
163
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
165
250
SR2?01:HI-UX/MPP:*:*)
166
251
echo hppa1.1-hitachi-hiuxmpp
219
304
echo sparc-auspex-sunos${UNAME_RELEASE}
222
echo m68k-atari-netbsd${UNAME_RELEASE}
224
306
atari*:OpenBSD:*:*)
225
307
echo m68k-unknown-openbsd${UNAME_RELEASE}
227
309
# The situation for MiNT is a little confusing. The machine name
228
310
# can be virtually everything (everything which is not
229
# "atarist" or "atariste" at least should have a processor
311
# "atarist" or "atariste" at least should have a processor
230
312
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
231
313
# to the lowercase version "mint" (or "freemint"). Finally
232
314
# the system name "TOS" denotes a system which is actually not
250
332
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
251
333
echo m68k-unknown-mint${UNAME_RELEASE}
254
echo m68k-sun-netbsd${UNAME_RELEASE}
256
335
sun3*:OpenBSD:*:*)
257
336
echo m68k-unknown-openbsd${UNAME_RELEASE}
260
echo m68k-apple-netbsd${UNAME_RELEASE}
262
338
mac68k:OpenBSD:*:*)
263
339
echo m68k-unknown-openbsd${UNAME_RELEASE}
289
362
mips:*:*:UMIPS | mips:*:*:RISCos)
290
363
sed 's/^ //' << EOF >$dummy.c
291
364
#ifdef __cplusplus
365
#include <stdio.h> /* for printf() prototype */
292
366
int main (int argc, char *argv[]) {
294
368
int main (argc, argv) int argc; char *argv[]; {
329
403
# DG/UX returns AViiON for all architectures
330
404
UNAME_PROCESSOR=`/usr/bin/uname -p`
331
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
332
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
333
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
405
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
407
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
408
[ ${TARGET_BINARY_INTERFACE}x = x ]
334
410
echo m88k-dg-dgux${UNAME_RELEASE}
336
412
echo m88k-dg-dguxbcs${UNAME_RELEASE}
415
echo i586-dg-dgux${UNAME_RELEASE}
338
else echo i586-dg-dgux${UNAME_RELEASE}
341
418
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
342
419
echo m88k-dolphin-sysv3
402
479
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
403
480
echo romp-ibm-bsd4.4
405
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
482
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
406
483
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
407
484
exit 0 ;; # report: romp-ibm BSD 4.3
547
626
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
550
echo t90-cray-unicos${UNAME_RELEASE}
629
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
553
echo alpha-cray-unicosmk${UNAME_RELEASE}
632
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
635
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
556
638
echo cray2-cray-unicos
563
645
F301:UNIX_System_V:*:*)
564
646
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
566
hp3[0-9][05]:NetBSD:*:*)
567
echo m68k-hp-netbsd${UNAME_RELEASE}
569
648
hp300:OpenBSD:*:*)
570
649
echo m68k-unknown-openbsd${UNAME_RELEASE}
572
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
651
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
573
652
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
575
654
sparc*:BSD/OS:*:*)
579
658
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
582
if test -x /usr/bin/objformat; then
583
if test "elf" = "`/usr/bin/objformat`"; then
584
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
588
661
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
591
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
594
664
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
600
670
echo ${UNAME_MACHINE}-pc-mingw32
673
echo ${UNAME_MACHINE}-pc-pw32
602
675
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
603
676
# How do we know it's Interix rather than the generic POSIX subsystem?
604
677
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
618
691
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
694
echo ${UNAME_MACHINE}-pc-minix
621
# uname on the ARM produces all sorts of strangeness, and we need to
623
case "$UNAME_MACHINE" in
624
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
625
arm* | sa110*) UNAME_MACHINE="arm" ;;
628
698
# The BFD linker knows what the default object file format is, so
629
699
# first see if it will tell us. cd to the root directory to prevent
638
708
case "$ld_supported_emulations" in
639
*ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
640
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
641
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
642
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
643
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
644
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
710
echo "${UNAME_MACHINE}-unknown-linux"
714
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
718
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
721
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
725
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
729
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
733
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
737
echo "${UNAME_MACHINE}-unknown-linux-gnu"
741
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
645
744
elf32ppc | elf32ppclinux)
646
745
# Determine Lib Version
647
746
cat >$dummy.c <<EOF
669
768
if test "$?" = 0 ; then
673
772
rm -f $dummy.c $dummy
674
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
773
echo powerpc-unknown-linux-gnu${LIBC}
777
echo "${UNAME_MACHINE}-unknown-linux-gnu"
677
782
if test "${UNAME_MACHINE}" = "alpha" ; then
678
sed 's/^ //' <<EOF >$dummy.s
684
.long 0x47e03d80 # implver $0
686
.long 0x47e20c21 # amask $2,$1
786
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
793
.frame \$30,16,\$26,0
796
.long 0x47e03d80 # implver \$0
798
.long 0x47e20c21 # amask \$2,\$1
696
809
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
697
810
if test "$?" = 0 ; then
701
813
UNAME_MACHINE="alpha"
704
816
UNAME_MACHINE="alphaev5"
707
819
UNAME_MACHINE="alphaev56"
710
822
UNAME_MACHINE="alphapca56"
713
825
UNAME_MACHINE="alphaev6"
828
UNAME_MACHINE="alphaev67"
717
832
objdump --private-headers $dummy | \
725
840
elif test "${UNAME_MACHINE}" = "mips" ; then
726
841
cat >$dummy.c <<EOF
727
842
#ifdef __cplusplus
843
#include <stdio.h> /* for printf() prototype */
728
844
int main (int argc, char *argv[]) {
730
846
int main (argc, argv) int argc; char *argv[]; {
741
857
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
742
858
rm -f $dummy.c $dummy
859
elif test "${UNAME_MACHINE}" = "s390"; then
860
echo s390-ibm-linux && exit 0
861
elif test "${UNAME_MACHINE}" = "x86_64"; then
862
echo x86_64-unknown-linux-gnu && exit 0
863
elif test "${UNAME_MACHINE}" = "parisc" -o "${UNAME_MACHINE}" = "hppa"; then
865
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
867
echo hppa1.1-unknown-linux-gnu
870
echo hppa2.0-unknown-linux-gnu
873
echo hppa-unknown-linux-gnu
744
878
# Either a pre-BFD a.out linker (linux-gnuoldld)
745
879
# or one that does not give us useful --help.
784
919
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
785
920
rm -f $dummy.c $dummy
921
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
787
923
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
788
924
# are messed up and put the nodename in both sysname and nodename.
798
934
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
800
936
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
937
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
801
938
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
802
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
939
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
804
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
941
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
808
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
809
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
810
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
811
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
812
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
813
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
945
# Fixed at (any) Pentium or better
947
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
948
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
950
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
816
954
if test -f /usr/options/cb.name; then
830
968
echo ${UNAME_MACHINE}-pc-sysv32
972
echo ${UNAME_MACHINE}-pc-msdosdjgpp
975
# Left here for compatibility:
834
976
# uname -m prints for DJGPP always 'pc', but it prints nothing about
835
977
# the processor, so we play safe by assuming i386.
836
978
echo i386-pc-msdosdjgpp
945
1087
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1090
echo `uname -p`-apple-darwin${UNAME_RELEASE}
1092
*:procnto*:*:* | *:QNX:[0123456789]*:*)
1093
if test "${UNAME_MACHINE}" = "x86pc"; then
1096
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1101
NSR-[KW]:NONSTOP_KERNEL:*:*)
1102
echo nsr-tandem-nsk${UNAME_RELEASE}
1105
echo bs2000-siemens-sysv
1107
DS/*:UNIX_System_V:*:*)
1108
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1111
# "uname -m" is not consistent, so use $cputype instead. 386
1112
# is converted to i386 for consistency with other x86
1113
# operating systems.
1114
if test "$cputype" = "386"; then
1117
UNAME_MACHINE="$cputype"
1119
echo ${UNAME_MACHINE}-unknown-plan9
949
1123
#echo '(No uname command or uname output not recognized.)' 1>&2
1086
#echo '(Unable to guess system type)' 1>&2
1261
$0: unable to guess system type
1263
The $version version of this script cannot recognize your system type.
1264
Please download the most up to date version of the config scripts:
1266
ftp://ftp.gnu.org/pub/gnu/config/
1268
If the version you run ($0) is already up to date, please
1269
send the following data and any information you think might be
1270
pertinent to <config-patches@gnu.org> in order to provide the needed
1271
information to handle your system.
1273
config.guess version = $version
1275
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1276
uname -r = `(uname -r) 2>/dev/null || echo unknown`
1277
uname -s = `(uname -s) 2>/dev/null || echo unknown`
1278
uname -v = `(uname -v) 2>/dev/null || echo unknown`
1280
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1281
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1283
hostinfo = `(hostinfo) 2>/dev/null`
1284
/bin/universe = `(/bin/universe) 2>/dev/null`
1285
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1286
/bin/arch = `(/bin/arch) 2>/dev/null`
1287
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1288
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1290
UNAME_MACHINE = ${UNAME_MACHINE}
1291
UNAME_RELEASE = ${UNAME_RELEASE}
1292
UNAME_SYSTEM = ${UNAME_SYSTEM}
1293
UNAME_VERSION = ${UNAME_VERSION}
1299
# eval: (add-hook 'write-file-hooks 'time-stamp)
1300
# time-stamp-start: "version='"
1301
# time-stamp-format: "%:y-%02m-%02d"
1302
# time-stamp-end: "'"