summaryrefslogtreecommitdiff
path: root/config.guess
diff options
context:
space:
mode:
Diffstat (limited to 'config.guess')
-rwxr-xr-xconfig.guess438
1 files changed, 197 insertions, 241 deletions
diff --git a/config.guess b/config.guess
index ba6616516..83c544d97 100755
--- a/config.guess
+++ b/config.guess
@@ -1,9 +1,9 @@
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, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# Free Software Foundation, Inc. 4# 2000, 2001, 2002 Free Software Foundation, Inc.
5 5
6timestamp='2001-04-20' 6timestamp='2002-01-30'
7 7
8# This file is free software; you can redistribute it and/or modify it 8# This file is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by 9# under the terms of the GNU General Public License as published by
@@ -24,8 +24,9 @@ timestamp='2001-04-20'
24# configuration script generated by Autoconf, you may include it under 24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program. 25# the same distribution terms that you use for the rest of that program.
26 26
27# Written by Per Bothner <bothner@cygnus.com>. 27# Originally written by Per Bothner <per@bothner.com>.
28# Please send patches to <config-patches@gnu.org>. 28# Please send patches to <config-patches@gnu.org>. Submit a context
29# diff and a properly formatted ChangeLog entry.
29# 30#
30# This script attempts to guess a canonical system name similar to 31# This script attempts to guess a canonical system name similar to
31# config.sub. If it succeeds, it prints the system name on stdout, and 32# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -52,7 +53,7 @@ version="\
52GNU config.guess ($timestamp) 53GNU config.guess ($timestamp)
53 54
54Originally written by Per Bothner. 55Originally written by Per Bothner.
55Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 56Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
56Free Software Foundation, Inc. 57Free Software Foundation, Inc.
57 58
58This is free software; see the source for copying conditions. There is NO 59This is free software; see the source for copying conditions. There is NO
@@ -95,25 +96,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
95# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 96# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
96# use `HOST_CC' if defined, but it is deprecated. 97# use `HOST_CC' if defined, but it is deprecated.
97 98
98case $CC_FOR_BUILD,$HOST_CC,$CC in 99set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
99 ,,) echo "int dummy(){}" > $dummy.c 100 ,,) echo "int dummy(){}" > $dummy.c ;
100 for c in cc gcc c89 ; do 101 for c in cc gcc c89 ; do
101 ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 102 ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
102 if test $? = 0 ; then 103 if test $? = 0 ; then
103 CC_FOR_BUILD="$c"; break 104 CC_FOR_BUILD="$c"; break ;
104 fi 105 fi ;
105 done 106 done ;
106 rm -f $dummy.c $dummy.o $dummy.rel 107 rm -f $dummy.c $dummy.o $dummy.rel ;
107 if test x"$CC_FOR_BUILD" = x ; then 108 if test x"$CC_FOR_BUILD" = x ; then
108 CC_FOR_BUILD=no_compiler_found 109 CC_FOR_BUILD=no_compiler_found ;
109 fi 110 fi
110 ;; 111 ;;
111 ,,*) CC_FOR_BUILD=$CC ;; 112 ,,*) CC_FOR_BUILD=$CC ;;
112 ,*,*) CC_FOR_BUILD=$HOST_CC ;; 113 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
113esac 114esac'
114 115
115# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 116# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
116# (ghazi@noc.rutgers.edu 8/24/94.) 117# (ghazi@noc.rutgers.edu 1994-08-24)
117if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 118if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
118 PATH=$PATH:/.attbin ; export PATH 119 PATH=$PATH:/.attbin ; export PATH
119fi 120fi
@@ -127,29 +128,29 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
127 128
128case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 129case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
129 *:NetBSD:*:*) 130 *:NetBSD:*:*)
130 # Netbsd (nbsd) targets should (where applicable) match one or 131 # NetBSD (nbsd) targets should (where applicable) match one or
131 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 132 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
132 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 133 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
133 # switched to ELF, *-*-netbsd* would select the old 134 # switched to ELF, *-*-netbsd* would select the old
134 # object file format. This provides both forward 135 # object file format. This provides both forward
135 # compatibility and a consistent mechanism for selecting the 136 # compatibility and a consistent mechanism for selecting the
136 # object file format. 137 # object file format.
137 # Determine the machine/vendor (is the vendor relevant). 138 #
138 case "${UNAME_MACHINE}" in 139 # Note: NetBSD doesn't particularly care about the vendor
139 amiga) machine=m68k-unknown ;; 140 # portion of the name. We always set it to "unknown".
140 arm32) machine=arm-unknown ;; 141 UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
141 atari*) machine=m68k-atari ;; 142 UNAME_MACHINE_ARCH=unknown
142 sun3*) machine=m68k-sun ;; 143 case "${UNAME_MACHINE_ARCH}" in
143 mac68k) machine=m68k-apple ;; 144 arm*) machine=arm-unknown ;;
144 macppc) machine=powerpc-apple ;; 145 sh3el) machine=shl-unknown ;;
145 hp3[0-9][05]) machine=m68k-hp ;; 146 sh3eb) machine=sh-unknown ;;
146 ibmrt|romp-ibm) machine=romp-ibm ;; 147 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
147 *) machine=${UNAME_MACHINE}-unknown ;;
148 esac 148 esac
149 # The Operating System including object format, if it has switched 149 # The Operating System including object format, if it has switched
150 # to ELF recently, or will in the future. 150 # to ELF recently, or will in the future.
151 case "${UNAME_MACHINE}" in 151 case "${UNAME_MACHINE_ARCH}" in
152 i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) 152 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
153 eval $set_cc_for_build
153 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 154 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
154 | grep __ELF__ >/dev/null 155 | grep __ELF__ >/dev/null
155 then 156 then
@@ -171,6 +172,45 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
171 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 172 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
172 echo "${machine}-${os}${release}" 173 echo "${machine}-${os}${release}"
173 exit 0 ;; 174 exit 0 ;;
175 amiga:OpenBSD:*:*)
176 echo m68k-unknown-openbsd${UNAME_RELEASE}
177 exit 0 ;;
178 arc:OpenBSD:*:*)
179 echo mipsel-unknown-openbsd${UNAME_RELEASE}
180 exit 0 ;;
181 hp300:OpenBSD:*:*)
182 echo m68k-unknown-openbsd${UNAME_RELEASE}
183 exit 0 ;;
184 mac68k:OpenBSD:*:*)
185 echo m68k-unknown-openbsd${UNAME_RELEASE}
186 exit 0 ;;
187 macppc:OpenBSD:*:*)
188 echo powerpc-unknown-openbsd${UNAME_RELEASE}
189 exit 0 ;;
190 mvme68k:OpenBSD:*:*)
191 echo m68k-unknown-openbsd${UNAME_RELEASE}
192 exit 0 ;;
193 mvme88k:OpenBSD:*:*)
194 echo m88k-unknown-openbsd${UNAME_RELEASE}
195 exit 0 ;;
196 mvmeppc:OpenBSD:*:*)
197 echo powerpc-unknown-openbsd${UNAME_RELEASE}
198 exit 0 ;;
199 pmax:OpenBSD:*:*)
200 echo mipsel-unknown-openbsd${UNAME_RELEASE}
201 exit 0 ;;
202 sgi:OpenBSD:*:*)
203 echo mipseb-unknown-openbsd${UNAME_RELEASE}
204 exit 0 ;;
205 sun3:OpenBSD:*:*)
206 echo m68k-unknown-openbsd${UNAME_RELEASE}
207 exit 0 ;;
208 wgrisc:OpenBSD:*:*)
209 echo mipsel-unknown-openbsd${UNAME_RELEASE}
210 exit 0 ;;
211 *:OpenBSD:*:*)
212 echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
213 exit 0 ;;
174 alpha:OSF1:*:*) 214 alpha:OSF1:*:*)
175 if test $UNAME_RELEASE = "V4.0"; then 215 if test $UNAME_RELEASE = "V4.0"; then
176 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 216 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -204,6 +244,7 @@ main:
204 jsr \$26,exit 244 jsr \$26,exit
205 .end main 245 .end main
206EOF 246EOF
247 eval $set_cc_for_build
207 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null 248 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
208 if test "$?" = 0 ; then 249 if test "$?" = 0 ; then
209 case `./$dummy` in 250 case `./$dummy` in
@@ -225,6 +266,9 @@ EOF
225 2-307) 266 2-307)
226 UNAME_MACHINE="alphaev67" 267 UNAME_MACHINE="alphaev67"
227 ;; 268 ;;
269 2-1307)
270 UNAME_MACHINE="alphaev68"
271 ;;
228 esac 272 esac
229 fi 273 fi
230 rm -f $dummy.s $dummy 274 rm -f $dummy.s $dummy
@@ -242,29 +286,11 @@ EOF
242 Amiga*:UNIX_System_V:4.0:*) 286 Amiga*:UNIX_System_V:4.0:*)
243 echo m68k-unknown-sysv4 287 echo m68k-unknown-sysv4
244 exit 0;; 288 exit 0;;
245 amiga:OpenBSD:*:*)
246 echo m68k-unknown-openbsd${UNAME_RELEASE}
247 exit 0 ;;
248 *:[Aa]miga[Oo][Ss]:*:*) 289 *:[Aa]miga[Oo][Ss]:*:*)
249 echo ${UNAME_MACHINE}-unknown-amigaos 290 echo ${UNAME_MACHINE}-unknown-amigaos
250 exit 0 ;; 291 exit 0 ;;
251 arc64:OpenBSD:*:*) 292 *:[Mm]orph[Oo][Ss]:*:*)
252 echo mips64el-unknown-openbsd${UNAME_RELEASE} 293 echo ${UNAME_MACHINE}-unknown-morphos
253 exit 0 ;;
254 arc:OpenBSD:*:*)
255 echo mipsel-unknown-openbsd${UNAME_RELEASE}
256 exit 0 ;;
257 hkmips:OpenBSD:*:*)
258 echo mips-unknown-openbsd${UNAME_RELEASE}
259 exit 0 ;;
260 pmax:OpenBSD:*:*)
261 echo mipsel-unknown-openbsd${UNAME_RELEASE}
262 exit 0 ;;
263 sgi:OpenBSD:*:*)
264 echo mips-unknown-openbsd${UNAME_RELEASE}
265 exit 0 ;;
266 wgrisc:OpenBSD:*:*)
267 echo mipsel-unknown-openbsd${UNAME_RELEASE}
268 exit 0 ;; 294 exit 0 ;;
269 *:OS/390:*:*) 295 *:OS/390:*:*)
270 echo i370-ibm-openedition 296 echo i370-ibm-openedition
@@ -328,9 +354,6 @@ EOF
328 aushp:SunOS:*:*) 354 aushp:SunOS:*:*)
329 echo sparc-auspex-sunos${UNAME_RELEASE} 355 echo sparc-auspex-sunos${UNAME_RELEASE}
330 exit 0 ;; 356 exit 0 ;;
331 atari*:OpenBSD:*:*)
332 echo m68k-unknown-openbsd${UNAME_RELEASE}
333 exit 0 ;;
334 # The situation for MiNT is a little confusing. The machine name 357 # The situation for MiNT is a little confusing. The machine name
335 # can be virtually everything (everything which is not 358 # can be virtually everything (everything which is not
336 # "atarist" or "atariste" at least should have a processor 359 # "atarist" or "atariste" at least should have a processor
@@ -357,18 +380,6 @@ EOF
357 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 380 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
358 echo m68k-unknown-mint${UNAME_RELEASE} 381 echo m68k-unknown-mint${UNAME_RELEASE}
359 exit 0 ;; 382 exit 0 ;;
360 sun3*:OpenBSD:*:*)
361 echo m68k-unknown-openbsd${UNAME_RELEASE}
362 exit 0 ;;
363 mac68k:OpenBSD:*:*)
364 echo m68k-unknown-openbsd${UNAME_RELEASE}
365 exit 0 ;;
366 mvme68k:OpenBSD:*:*)
367 echo m68k-unknown-openbsd${UNAME_RELEASE}
368 exit 0 ;;
369 mvme88k:OpenBSD:*:*)
370 echo m88k-unknown-openbsd${UNAME_RELEASE}
371 exit 0 ;;
372 powerpc:machten:*:*) 383 powerpc:machten:*:*)
373 echo powerpc-apple-machten${UNAME_RELEASE} 384 echo powerpc-apple-machten${UNAME_RELEASE}
374 exit 0 ;; 385 exit 0 ;;
@@ -385,6 +396,7 @@ EOF
385 echo clipper-intergraph-clix${UNAME_RELEASE} 396 echo clipper-intergraph-clix${UNAME_RELEASE}
386 exit 0 ;; 397 exit 0 ;;
387 mips:*:*:UMIPS | mips:*:*:RISCos) 398 mips:*:*:UMIPS | mips:*:*:RISCos)
399 eval $set_cc_for_build
388 sed 's/^ //' << EOF >$dummy.c 400 sed 's/^ //' << EOF >$dummy.c
389#ifdef __cplusplus 401#ifdef __cplusplus
390#include <stdio.h> /* for printf() prototype */ 402#include <stdio.h> /* for printf() prototype */
@@ -475,6 +487,7 @@ EOF
475 exit 0 ;; 487 exit 0 ;;
476 *:AIX:2:3) 488 *:AIX:2:3)
477 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 489 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
490 eval $set_cc_for_build
478 sed 's/^ //' << EOF >$dummy.c 491 sed 's/^ //' << EOF >$dummy.c
479 #include <sys/systemcfg.h> 492 #include <sys/systemcfg.h>
480 493
@@ -536,10 +549,8 @@ EOF
536 9000/31? ) HP_ARCH=m68000 ;; 549 9000/31? ) HP_ARCH=m68000 ;;
537 9000/[34]?? ) HP_ARCH=m68k ;; 550 9000/[34]?? ) HP_ARCH=m68k ;;
538 9000/[678][0-9][0-9]) 551 9000/[678][0-9][0-9])
539 case "${HPUX_REV}" in 552 if [ -x /usr/bin/getconf ]; then
540 11.[0-9][0-9]) 553 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
541 if [ -x /usr/bin/getconf ]; then
542 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
543 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 554 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
544 case "${sc_cpu_version}" in 555 case "${sc_cpu_version}" in
545 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 556 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
@@ -548,12 +559,13 @@ EOF
548 case "${sc_kernel_bits}" in 559 case "${sc_kernel_bits}" in
549 32) HP_ARCH="hppa2.0n" ;; 560 32) HP_ARCH="hppa2.0n" ;;
550 64) HP_ARCH="hppa2.0w" ;; 561 64) HP_ARCH="hppa2.0w" ;;
562 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
551 esac ;; 563 esac ;;
552 esac 564 esac
553 fi ;; 565 fi
554 esac 566 if [ "${HP_ARCH}" = "" ]; then
555 if [ "${HP_ARCH}" = "" ]; then 567 eval $set_cc_for_build
556 sed 's/^ //' << EOF >$dummy.c 568 sed 's/^ //' << EOF >$dummy.c
557 569
558 #define _HPUX_SOURCE 570 #define _HPUX_SOURCE
559 #include <stdlib.h> 571 #include <stdlib.h>
@@ -586,10 +598,10 @@ EOF
586 exit (0); 598 exit (0);
587 } 599 }
588EOF 600EOF
589 (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` 601 (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
590 if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi 602 if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
591 rm -f $dummy.c $dummy 603 rm -f $dummy.c $dummy
592 fi ;; 604 fi ;;
593 esac 605 esac
594 echo ${HP_ARCH}-hp-hpux${HPUX_REV} 606 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
595 exit 0 ;; 607 exit 0 ;;
@@ -598,6 +610,7 @@ EOF
598 echo ia64-hp-hpux${HPUX_REV} 610 echo ia64-hp-hpux${HPUX_REV}
599 exit 0 ;; 611 exit 0 ;;
600 3050*:HI-UX:*:*) 612 3050*:HI-UX:*:*)
613 eval $set_cc_for_build
601 sed 's/^ //' << EOF >$dummy.c 614 sed 's/^ //' << EOF >$dummy.c
602 #include <unistd.h> 615 #include <unistd.h>
603 int 616 int
@@ -633,7 +646,7 @@ EOF
633 9000/8??:4.3bsd:*:*) 646 9000/8??:4.3bsd:*:*)
634 echo hppa1.0-hp-bsd 647 echo hppa1.0-hp-bsd
635 exit 0 ;; 648 exit 0 ;;
636 *9??*:MPE/iX:*:*) 649 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
637 echo hppa1.0-hp-mpeix 650 echo hppa1.0-hp-mpeix
638 exit 0 ;; 651 exit 0 ;;
639 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 652 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
@@ -652,9 +665,6 @@ EOF
652 parisc*:Lites*:*:*) 665 parisc*:Lites*:*:*)
653 echo hppa1.1-hp-lites 666 echo hppa1.1-hp-lites
654 exit 0 ;; 667 exit 0 ;;
655 hppa*:OpenBSD:*:*)
656 echo hppa-unknown-openbsd
657 exit 0 ;;
658 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 668 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
659 echo c1-convex-bsd 669 echo c1-convex-bsd
660 exit 0 ;; 670 exit 0 ;;
@@ -677,12 +687,13 @@ EOF
677 echo xmp-cray-unicos 687 echo xmp-cray-unicos
678 exit 0 ;; 688 exit 0 ;;
679 CRAY*Y-MP:*:*:*) 689 CRAY*Y-MP:*:*:*)
680 echo ymp-cray-unicos${UNAME_RELEASE} 690 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
681 exit 0 ;; 691 exit 0 ;;
682 CRAY*[A-Z]90:*:*:*) 692 CRAY*[A-Z]90:*:*:*)
683 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 693 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
684 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 694 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
685 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ 695 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
696 -e 's/\.[^.]*$/.X/'
686 exit 0 ;; 697 exit 0 ;;
687 CRAY*TS:*:*:*) 698 CRAY*TS:*:*:*)
688 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 699 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
@@ -705,9 +716,6 @@ EOF
705 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 716 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
706 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 717 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
707 exit 0 ;; 718 exit 0 ;;
708 hp300:OpenBSD:*:*)
709 echo m68k-unknown-openbsd${UNAME_RELEASE}
710 exit 0 ;;
711 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 719 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
712 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 720 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
713 exit 0 ;; 721 exit 0 ;;
@@ -720,9 +728,6 @@ EOF
720 *:FreeBSD:*:*) 728 *:FreeBSD:*:*)
721 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 729 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
722 exit 0 ;; 730 exit 0 ;;
723 *:OpenBSD:*:*)
724 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
725 exit 0 ;;
726 i*:CYGWIN*:*) 731 i*:CYGWIN*:*)
727 echo ${UNAME_MACHINE}-pc-cygwin 732 echo ${UNAME_MACHINE}-pc-cygwin
728 exit 0 ;; 733 exit 0 ;;
@@ -732,6 +737,9 @@ EOF
732 i*:PW*:*) 737 i*:PW*:*)
733 echo ${UNAME_MACHINE}-pc-pw32 738 echo ${UNAME_MACHINE}-pc-pw32
734 exit 0 ;; 739 exit 0 ;;
740 x86:Interix*:3*)
741 echo i386-pc-interix3
742 exit 0 ;;
735 i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 743 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
736 # How do we know it's Interix rather than the generic POSIX subsystem? 744 # How do we know it's Interix rather than the generic POSIX subsystem?
737 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 745 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -763,97 +771,43 @@ EOF
763 echo ${UNAME_MACHINE}-unknown-linux-gnu 771 echo ${UNAME_MACHINE}-unknown-linux-gnu
764 exit 0 ;; 772 exit 0 ;;
765 mips:Linux:*:*) 773 mips:Linux:*:*)
766 cat >$dummy.c <<EOF 774 eval $set_cc_for_build
767#ifdef __cplusplus 775 sed 's/^ //' << EOF >$dummy.c
768#include <stdio.h> /* for printf() prototype */ 776 #undef CPU
769int main (int argc, char *argv[]) { 777 #undef mips
770#else 778 #undef mipsel
771int main (argc, argv) int argc; char *argv[]; { 779 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
772#endif 780 CPU=mipsel
773#ifdef __MIPSEB__ 781 #else
774 printf ("%s-unknown-linux-gnu\n", argv[1]); 782 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
775#endif 783 CPU=mips
776#ifdef __MIPSEL__ 784 #else
777 printf ("%sel-unknown-linux-gnu\n", argv[1]); 785 CPU=
778#endif 786 #endif
779 return 0; 787 #endif
780}
781EOF 788EOF
782 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 789 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
783 rm -f $dummy.c $dummy 790 rm -f $dummy.c
791 test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
784 ;; 792 ;;
785 ppc:Linux:*:*) 793 ppc:Linux:*:*)
786 # Determine Lib Version 794 echo powerpc-unknown-linux-gnu
787 cat >$dummy.c <<EOF 795 exit 0 ;;
788#include <features.h> 796 ppc64:Linux:*:*)
789#if defined(__GLIBC__) 797 echo powerpc64-unknown-linux-gnu
790extern char __libc_version[];
791extern char __libc_release[];
792#endif
793main(argc, argv)
794 int argc;
795 char *argv[];
796{
797#if defined(__GLIBC__)
798 printf("%s %s\n", __libc_version, __libc_release);
799#else
800 printf("unknown\n");
801#endif
802 return 0;
803}
804EOF
805 LIBC=""
806 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
807 if test "$?" = 0 ; then
808 ./$dummy | grep 1\.99 > /dev/null
809 if test "$?" = 0 ; then LIBC="libc1" ; fi
810 fi
811 rm -f $dummy.c $dummy
812 echo powerpc-unknown-linux-gnu${LIBC}
813 exit 0 ;; 798 exit 0 ;;
814 alpha:Linux:*:*) 799 alpha:Linux:*:*)
815 cat <<EOF >$dummy.s 800 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
816 .data 801 EV5) UNAME_MACHINE=alphaev5 ;;
817 \$Lformat: 802 EV56) UNAME_MACHINE=alphaev56 ;;
818 .byte 37,100,45,37,120,10,0 # "%d-%x\n" 803 PCA56) UNAME_MACHINE=alphapca56 ;;
819 .text 804 PCA57) UNAME_MACHINE=alphapca56 ;;
820 .globl main 805 EV6) UNAME_MACHINE=alphaev6 ;;
821 .align 4 806 EV67) UNAME_MACHINE=alphaev67 ;;
822 .ent main 807 EV68*) UNAME_MACHINE=alphaev68 ;;
823 main: 808 esac
824 .frame \$30,16,\$26,0 809 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
825 ldgp \$29,0(\$27) 810 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
826 .prologue 1
827 .long 0x47e03d80 # implver \$0
828 lda \$2,-1
829 .long 0x47e20c21 # amask \$2,\$1
830 lda \$16,\$Lformat
831 mov \$0,\$17
832 not \$1,\$18
833 jsr \$26,printf
834 ldgp \$29,0(\$26)
835 mov 0,\$16
836 jsr \$26,exit
837 .end main
838EOF
839 LIBC=""
840 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
841 if test "$?" = 0 ; then
842 case `./$dummy` in
843 0-0) UNAME_MACHINE="alpha" ;;
844 1-0) UNAME_MACHINE="alphaev5" ;;
845 1-1) UNAME_MACHINE="alphaev56" ;;
846 1-101) UNAME_MACHINE="alphapca56" ;;
847 2-303) UNAME_MACHINE="alphaev6" ;;
848 2-307) UNAME_MACHINE="alphaev67" ;;
849 esac
850 objdump --private-headers $dummy | \
851 grep ld.so.1 > /dev/null
852 if test "$?" = 0 ; then
853 LIBC="libc1"
854 fi
855 fi
856 rm -f $dummy.s $dummy
857 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 811 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
858 exit 0 ;; 812 exit 0 ;;
859 parisc:Linux:*:* | hppa:Linux:*:*) 813 parisc:Linux:*:* | hppa:Linux:*:*)
@@ -883,71 +837,61 @@ EOF
883 # The BFD linker knows what the default object file format is, so 837 # The BFD linker knows what the default object file format is, so
884 # first see if it will tell us. cd to the root directory to prevent 838 # first see if it will tell us. cd to the root directory to prevent
885 # problems with other programs or directories called `ld' in the path. 839 # problems with other programs or directories called `ld' in the path.
886 ld_supported_emulations=`cd /; ld --help 2>&1 \ 840 # Export LANG=C to prevent ld from outputting information in other
887 | sed -ne '/supported emulations:/!d 841 # languages.
842 ld_supported_targets=`LANG=C; export LANG; cd /; ld --help 2>&1 \
843 | sed -ne '/supported targets:/!d
888 s/[ ][ ]*/ /g 844 s/[ ][ ]*/ /g
889 s/.*supported emulations: *// 845 s/.*supported targets: *//
890 s/ .*// 846 s/ .*//
891 p'` 847 p'`
892 case "$ld_supported_emulations" in 848 case "$ld_supported_targets" in
893 i*86linux) 849 elf32-i386)
894 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
895 exit 0
896 ;;
897 elf_i*86)
898 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 850 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
899 ;; 851 ;;
900 i*86coff) 852 a.out-i386-linux)
853 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
854 exit 0 ;;
855 coff-i386)
901 echo "${UNAME_MACHINE}-pc-linux-gnucoff" 856 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
902 exit 0 857 exit 0 ;;
903 ;; 858 "")
904 esac 859 # Either a pre-BFD a.out linker (linux-gnuoldld) or
905 # Either a pre-BFD a.out linker (linux-gnuoldld) 860 # one that does not give us useful --help.
906 # or one that does not give us useful --help. 861 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
907 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. 862 exit 0 ;;
908 # If ld does not provide *any* "supported emulations:"
909 # that means it is gnuoldld.
910 test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
911 case "${UNAME_MACHINE}" in
912 i*86)
913 VENDOR=pc;
914 ;;
915 *)
916 VENDOR=unknown;
917 ;;
918 esac 863 esac
919 # Determine whether the default compiler is a.out or elf 864 # Determine whether the default compiler is a.out or elf
920 cat >$dummy.c <<EOF 865 eval $set_cc_for_build
921#include <features.h> 866 sed 's/^ //' << EOF >$dummy.c
922#ifdef __cplusplus 867 #include <features.h>
923#include <stdio.h> /* for printf() prototype */ 868 #ifdef __ELF__
924 int main (int argc, char *argv[]) { 869 # ifdef __GLIBC__
925#else 870 # if __GLIBC__ >= 2
926 int main (argc, argv) int argc; char *argv[]; { 871 LIBC=gnu
927#endif 872 # else
928#ifdef __ELF__ 873 LIBC=gnulibc1
929# ifdef __GLIBC__ 874 # endif
930# if __GLIBC__ >= 2 875 # else
931 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); 876 LIBC=gnulibc1
932# else 877 # endif
933 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); 878 #else
934# endif 879 #ifdef __INTEL_COMPILER
935# else 880 LIBC=gnu
936 printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); 881 #else
937# endif 882 LIBC=gnuaout
938#else 883 #endif
939 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); 884 #endif
940#endif
941 return 0;
942}
943EOF 885EOF
944 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 886 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
945 rm -f $dummy.c $dummy 887 rm -f $dummy.c
888 test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
946 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 889 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
947 ;; 890 ;;
948# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
949# are messed up and put the nodename in both sysname and nodename.
950 i*86:DYNIX/ptx:4*:*) 891 i*86:DYNIX/ptx:4*:*)
892 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
893 # earlier versions are messed up and put the nodename in both
894 # sysname and nodename.
951 echo i386-sequent-sysv4 895 echo i386-sequent-sysv4
952 exit 0 ;; 896 exit 0 ;;
953 i*86:UNIX_SV:4.2MP:2.*) 897 i*86:UNIX_SV:4.2MP:2.*)
@@ -966,14 +910,13 @@ EOF
966 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 910 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
967 fi 911 fi
968 exit 0 ;; 912 exit 0 ;;
969 i*86:*:5:7*) 913 i*86:*:5:[78]*)
970 # Fixed at (any) Pentium or better 914 case `/bin/uname -X | grep "^Machine"` in
971 UNAME_MACHINE=i586 915 *486*) UNAME_MACHINE=i486 ;;
972 if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then 916 *Pentium) UNAME_MACHINE=i586 ;;
973 echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} 917 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
974 else 918 esac
975 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} 919 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
976 fi
977 exit 0 ;; 920 exit 0 ;;
978 i*86:*:3.2:*) 921 i*86:*:3.2:*)
979 if test -f /usr/options/cb.name; then 922 if test -f /usr/options/cb.name; then
@@ -1021,7 +964,7 @@ EOF
1021 exit 0 ;; 964 exit 0 ;;
1022 M68*:*:R3V[567]*:*) 965 M68*:*:R3V[567]*:*)
1023 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 966 test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1024 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) 967 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
1025 OS_REL='' 968 OS_REL=''
1026 test -r /etc/.relid \ 969 test -r /etc/.relid \
1027 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 970 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1067,8 +1010,8 @@ EOF
1067 echo ns32k-sni-sysv 1010 echo ns32k-sni-sysv
1068 fi 1011 fi
1069 exit 0 ;; 1012 exit 0 ;;
1070 PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1013 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1071 # says <Richard.M.Bartel@ccMail.Census.GOV> 1014 # says <Richard.M.Bartel@ccMail.Census.GOV>
1072 echo i586-unisys-sysv4 1015 echo i586-unisys-sysv4
1073 exit 0 ;; 1016 exit 0 ;;
1074 *:UNIX_System_V:4*:FTX*) 1017 *:UNIX_System_V:4*:FTX*)
@@ -1080,6 +1023,10 @@ EOF
1080 # From seanf@swdc.stratus.com. 1023 # From seanf@swdc.stratus.com.
1081 echo i860-stratus-sysv4 1024 echo i860-stratus-sysv4
1082 exit 0 ;; 1025 exit 0 ;;
1026 *:VOS:*:*)
1027 # From Paul.Green@stratus.com.
1028 echo hppa1.1-stratus-vos
1029 exit 0 ;;
1083 mc68*:A/UX:*:*) 1030 mc68*:A/UX:*:*)
1084 echo m68k-apple-aux${UNAME_RELEASE} 1031 echo m68k-apple-aux${UNAME_RELEASE}
1085 exit 0 ;; 1032 exit 0 ;;
@@ -1120,13 +1067,15 @@ EOF
1120 *:procnto*:*:* | *:QNX:[0123456789]*:*) 1067 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1121 if test "${UNAME_MACHINE}" = "x86pc"; then 1068 if test "${UNAME_MACHINE}" = "x86pc"; then
1122 UNAME_MACHINE=pc 1069 UNAME_MACHINE=pc
1070 echo i386-${UNAME_MACHINE}-nto-qnx
1071 else
1072 echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1123 fi 1073 fi
1124 echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1125 exit 0 ;; 1074 exit 0 ;;
1126 *:QNX:*:4*) 1075 *:QNX:*:4*)
1127 echo i386-pc-qnx 1076 echo i386-pc-qnx
1128 exit 0 ;; 1077 exit 0 ;;
1129 NSR-[KW]:NONSTOP_KERNEL:*:*) 1078 NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
1130 echo nsr-tandem-nsk${UNAME_RELEASE} 1079 echo nsr-tandem-nsk${UNAME_RELEASE}
1131 exit 0 ;; 1080 exit 0 ;;
1132 *:NonStop-UX:*:*) 1081 *:NonStop-UX:*:*)
@@ -1172,11 +1121,18 @@ EOF
1172 *:ITS:*:*) 1121 *:ITS:*:*)
1173 echo pdp10-unknown-its 1122 echo pdp10-unknown-its
1174 exit 0 ;; 1123 exit 0 ;;
1124 i*86:XTS-300:*:STOP)
1125 echo ${UNAME_MACHINE}-unknown-stop
1126 exit 0 ;;
1127 i*86:atheos:*:*)
1128 echo ${UNAME_MACHINE}-unknown-atheos
1129 exit 0 ;;
1175esac 1130esac
1176 1131
1177#echo '(No uname command or uname output not recognized.)' 1>&2 1132#echo '(No uname command or uname output not recognized.)' 1>&2
1178#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1133#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1179 1134
1135eval $set_cc_for_build
1180cat >$dummy.c <<EOF 1136cat >$dummy.c <<EOF
1181#ifdef _SEQUENT_ 1137#ifdef _SEQUENT_
1182# include <sys/types.h> 1138# include <sys/types.h>