summaryrefslogtreecommitdiff
path: root/config.guess
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-01-07 08:56:05 +1100
committerDamien Miller <djm@mindrot.org>2000-01-07 08:56:05 +1100
commit2edcda5d4c716e849459e87faeb3b03c1282cbbe (patch)
tree8d5e5caeb4ea34bd3204e9266d5d6d1a1efee166 /config.guess
parent105b7f073ac053d8f00d2b79d9fd8555d34a84f3 (diff)
- New config.sub and config.guess to fix problems on SCO. Supplied
by Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'config.guess')
-rwxr-xr-xconfig.guess450
1 files changed, 320 insertions, 130 deletions
diff --git a/config.guess b/config.guess
index 2960d6e0d..6b5426161 100755
--- a/config.guess
+++ b/config.guess
@@ -1,6 +1,7 @@
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, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. 3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
4# Free Software Foundation, Inc.
4# 5#
5# This file is free software; you can redistribute it and/or modify it 6# This file is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by 7# under the terms of the GNU General Public License as published by
@@ -23,6 +24,7 @@
23 24
24# Written by Per Bothner <bothner@cygnus.com>. 25# Written by Per Bothner <bothner@cygnus.com>.
25# The master version of this file is at the FSF in /home/gd/gnu/lib. 26# The master version of this file is at the FSF in /home/gd/gnu/lib.
27# Please send patches to <autoconf-patches@gnu.org>.
26# 28#
27# This script attempts to guess a canonical system name similar to 29# This script attempts to guess a canonical system name similar to
28# config.sub. If it succeeds, it prints the system name on stdout, and 30# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -35,6 +37,20 @@
35# (but try to keep the structure clean). 37# (but try to keep the structure clean).
36# 38#
37 39
40# Use $HOST_CC if defined. $CC may point to a cross-compiler
41if test x"$CC_FOR_BUILD" = x; then
42 if test x"$HOST_CC" != x; then
43 CC_FOR_BUILD="$HOST_CC"
44 else
45 if test x"$CC" != x; then
46 CC_FOR_BUILD="$CC"
47 else
48 CC_FOR_BUILD=cc
49 fi
50 fi
51fi
52
53
38# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 54# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
39# (ghazi@noc.rutgers.edu 8/24/94.) 55# (ghazi@noc.rutgers.edu 8/24/94.)
40if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 56if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -46,7 +62,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
46UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 62UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
47UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 63UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
48 64
49trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 65dummy=dummy-$$
66trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
50 67
51# Note: order is significant - the case branches are not exclusive. 68# Note: order is significant - the case branches are not exclusive.
52 69
@@ -59,46 +76,62 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
59 # A Tn.n version is a released field test version. 76 # A Tn.n version is a released field test version.
60 # A Xn.n version is an unreleased experimental baselevel. 77 # A Xn.n version is an unreleased experimental baselevel.
61 # 1.2 uses "1.2" for uname -r. 78 # 1.2 uses "1.2" for uname -r.
62 cat <<EOF >dummy.s 79 cat <<EOF >$dummy.s
80 .data
81\$Lformat:
82 .byte 37,100,45,37,120,10,0 # "%d-%x\n"
83
84 .text
63 .globl main 85 .globl main
86 .align 4
64 .ent main 87 .ent main
65main: 88main:
66 .frame \$30,0,\$26,0 89 .frame \$30,16,\$26,0
67 .prologue 0 90 ldgp \$29,0(\$27)
68 .long 0x47e03d80 # implver $0 91 .prologue 1
69 lda \$2,259 92 .long 0x47e03d80 # implver \$0
70 .long 0x47e20c21 # amask $2,$1 93 lda \$2,-1
71 srl \$1,8,\$2 94 .long 0x47e20c21 # amask \$2,\$1
72 sll \$2,2,\$2 95 lda \$16,\$Lformat
73 sll \$0,3,\$0 96 mov \$0,\$17
74 addl \$1,\$0,\$0 97 not \$1,\$18
75 addl \$2,\$0,\$0 98 jsr \$26,printf
76 ret \$31,(\$26),1 99 ldgp \$29,0(\$26)
100 mov 0,\$16
101 jsr \$26,exit
77 .end main 102 .end main
78EOF 103EOF
79 ${CC-cc} dummy.s -o dummy 2>/dev/null 104 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
80 if test "$?" = 0 ; then 105 if test "$?" = 0 ; then
81 ./dummy 106 case `./$dummy` in
82 case "$?" in 107 0-0)
83 7)
84 UNAME_MACHINE="alpha" 108 UNAME_MACHINE="alpha"
85 ;; 109 ;;
86 15) 110 1-0)
87 UNAME_MACHINE="alphaev5" 111 UNAME_MACHINE="alphaev5"
88 ;; 112 ;;
89 14) 113 1-1)
90 UNAME_MACHINE="alphaev56" 114 UNAME_MACHINE="alphaev56"
91 ;; 115 ;;
92 10) 116 1-101)
93 UNAME_MACHINE="alphapca56" 117 UNAME_MACHINE="alphapca56"
94 ;; 118 ;;
95 16) 119 2-303)
96 UNAME_MACHINE="alphaev6" 120 UNAME_MACHINE="alphaev6"
97 ;; 121 ;;
122 2-307)
123 UNAME_MACHINE="alphaev67"
124 ;;
98 esac 125 esac
99 fi 126 fi
100 rm -f dummy.s dummy 127 rm -f $dummy.s $dummy
101 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` 128 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
129 exit 0 ;;
130 Alpha\ *:Windows_NT*:*)
131 # How do we know it's Interix rather than the generic POSIX subsystem?
132 # Should we change UNAME_MACHINE based on the output of uname instead
133 # of the specific Alpha model?
134 echo alpha-pc-interix
102 exit 0 ;; 135 exit 0 ;;
103 21064:Windows_NT:50:3) 136 21064:Windows_NT:50:3)
104 echo alpha-dec-winnt3.5 137 echo alpha-dec-winnt3.5
@@ -133,6 +166,9 @@ EOF
133 wgrisc:OpenBSD:*:*) 166 wgrisc:OpenBSD:*:*)
134 echo mipsel-unknown-openbsd${UNAME_RELEASE} 167 echo mipsel-unknown-openbsd${UNAME_RELEASE}
135 exit 0 ;; 168 exit 0 ;;
169 *:OS/390:*:*)
170 echo i370-ibm-openedition
171 exit 0 ;;
136 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 172 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
137 echo arm-acorn-riscix${UNAME_RELEASE} 173 echo arm-acorn-riscix${UNAME_RELEASE}
138 exit 0;; 174 exit 0;;
@@ -142,7 +178,7 @@ EOF
142 SR2?01:HI-UX/MPP:*:*) 178 SR2?01:HI-UX/MPP:*:*)
143 echo hppa1.1-hitachi-hiuxmpp 179 echo hppa1.1-hitachi-hiuxmpp
144 exit 0;; 180 exit 0;;
145 Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) 181 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
146 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 182 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
147 if test "`(/bin/universe) 2>/dev/null`" = att ; then 183 if test "`(/bin/universe) 2>/dev/null`" = att ; then
148 echo pyramid-pyramid-sysv3 184 echo pyramid-pyramid-sysv3
@@ -150,7 +186,7 @@ EOF
150 echo pyramid-pyramid-bsd 186 echo pyramid-pyramid-bsd
151 fi 187 fi
152 exit 0 ;; 188 exit 0 ;;
153 NILE:*:*:dcosx) 189 NILE*:*:*:dcosx)
154 echo pyramid-pyramid-svr4 190 echo pyramid-pyramid-svr4
155 exit 0 ;; 191 exit 0 ;;
156 sun4H:SunOS:5.*:*) 192 sun4H:SunOS:5.*:*)
@@ -201,6 +237,32 @@ EOF
201 atari*:OpenBSD:*:*) 237 atari*:OpenBSD:*:*)
202 echo m68k-unknown-openbsd${UNAME_RELEASE} 238 echo m68k-unknown-openbsd${UNAME_RELEASE}
203 exit 0 ;; 239 exit 0 ;;
240 # The situation for MiNT is a little confusing. The machine name
241 # can be virtually everything (everything which is not
242 # "atarist" or "atariste" at least should have a processor
243 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
244 # to the lowercase version "mint" (or "freemint"). Finally
245 # the system name "TOS" denotes a system which is actually not
246 # MiNT. But MiNT is downward compatible to TOS, so this should
247 # be no problem.
248 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
249 echo m68k-atari-mint${UNAME_RELEASE}
250 exit 0 ;;
251 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
252 echo m68k-atari-mint${UNAME_RELEASE}
253 exit 0 ;;
254 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
255 echo m68k-atari-mint${UNAME_RELEASE}
256 exit 0 ;;
257 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
258 echo m68k-milan-mint${UNAME_RELEASE}
259 exit 0 ;;
260 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
261 echo m68k-hades-mint${UNAME_RELEASE}
262 exit 0 ;;
263 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
264 echo m68k-unknown-mint${UNAME_RELEASE}
265 exit 0 ;;
204 sun3*:NetBSD:*:*) 266 sun3*:NetBSD:*:*)
205 echo m68k-sun-netbsd${UNAME_RELEASE} 267 echo m68k-sun-netbsd${UNAME_RELEASE}
206 exit 0 ;; 268 exit 0 ;;
@@ -234,12 +296,16 @@ EOF
234 VAX*:ULTRIX*:*:*) 296 VAX*:ULTRIX*:*:*)
235 echo vax-dec-ultrix${UNAME_RELEASE} 297 echo vax-dec-ultrix${UNAME_RELEASE}
236 exit 0 ;; 298 exit 0 ;;
237 2020:CLIX:*:*) 299 2020:CLIX:*:* | 2430:CLIX:*:*)
238 echo clipper-intergraph-clix${UNAME_RELEASE} 300 echo clipper-intergraph-clix${UNAME_RELEASE}
239 exit 0 ;; 301 exit 0 ;;
240 mips:*:*:UMIPS | mips:*:*:RISCos) 302 mips:*:*:UMIPS | mips:*:*:RISCos)
241 sed 's/^ //' << EOF >dummy.c 303 sed 's/^ //' << EOF >$dummy.c
242 int main (argc, argv) int argc; char **argv; { 304#ifdef __cplusplus
305 int main (int argc, char *argv[]) {
306#else
307 int main (argc, argv) int argc; char *argv[]; {
308#endif
243 #if defined (host_mips) && defined (MIPSEB) 309 #if defined (host_mips) && defined (MIPSEB)
244 #if defined (SYSTYPE_SYSV) 310 #if defined (SYSTYPE_SYSV)
245 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 311 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -254,10 +320,10 @@ EOF
254 exit (-1); 320 exit (-1);
255 } 321 }
256EOF 322EOF
257 ${CC-cc} dummy.c -o dummy \ 323 $CC_FOR_BUILD $dummy.c -o $dummy \
258 && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ 324 && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
259 && rm dummy.c dummy && exit 0 325 && rm $dummy.c $dummy && exit 0
260 rm -f dummy.c dummy 326 rm -f $dummy.c $dummy
261 echo mips-mips-riscos${UNAME_RELEASE} 327 echo mips-mips-riscos${UNAME_RELEASE}
262 exit 0 ;; 328 exit 0 ;;
263 Night_Hawk:Power_UNIX:*:*) 329 Night_Hawk:Power_UNIX:*:*)
@@ -275,15 +341,18 @@ EOF
275 AViiON:dgux:*:*) 341 AViiON:dgux:*:*)
276 # DG/UX returns AViiON for all architectures 342 # DG/UX returns AViiON for all architectures
277 UNAME_PROCESSOR=`/usr/bin/uname -p` 343 UNAME_PROCESSOR=`/usr/bin/uname -p`
278 if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then 344 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
279 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ 345 then
280 -o ${TARGET_BINARY_INTERFACE}x = x ] ; then 346 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
347 [ ${TARGET_BINARY_INTERFACE}x = x ]
348 then
281 echo m88k-dg-dgux${UNAME_RELEASE} 349 echo m88k-dg-dgux${UNAME_RELEASE}
282 else 350 else
283 echo m88k-dg-dguxbcs${UNAME_RELEASE} 351 echo m88k-dg-dguxbcs${UNAME_RELEASE}
352 fi
353 else
354 echo i586-dg-dgux${UNAME_RELEASE}
284 fi 355 fi
285 else echo i586-dg-dgux${UNAME_RELEASE}
286 fi
287 exit 0 ;; 356 exit 0 ;;
288 M88*:DolphinOS:*:*) # DolphinOS (SVR3) 357 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
289 echo m88k-dolphin-sysv3 358 echo m88k-dolphin-sysv3
@@ -309,7 +378,7 @@ EOF
309 exit 0 ;; 378 exit 0 ;;
310 *:AIX:2:3) 379 *:AIX:2:3)
311 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 380 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
312 sed 's/^ //' << EOF >dummy.c 381 sed 's/^ //' << EOF >$dummy.c
313 #include <sys/systemcfg.h> 382 #include <sys/systemcfg.h>
314 383
315 main() 384 main()
@@ -320,8 +389,8 @@ EOF
320 exit(0); 389 exit(0);
321 } 390 }
322EOF 391EOF
323 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 392 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
324 rm -f dummy.c dummy 393 rm -f $dummy.c $dummy
325 echo rs6000-ibm-aix3.2.5 394 echo rs6000-ibm-aix3.2.5
326 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 395 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
327 echo rs6000-ibm-aix3.2.4 396 echo rs6000-ibm-aix3.2.4
@@ -368,25 +437,25 @@ EOF
368 case "${UNAME_MACHINE}" in 437 case "${UNAME_MACHINE}" in
369 9000/31? ) HP_ARCH=m68000 ;; 438 9000/31? ) HP_ARCH=m68000 ;;
370 9000/[34]?? ) HP_ARCH=m68k ;; 439 9000/[34]?? ) HP_ARCH=m68k ;;
371 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) 440 9000/[678][0-9][0-9])
372 sed 's/^ //' << EOF >dummy.c 441 sed 's/^ //' << EOF >$dummy.c
373 #include <stdlib.h> 442 #include <stdlib.h>
374 #include <unistd.h> 443 #include <unistd.h>
375 444
376 int main () 445 int main ()
377 { 446 {
378 #if defined(_SC_KERNEL_BITS) 447 #if defined(_SC_KERNEL_BITS)
379 long bits = sysconf(_SC_KERNEL_BITS); 448 long bits = sysconf(_SC_KERNEL_BITS);
380 #endif 449 #endif
381 long cpu = sysconf (_SC_CPU_VERSION); 450 long cpu = sysconf (_SC_CPU_VERSION);
382 451
383 switch (cpu) 452 switch (cpu)
384 { 453 {
385 case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 454 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
386 case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 455 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
387 case CPU_PA_RISC2_0: 456 case CPU_PA_RISC2_0:
388 #if defined(_SC_KERNEL_BITS) 457 #if defined(_SC_KERNEL_BITS)
389 switch (bits) 458 switch (bits)
390 { 459 {
391 case 64: puts ("hppa2.0w"); break; 460 case 64: puts ("hppa2.0w"); break;
392 case 32: puts ("hppa2.0n"); break; 461 case 32: puts ("hppa2.0n"); break;
@@ -394,20 +463,20 @@ EOF
394 } break; 463 } break;
395 #else /* !defined(_SC_KERNEL_BITS) */ 464 #else /* !defined(_SC_KERNEL_BITS) */
396 puts ("hppa2.0"); break; 465 puts ("hppa2.0"); break;
397 #endif 466 #endif
398 default: puts ("hppa1.0"); break; 467 default: puts ("hppa1.0"); break;
399 } 468 }
400 exit (0); 469 exit (0);
401 } 470 }
402EOF 471EOF
403 (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` 472 (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
404 rm -f dummy.c dummy 473 rm -f $dummy.c $dummy
405 esac 474 esac
406 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 475 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
407 echo ${HP_ARCH}-hp-hpux${HPUX_REV} 476 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
408 exit 0 ;; 477 exit 0 ;;
409 3050*:HI-UX:*:*) 478 3050*:HI-UX:*:*)
410 sed 's/^ //' << EOF >dummy.c 479 sed 's/^ //' << EOF >$dummy.c
411 #include <unistd.h> 480 #include <unistd.h>
412 int 481 int
413 main () 482 main ()
@@ -432,8 +501,8 @@ EOF
432 exit (0); 501 exit (0);
433 } 502 }
434EOF 503EOF
435 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 504 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
436 rm -f dummy.c dummy 505 rm -f $dummy.c $dummy
437 echo unknown-hitachi-hiuxwe2 506 echo unknown-hitachi-hiuxwe2
438 exit 0 ;; 507 exit 0 ;;
439 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 508 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,6 +511,9 @@ EOF
442 9000/8??:4.3bsd:*:*) 511 9000/8??:4.3bsd:*:*)
443 echo hppa1.0-hp-bsd 512 echo hppa1.0-hp-bsd
444 exit 0 ;; 513 exit 0 ;;
514 *9??*:MPE/iX:*:*)
515 echo hppa1.0-hp-mpeix
516 exit 0 ;;
445 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 517 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
446 echo hppa1.1-hp-osf 518 echo hppa1.1-hp-osf
447 exit 0 ;; 519 exit 0 ;;
@@ -458,6 +530,9 @@ EOF
458 parisc*:Lites*:*:*) 530 parisc*:Lites*:*:*)
459 echo hppa1.1-hp-lites 531 echo hppa1.1-hp-lites
460 exit 0 ;; 532 exit 0 ;;
533 hppa*:OpenBSD:*:*)
534 echo hppa-unknown-openbsd
535 exit 0 ;;
461 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 536 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
462 echo c1-convex-bsd 537 echo c1-convex-bsd
463 exit 0 ;; 538 exit 0 ;;
@@ -490,11 +565,14 @@ EOF
490 CRAY*TS:*:*:*) 565 CRAY*TS:*:*:*)
491 echo t90-cray-unicos${UNAME_RELEASE} 566 echo t90-cray-unicos${UNAME_RELEASE}
492 exit 0 ;; 567 exit 0 ;;
568 CRAY*T3E:*:*:*)
569 echo alpha-cray-unicosmk${UNAME_RELEASE}
570 exit 0 ;;
493 CRAY-2:*:*:*) 571 CRAY-2:*:*:*)
494 echo cray2-cray-unicos 572 echo cray2-cray-unicos
495 exit 0 ;; 573 exit 0 ;;
496 F300:UNIX_System_V:*:*) 574 F300:UNIX_System_V:*:*)
497 FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` 575 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
498 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 576 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
499 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 577 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
500 exit 0 ;; 578 exit 0 ;;
@@ -507,17 +585,26 @@ EOF
507 hp300:OpenBSD:*:*) 585 hp300:OpenBSD:*:*)
508 echo m68k-unknown-openbsd${UNAME_RELEASE} 586 echo m68k-unknown-openbsd${UNAME_RELEASE}
509 exit 0 ;; 587 exit 0 ;;
588 i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
589 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
590 exit 0 ;;
510 sparc*:BSD/OS:*:*) 591 sparc*:BSD/OS:*:*)
511 echo sparc-unknown-bsdi${UNAME_RELEASE} 592 echo sparc-unknown-bsdi${UNAME_RELEASE}
512 exit 0 ;; 593 exit 0 ;;
513 i?86:BSD/386:*:* | *:BSD/OS:*:*) 594 *:BSD/OS:*:*)
514 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 595 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
515 exit 0 ;; 596 exit 0 ;;
516 *:FreeBSD:*:*) 597 *:FreeBSD:*:*)
598 if test -x /usr/bin/objformat; then
599 if test "elf" = "`/usr/bin/objformat`"; then
600 echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
601 exit 0
602 fi
603 fi
517 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 604 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
518 exit 0 ;; 605 exit 0 ;;
519 *:NetBSD:*:*) 606 *:NetBSD:*:*)
520 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 607 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
521 exit 0 ;; 608 exit 0 ;;
522 *:OpenBSD:*:*) 609 *:OpenBSD:*:*)
523 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 610 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
@@ -528,6 +615,15 @@ EOF
528 i*:MINGW*:*) 615 i*:MINGW*:*)
529 echo ${UNAME_MACHINE}-pc-mingw32 616 echo ${UNAME_MACHINE}-pc-mingw32
530 exit 0 ;; 617 exit 0 ;;
618 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
619 # How do we know it's Interix rather than the generic POSIX subsystem?
620 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
621 # UNAME_MACHINE based on the output of uname instead of i386?
622 echo i386-pc-interix
623 exit 0 ;;
624 i*:UWIN*:*)
625 echo ${UNAME_MACHINE}-pc-uwin
626 exit 0 ;;
531 p*:CYGWIN*:*) 627 p*:CYGWIN*:*)
532 echo powerpcle-unknown-cygwin 628 echo powerpcle-unknown-cygwin
533 exit 0 ;; 629 exit 0 ;;
@@ -538,15 +634,11 @@ EOF
538 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 634 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
539 exit 0 ;; 635 exit 0 ;;
540 *:Linux:*:*) 636 *:Linux:*:*)
541 # uname on the ARM produces all sorts of strangeness, and we need to
542 # filter it out.
543 case "$UNAME_MACHINE" in
544 arm* | sa110*) UNAME_MACHINE="arm" ;;
545 esac
546 637
547 # The BFD linker knows what the default object file format is, so 638 # The BFD linker knows what the default object file format is, so
548 # first see if it will tell us. 639 # first see if it will tell us. cd to the root directory to prevent
549 ld_help_string=`ld --help 2>&1` 640 # problems with other programs or directories called `ld' in the path.
641 ld_help_string=`cd /; ld --help 2>&1`
550 ld_supported_emulations=`echo $ld_help_string \ 642 ld_supported_emulations=`echo $ld_help_string \
551 | sed -ne '/supported emulations:/!d 643 | sed -ne '/supported emulations:/!d
552 s/[ ][ ]*/ /g 644 s/[ ][ ]*/ /g
@@ -554,68 +646,137 @@ EOF
554 s/ .*// 646 s/ .*//
555 p'` 647 p'`
556 case "$ld_supported_emulations" in 648 case "$ld_supported_emulations" in
557 i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; 649 *ia64)
558 i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; 650 echo "${UNAME_MACHINE}-unknown-linux"
559 sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 651 exit 0
560 armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 652 ;;
561 m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 653 i?86linux)
562 elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; 654 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
655 exit 0
656 ;;
657 i?86coff)
658 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
659 exit 0
660 ;;
661 sparclinux)
662 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
663 exit 0
664 ;;
665 armlinux)
666 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
667 exit 0
668 ;;
669 elf32arm*)
670 echo "${UNAME_MACHINE}-unknown-linux-gnu"
671 exit 0
672 ;;
673 armelf_linux*)
674 echo "${UNAME_MACHINE}-unknown-linux-gnu"
675 exit 0
676 ;;
677 m68klinux)
678 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
679 exit 0
680 ;;
681 elf32ppc)
682 # Determine Lib Version
683 cat >$dummy.c <<EOF
684#include <features.h>
685#if defined(__GLIBC__)
686extern char __libc_version[];
687extern char __libc_release[];
688#endif
689main(argc, argv)
690 int argc;
691 char *argv[];
692{
693#if defined(__GLIBC__)
694 printf("%s %s\n", __libc_version, __libc_release);
695#else
696 printf("unkown\n");
697#endif
698 return 0;
699}
700EOF
701 LIBC=""
702 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
703 if test "$?" = 0 ; then
704 ./$dummy | grep 1\.99 > /dev/null
705 if test "$?" = 0 ; then
706 LIBC="libc1"
707 fi
708 fi
709 rm -f $dummy.c $dummy
710 echo powerpc-unknown-linux-gnu${LIBC}
711 exit 0
712 ;;
563 esac 713 esac
564 714
565 if test "${UNAME_MACHINE}" = "alpha" ; then 715 if test "${UNAME_MACHINE}" = "alpha" ; then
566 sed 's/^ //' <<EOF >dummy.s 716 cat <<EOF >$dummy.s
567 .globl main 717 .data
568 .ent main 718 \$Lformat:
569 main: 719 .byte 37,100,45,37,120,10,0 # "%d-%x\n"
570 .frame \$30,0,\$26,0 720
571 .prologue 0 721 .text
572 .long 0x47e03d80 # implver $0 722 .globl main
573 lda \$2,259 723 .align 4
574 .long 0x47e20c21 # amask $2,$1 724 .ent main
575 srl \$1,8,\$2 725 main:
576 sll \$2,2,\$2 726 .frame \$30,16,\$26,0
577 sll \$0,3,\$0 727 ldgp \$29,0(\$27)
578 addl \$1,\$0,\$0 728 .prologue 1
579 addl \$2,\$0,\$0 729 .long 0x47e03d80 # implver \$0
580 ret \$31,(\$26),1 730 lda \$2,-1
581 .end main 731 .long 0x47e20c21 # amask \$2,\$1
732 lda \$16,\$Lformat
733 mov \$0,\$17
734 not \$1,\$18
735 jsr \$26,printf
736 ldgp \$29,0(\$26)
737 mov 0,\$16
738 jsr \$26,exit
739 .end main
582EOF 740EOF
583 LIBC="" 741 LIBC=""
584 ${CC-cc} dummy.s -o dummy 2>/dev/null 742 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
585 if test "$?" = 0 ; then 743 if test "$?" = 0 ; then
586 ./dummy 744 case `./$dummy` in
587 case "$?" in 745 0-0)
588 7)
589 UNAME_MACHINE="alpha" 746 UNAME_MACHINE="alpha"
590 ;; 747 ;;
591 15) 748 1-0)
592 UNAME_MACHINE="alphaev5" 749 UNAME_MACHINE="alphaev5"
593 ;; 750 ;;
594 14) 751 1-1)
595 UNAME_MACHINE="alphaev56" 752 UNAME_MACHINE="alphaev56"
596 ;; 753 ;;
597 10) 754 1-101)
598 UNAME_MACHINE="alphapca56" 755 UNAME_MACHINE="alphapca56"
599 ;; 756 ;;
600 16) 757 2-303)
601 UNAME_MACHINE="alphaev6" 758 UNAME_MACHINE="alphaev6"
602 ;; 759 ;;
603 esac 760 2-307)
761 UNAME_MACHINE="alphaev67"
762 ;;
763 esac
604 764
605 objdump --private-headers dummy | \ 765 objdump --private-headers $dummy | \
606 grep ld.so.1 > /dev/null 766 grep ld.so.1 > /dev/null
607 if test "$?" = 0 ; then 767 if test "$?" = 0 ; then
608 LIBC="libc1" 768 LIBC="libc1"
609 fi 769 fi
610 fi 770 fi
611 rm -f dummy.s dummy 771 rm -f $dummy.s $dummy
612 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 772 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
613 elif test "${UNAME_MACHINE}" = "mips" ; then 773 elif test "${UNAME_MACHINE}" = "mips" ; then
614 cat >dummy.c <<EOF 774 cat >$dummy.c <<EOF
615main(argc, argv) 775#ifdef __cplusplus
616 int argc; 776 int main (int argc, char *argv[]) {
617 char *argv[]; 777#else
618{ 778 int main (argc, argv) int argc; char *argv[]; {
779#endif
619#ifdef __MIPSEB__ 780#ifdef __MIPSEB__
620 printf ("%s-unknown-linux-gnu\n", argv[1]); 781 printf ("%s-unknown-linux-gnu\n", argv[1]);
621#endif 782#endif
@@ -625,8 +786,8 @@ main(argc, argv)
625 return 0; 786 return 0;
626} 787}
627EOF 788EOF
628 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 789 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
629 rm -f dummy.c dummy 790 rm -f $dummy.c $dummy
630 else 791 else
631 # Either a pre-BFD a.out linker (linux-gnuoldld) 792 # Either a pre-BFD a.out linker (linux-gnuoldld)
632 # or one that does not give us useful --help. 793 # or one that does not give us useful --help.
@@ -645,12 +806,13 @@ EOF
645 ;; 806 ;;
646 esac 807 esac
647 # Determine whether the default compiler is a.out or elf 808 # Determine whether the default compiler is a.out or elf
648 cat >dummy.c <<EOF 809 cat >$dummy.c <<EOF
649#include <features.h> 810#include <features.h>
650main(argc, argv) 811#ifdef __cplusplus
651 int argc; 812 int main (int argc, char *argv[]) {
652 char *argv[]; 813#else
653{ 814 int main (argc, argv) int argc; char *argv[]; {
815#endif
654#ifdef __ELF__ 816#ifdef __ELF__
655# ifdef __GLIBC__ 817# ifdef __GLIBC__
656# if __GLIBC__ >= 2 818# if __GLIBC__ >= 2
@@ -667,8 +829,8 @@ main(argc, argv)
667 return 0; 829 return 0;
668} 830}
669EOF 831EOF
670 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 832 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
671 rm -f dummy.c dummy 833 rm -f $dummy.c $dummy
672 fi ;; 834 fi ;;
673# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions 835# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
674# are messed up and put the nodename in both sysname and nodename. 836# are messed up and put the nodename in both sysname and nodename.
@@ -684,10 +846,20 @@ EOF
684 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 846 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
685 exit 0 ;; 847 exit 0 ;;
686 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) 848 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
849 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
687 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 850 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
688 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} 851 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
852 else
853 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
854 fi
855 exit 0 ;;
856 i?86:*:5:7*)
857 # Fixed at (any) Pentium or better
858 UNAME_MACHINE=i586
859 if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
860 echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
689 else 861 else
690 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} 862 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
691 fi 863 fi
692 exit 0 ;; 864 exit 0 ;;
693 i?86:*:3.2:*) 865 i?86:*:3.2:*)
@@ -699,18 +871,15 @@ EOF
699 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 871 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
700 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ 872 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
701 && UNAME_MACHINE=i586 873 && UNAME_MACHINE=i586
874 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
875 && UNAME_MACHINE=i686
876 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
877 && UNAME_MACHINE=i686
702 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 878 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
703 else 879 else
704 echo ${UNAME_MACHINE}-pc-sysv32 880 echo ${UNAME_MACHINE}-pc-sysv32
705 fi 881 fi
706 exit 0 ;; 882 exit 0 ;;
707 i?86:UnixWare:*:*)
708 if /bin/uname -X 2>/dev/null >/dev/null ; then
709 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
710 && UNAME_MACHINE=i586
711 fi
712 echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
713 exit 0 ;;
714 pc:*:*:*) 883 pc:*:*:*)
715 # uname -m prints for DJGPP always 'pc', but it prints nothing about 884 # uname -m prints for DJGPP always 'pc', but it prints nothing about
716 # the processor, so we play safe by assuming i386. 885 # the processor, so we play safe by assuming i386.
@@ -752,7 +921,7 @@ EOF
752 mc68030:UNIX_System_V:4.*:*) 921 mc68030:UNIX_System_V:4.*:*)
753 echo m68k-atari-sysv4 922 echo m68k-atari-sysv4
754 exit 0 ;; 923 exit 0 ;;
755 i?86:LynxOS:2.*:*) 924 i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
756 echo i386-unknown-lynxos${UNAME_RELEASE} 925 echo i386-unknown-lynxos${UNAME_RELEASE}
757 exit 0 ;; 926 exit 0 ;;
758 TSUNAMI:LynxOS:2.*:*) 927 TSUNAMI:LynxOS:2.*:*)
@@ -764,6 +933,9 @@ EOF
764 SM[BE]S:UNIX_SV:*:*) 933 SM[BE]S:UNIX_SV:*:*)
765 echo mips-dde-sysv${UNAME_RELEASE} 934 echo mips-dde-sysv${UNAME_RELEASE}
766 exit 0 ;; 935 exit 0 ;;
936 RM*:ReliantUNIX-*:*:*)
937 echo mips-sni-sysv4
938 exit 0 ;;
767 RM*:SINIX-*:*:*) 939 RM*:SINIX-*:*:*)
768 echo mips-sni-sysv4 940 echo mips-sni-sysv4
769 exit 0 ;; 941 exit 0 ;;
@@ -794,7 +966,7 @@ EOF
794 news*:NEWS-OS:*:6*) 966 news*:NEWS-OS:*:6*)
795 echo mips-sony-newsos6 967 echo mips-sony-newsos6
796 exit 0 ;; 968 exit 0 ;;
797 R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) 969 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
798 if [ -d /usr/nec ]; then 970 if [ -d /usr/nec ]; then
799 echo mips-nec-sysv${UNAME_RELEASE} 971 echo mips-nec-sysv${UNAME_RELEASE}
800 else 972 else
@@ -810,12 +982,27 @@ EOF
810 BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 982 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
811 echo i586-pc-beos 983 echo i586-pc-beos
812 exit 0 ;; 984 exit 0 ;;
985 SX-4:SUPER-UX:*:*)
986 echo sx4-nec-superux${UNAME_RELEASE}
987 exit 0 ;;
988 SX-5:SUPER-UX:*:*)
989 echo sx5-nec-superux${UNAME_RELEASE}
990 exit 0 ;;
991 Power*:Rhapsody:*:*)
992 echo powerpc-apple-rhapsody${UNAME_RELEASE}
993 exit 0 ;;
994 *:Rhapsody:*:*)
995 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
996 exit 0 ;;
997 *:QNX:*:4*)
998 echo i386-qnx-qnx${UNAME_VERSION}
999 exit 0 ;;
813esac 1000esac
814 1001
815#echo '(No uname command or uname output not recognized.)' 1>&2 1002#echo '(No uname command or uname output not recognized.)' 1>&2
816#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1003#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
817 1004
818cat >dummy.c <<EOF 1005cat >$dummy.c <<EOF
819#ifdef _SEQUENT_ 1006#ifdef _SEQUENT_
820# include <sys/types.h> 1007# include <sys/types.h>
821# include <sys/utsname.h> 1008# include <sys/utsname.h>
@@ -853,7 +1040,10 @@ main ()
853#endif 1040#endif
854 int version; 1041 int version;
855 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1042 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
856 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1043 if (version < 4)
1044 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1045 else
1046 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
857 exit (0); 1047 exit (0);
858#endif 1048#endif
859 1049
@@ -913,8 +1103,8 @@ main ()
913} 1103}
914EOF 1104EOF
915 1105
916${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 1106$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
917rm -f dummy.c dummy 1107rm -f $dummy.c $dummy
918 1108
919# Apollos put the system type in the environment. 1109# Apollos put the system type in the environment.
920 1110