2
2
# Attempt to guess a canonical system name.
3
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4
4
# Free Software Foundation, Inc.
5
- #
5
+
6
+ version=' 2000-10-23'
7
+
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
36
38
# (but try to keep the structure clean).
37
39
#
38
40
41
+ me=` echo " $0 " | sed -e ' s,.*/,,' `
42
+
43
+ usage=" \
44
+ Usage: $0 [OPTION]
45
+
46
+ Output the configuration name of this system.
47
+
48
+ Operation modes:
49
+ -h, --help print this help, then exit
50
+ -V, --version print version number, then exit"
51
+
52
+ help="
53
+ Try \` $me --help' for more information."
54
+
55
+ # Parse command line
56
+ while test $# -gt 0 ; do
57
+ case " $1 " in
58
+ --version | --vers* | -V )
59
+ echo " $version " ; exit 0 ;;
60
+ --help | --h* | -h )
61
+ echo " $usage " ; exit 0 ;;
62
+ -- ) # Stop option processing
63
+ shift ; break ;;
64
+ - ) # Use stdin as input.
65
+ break ;;
66
+ -* )
67
+ exec >&2
68
+ echo " $me : invalid option $1 "
69
+ echo " $help "
70
+ exit 1 ;;
71
+ * )
72
+ break ;;
73
+ esac
74
+ done
75
+
76
+ if test $# ! = 0; then
77
+ echo " $me : too many arguments$help " >&2
78
+ exit 1
79
+ fi
80
+
39
81
# Use $HOST_CC if defined. $CC may point to a cross-compiler
40
82
if test x" $CC_FOR_BUILD " = x; then
41
83
if test x" $HOST_CC " ! = x; then
@@ -77,7 +119,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
77
119
# object file format.
78
120
# Determine the machine/vendor (is the vendor relevant).
79
121
case " ${UNAME_MACHINE} " in
80
- amiga) machine=m68k-cbm ;;
122
+ amiga) machine=m68k-unknown ;;
81
123
arm32) machine=arm-unknown ;;
82
124
atari* ) machine=m68k-atari ;;
83
125
sun3* ) machine=m68k-sun ;;
173
215
echo alpha-dec-winnt3.5
174
216
exit 0 ;;
175
217
Amiga* :UNIX_System_V:4.0:* )
176
- echo m68k-cbm -sysv4
218
+ echo m68k-unknown -sysv4
177
219
exit 0;;
178
220
amiga:OpenBSD:* :* )
179
221
echo m68k-unknown-openbsd${UNAME_RELEASE}
360
402
AViiON:dgux:* :* )
361
403
# DG/UX returns AViiON for all architectures
362
404
UNAME_PROCESSOR=` /usr/bin/uname -p`
363
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
405
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
364
406
then
365
407
if [ ${TARGET_BINARY_INTERFACE} x = m88kdguxelfx ] || \
366
408
[ ${TARGET_BINARY_INTERFACE} x = x ]
458
500
9000/[34]?? ) HP_ARCH=m68k ;;
459
501
9000/[678][0-9][0-9])
460
502
sed ' s/^ //' << EOF >$dummy .c
503
+
504
+ #define _HPUX_SOURCE
461
505
#include <stdlib.h>
462
506
#include <unistd.h>
463
507
614
658
echo ${UNAME_MACHINE} -unknown-bsdi${UNAME_RELEASE}
615
659
exit 0 ;;
616
660
* :FreeBSD:* :* )
617
- if test -x /usr/bin/objformat; then
618
- if test " elf" = " ` /usr/bin/objformat` " ; then
619
- echo ${UNAME_MACHINE} -unknown-freebsdelf` echo ${UNAME_RELEASE} | sed -e ' s/[-_].*//' `
620
- exit 0
621
- fi
622
- fi
623
661
echo ${UNAME_MACHINE} -unknown-freebsd` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' `
624
662
exit 0 ;;
625
663
* :OpenBSD:* :* )
631
669
i* :MINGW* :* )
632
670
echo ${UNAME_MACHINE} -pc-mingw32
633
671
exit 0 ;;
672
+ i* :PW* :* )
673
+ echo ${UNAME_MACHINE} -pc-pw32
674
+ exit 0 ;;
634
675
i* :Windows_NT* :* | Pentium* :Windows_NT* :* )
635
676
# How do we know it's Interix rather than the generic POSIX subsystem?
636
677
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -649,13 +690,15 @@ EOF
649
690
* :GNU:* :* )
650
691
echo ` echo ${UNAME_MACHINE} | sed -e ' s,[-/].*$,,' ` -unknown-gnu` echo ${UNAME_RELEASE} | sed -e ' s,/.*$,,' `
651
692
exit 0 ;;
693
+ i* 86:Minix:* :* )
694
+ echo ${UNAME_MACHINE} -pc-minix
695
+ exit 0 ;;
652
696
* :Linux:* :* )
653
697
654
698
# The BFD linker knows what the default object file format is, so
655
699
# first see if it will tell us. cd to the root directory to prevent
656
700
# problems with other programs or directories called `ld' in the path.
657
- ld_help_string=` cd /; ld --help 2>&1 `
658
- ld_supported_emulations=` echo $ld_help_string \
701
+ ld_supported_emulations=` cd /; ld --help 2>&1 \
659
702
| sed -ne ' /supported emulations:/!d
660
703
s/[ ][ ]*/ /g
661
704
s/.*supported emulations: *//
670
713
echo " ${UNAME_MACHINE} -pc-linux-gnuaout"
671
714
exit 0
672
715
;;
716
+ elf_i? 86)
717
+ TENTATIVE=" ${UNAME_MACHINE} -pc-linux-gnu"
718
+ ;;
673
719
i? 86coff)
674
720
echo " ${UNAME_MACHINE} -pc-linux-gnucoff"
675
721
exit 0
726
772
echo powerpc-unknown-linux-gnu${LIBC}
727
773
exit 0
728
774
;;
775
+ shelf_linux)
776
+ echo " ${UNAME_MACHINE} -unknown-linux-gnu"
777
+ exit 0
778
+ ;;
729
779
esac
730
780
731
781
if test " ${UNAME_MACHINE} " = " alpha" ; then
@@ -807,14 +857,30 @@ EOF
807
857
rm -f $dummy .c $dummy
808
858
elif test " ${UNAME_MACHINE} " = " s390" ; then
809
859
echo s390-ibm-linux && exit 0
860
+ elif test " ${UNAME_MACHINE} " = " x86_64" ; then
861
+ echo x86_64-unknown-linux-gnu && exit 0
862
+ elif test " ${UNAME_MACHINE} " = " parisc" -o " ${UNAME_MACHINE} " = " hppa" ; then
863
+ # Look for CPU level
864
+ case ` grep ' ^cpu[^a-z]*:' /proc/cpuinfo 2> /dev/null | cut -d' ' -f2` in
865
+ PA7* )
866
+ echo hppa1.1-unknown-linux-gnu
867
+ ;;
868
+ PA8* )
869
+ echo hppa2.0-unknown-linux-gnu
870
+ ;;
871
+ * )
872
+ echo hppa-unknown-linux-gnu
873
+ ;;
874
+ esac
875
+ exit 0
810
876
else
811
877
# Either a pre-BFD a.out linker (linux-gnuoldld)
812
878
# or one that does not give us useful --help.
813
879
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
814
880
# If ld does not provide *any* "supported emulations:"
815
881
# that means it is gnuoldld.
816
- echo " $ld_help_string " | grep > /dev/null 2>&1 " supported emulations: "
817
- test $? ! = 0 && echo " ${UNAME_MACHINE} -pc-linux-gnuoldld" && exit 0
882
+ test -z " $ld_supported_emulations " \
883
+ && echo " ${UNAME_MACHINE} -pc-linux-gnuoldld" && exit 0
818
884
819
885
case " ${UNAME_MACHINE} " in
820
886
i? 86)
851
917
EOF
852
918
$CC_FOR_BUILD $dummy .c -o $dummy 2> /dev/null && ./$dummy " ${UNAME_MACHINE} " && rm $dummy .c $dummy && exit 0
853
919
rm -f $dummy .c $dummy
920
+ test x" ${TENTATIVE} " ! = x && echo " ${TENTATIVE} " && exit 0
854
921
fi ;;
855
922
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
856
923
# are messed up and put the nodename in both sysname and nodename.
928
995
exit 0 ;;
929
996
M68* :* :R3V[567]* :* )
930
997
test -r /sysV68 && echo ' m68k-motorola-sysv' && exit 0 ;;
931
- 3[34]?? :* :4.0:3.0 | 3[34]?? ,* :* :4.0:3.0 | 4850:* :4.0:3.0)
998
+ 3[34]?? :* :4.0:3.0 | 3[34]?? A: * :4.0:3.0 | 3[34] ?? ,* :* :4.0:3.0 | 4850:* :4.0:3.0)
932
999
OS_REL=' '
933
1000
test -r /etc/.relid \
934
1001
&& OS_REL=.` sed -n ' s/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
987
1054
mc68* :A/UX:* :* )
988
1055
echo m68k-apple-aux${UNAME_RELEASE}
989
1056
exit 0 ;;
990
- news* :NEWS-OS:* :6 * )
1057
+ news* :NEWS-OS:6 * : * )
991
1058
echo mips-sony-newsos6
992
1059
exit 0 ;;
993
1060
R[34]000:* System_V* :* :* | R4000:UNIX_SYSV:* :* | R* 000:UNIX_SV:* :* )
@@ -1018,24 +1085,41 @@ EOF
1018
1085
* :Rhapsody:* :* )
1019
1086
echo ${UNAME_MACHINE} -apple-rhapsody${UNAME_RELEASE}
1020
1087
exit 0 ;;
1021
- Power* :Mac* OS:* :* )
1022
- echo powerpc-apple-macos${UNAME_RELEASE}
1023
- exit 0 ;;
1024
- * :Mac* OS:* :* )
1025
- echo ${UNAME_MACHINE} -apple-macos${UNAME_RELEASE}
1088
+ * :Darwin:* :* )
1089
+ echo ` uname -p` -apple-darwin${UNAME_RELEASE}
1026
1090
exit 0 ;;
1027
1091
* :procnto* :* :* | * :QNX:[0123456789]* :* )
1028
1092
if test " ${UNAME_MACHINE} " = " x86pc" ; then
1029
1093
UNAME_MACHINE=pc
1030
1094
fi
1031
1095
echo ` uname -p` -${UNAME_MACHINE} -nto-qnx
1032
- exit 0;;
1096
+ exit 0 ;;
1033
1097
* :QNX:* :4* )
1034
1098
echo i386-pc-qnx
1035
1099
exit 0 ;;
1036
- NSR-W :NONSTOP_KERNEL:* :* )
1100
+ NSR-[KW] :NONSTOP_KERNEL:* :* )
1037
1101
echo nsr-tandem-nsk${UNAME_RELEASE}
1038
1102
exit 0 ;;
1103
+ * :NonStop-UX:* :* )
1104
+ echo mips-compaq-nonstopux
1105
+ exit 0 ;;
1106
+ BS2000:POSIX* :* :* )
1107
+ echo bs2000-siemens-sysv
1108
+ exit 0 ;;
1109
+ DS/* :UNIX_System_V:* :* )
1110
+ echo ${UNAME_MACHINE} -${UNAME_SYSTEM} -${UNAME_RELEASE}
1111
+ exit 0 ;;
1112
+ * :Plan9:* :* )
1113
+ # "uname -m" is not consistent, so use $cputype instead. 386
1114
+ # is converted to i386 for consistency with other x86
1115
+ # operating systems.
1116
+ if test " $cputype " = " 386" ; then
1117
+ UNAME_MACHINE=i386
1118
+ else
1119
+ UNAME_MACHINE=" $cputype "
1120
+ fi
1121
+ echo ${UNAME_MACHINE} -unknown-plan9
1122
+ exit 0 ;;
1039
1123
esac
1040
1124
1041
1125
# echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1175,6 +1259,47 @@ then
1175
1259
esac
1176
1260
fi
1177
1261
1178
- # echo '(Unable to guess system type)' 1>&2
1262
+ cat >&2 << EOF
1263
+ $0 : unable to guess system type
1264
+
1265
+ The $version version of this script cannot recognize your system type.
1266
+ Please download the most up to date version of the config scripts:
1267
+
1268
+ ftp://ftp.gnu.org/pub/gnu/config/
1269
+
1270
+ If the version you run ($0 ) is already up to date, please
1271
+ send the following data and any information you think might be
1272
+ pertinent to <config-patches@gnu.org> in order to provide the needed
1273
+ information to handle your system.
1274
+
1275
+ config.guess version = $version
1276
+
1277
+ uname -m = ` (uname -m) 2> /dev/null || echo unknown`
1278
+ uname -r = ` (uname -r) 2> /dev/null || echo unknown`
1279
+ uname -s = ` (uname -s) 2> /dev/null || echo unknown`
1280
+ uname -v = ` (uname -v) 2> /dev/null || echo unknown`
1281
+
1282
+ /usr/bin/uname -p = ` (/usr/bin/uname -p) 2> /dev/null`
1283
+ /bin/uname -X = ` (/bin/uname -X) 2> /dev/null`
1284
+
1285
+ hostinfo = ` (hostinfo) 2> /dev/null`
1286
+ /bin/universe = ` (/bin/universe) 2> /dev/null`
1287
+ /usr/bin/arch -k = ` (/usr/bin/arch -k) 2> /dev/null`
1288
+ /bin/arch = ` (/bin/arch) 2> /dev/null`
1289
+ /usr/bin/oslevel = ` (/usr/bin/oslevel) 2> /dev/null`
1290
+ /usr/convex/getsysinfo = ` (/usr/convex/getsysinfo) 2> /dev/null`
1291
+
1292
+ UNAME_MACHINE = ${UNAME_MACHINE}
1293
+ UNAME_RELEASE = ${UNAME_RELEASE}
1294
+ UNAME_SYSTEM = ${UNAME_SYSTEM}
1295
+ UNAME_VERSION = ${UNAME_VERSION}
1296
+ EOF
1179
1297
1180
1298
exit 1
1299
+
1300
+ # Local variables:
1301
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
1302
+ # time-stamp-start: "version='"
1303
+ # time-stamp-format: "%:y-%02m-%02d"
1304
+ # time-stamp-end: "'"
1305
+ # End:
0 commit comments