comparison config.guess @ 3594:881057f735e2

[project @ 2000-02-09 03:26:44 by jwe]
author jwe
date Wed, 09 Feb 2000 03:26:45 +0000
parents d6ebd123170a
children 8fe3fdf1fa42
comparison
equal deleted inserted replaced
3593:78052d4fbc15 3594:881057f735e2
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, 1997 Free Software Foundation, Inc. 3 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
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
7 # the Free Software Foundation; either version 2 of the License, or 8 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version. 9 # (at your option) any later version.
20 # distribute this file as part of a program that contains a 21 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under 22 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that program. 23 # the same distribution terms that you use for the rest of that program.
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 # Please send patches to <config-patches@gnu.org>.
26 # 27 #
27 # This script attempts to guess a canonical system name similar to 28 # 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 29 # config.sub. If it succeeds, it prints the system name on stdout, and
29 # exits with 0. Otherwise, it exits with 1. 30 # exits with 0. Otherwise, it exits with 1.
30 # 31 #
33 # 34 #
34 # Only a few systems have been added to this list; please add others 35 # Only a few systems have been added to this list; please add others
35 # (but try to keep the structure clean). 36 # (but try to keep the structure clean).
36 # 37 #
37 38
39 # Use $HOST_CC if defined. $CC may point to a cross-compiler
40 if test x"$CC_FOR_BUILD" = x; then
41 if test x"$HOST_CC" != x; then
42 CC_FOR_BUILD="$HOST_CC"
43 else
44 if test x"$CC" != x; then
45 CC_FOR_BUILD="$CC"
46 else
47 CC_FOR_BUILD=cc
48 fi
49 fi
50 fi
51
52
38 # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 53 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
39 # (ghazi@noc.rutgers.edu 8/24/94.) 54 # (ghazi@noc.rutgers.edu 8/24/94.)
40 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 55 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
41 PATH=$PATH:/.attbin ; export PATH 56 PATH=$PATH:/.attbin ; export PATH
42 fi 57 fi
44 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 59 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
45 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 60 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
46 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 61 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
47 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 62 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
48 63
49 trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 64 dummy=dummy-$$
65 trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
50 66
51 # Note: order is significant - the case branches are not exclusive. 67 # Note: order is significant - the case branches are not exclusive.
52 68
53 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 69 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
54 alpha:OSF1:*:*) 70 alpha:OSF1:*:*)
57 fi 73 fi
58 # A Vn.n version is a released version. 74 # A Vn.n version is a released version.
59 # A Tn.n version is a released field test version. 75 # A Tn.n version is a released field test version.
60 # A Xn.n version is an unreleased experimental baselevel. 76 # A Xn.n version is an unreleased experimental baselevel.
61 # 1.2 uses "1.2" for uname -r. 77 # 1.2 uses "1.2" for uname -r.
62 cat <<EOF >dummy.s 78 cat <<EOF >$dummy.s
63 .globl main 79 .globl main
64 .ent main 80 .ent main
65 main: 81 main:
66 .frame \$30,0,\$26,0 82 .frame \$30,0,\$26,0
67 .prologue 0 83 .prologue 0
74 addl \$1,\$0,\$0 90 addl \$1,\$0,\$0
75 addl \$2,\$0,\$0 91 addl \$2,\$0,\$0
76 ret \$31,(\$26),1 92 ret \$31,(\$26),1
77 .end main 93 .end main
78 EOF 94 EOF
79 ${CC-cc} dummy.s -o dummy 2>/dev/null 95 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
80 if test "$?" = 0 ; then 96 if test "$?" = 0 ; then
81 ./dummy 97 ./$dummy
82 case "$?" in 98 case "$?" in
83 7) 99 7)
84 UNAME_MACHINE="alpha" 100 UNAME_MACHINE="alpha"
85 ;; 101 ;;
86 15) 102 15)
95 16) 111 16)
96 UNAME_MACHINE="alphaev6" 112 UNAME_MACHINE="alphaev6"
97 ;; 113 ;;
98 esac 114 esac
99 fi 115 fi
100 rm -f dummy.s dummy 116 rm -f $dummy.s $dummy
101 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` 117 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
118 exit 0 ;;
119 Alpha\ *:Windows_NT*:*)
120 # How do we know it's Interix rather than the generic POSIX subsystem?
121 # Should we change UNAME_MACHINE based on the output of uname instead
122 # of the specific Alpha model?
123 echo alpha-pc-interix
102 exit 0 ;; 124 exit 0 ;;
103 21064:Windows_NT:50:3) 125 21064:Windows_NT:50:3)
104 echo alpha-dec-winnt3.5 126 echo alpha-dec-winnt3.5
105 exit 0 ;; 127 exit 0 ;;
106 Amiga*:UNIX_System_V:4.0:*) 128 Amiga*:UNIX_System_V:4.0:*)
110 echo m68k-cbm-netbsd${UNAME_RELEASE} 132 echo m68k-cbm-netbsd${UNAME_RELEASE}
111 exit 0 ;; 133 exit 0 ;;
112 amiga:OpenBSD:*:*) 134 amiga:OpenBSD:*:*)
113 echo m68k-unknown-openbsd${UNAME_RELEASE} 135 echo m68k-unknown-openbsd${UNAME_RELEASE}
114 exit 0 ;; 136 exit 0 ;;
137 *:[Aa]miga[Oo][Ss]:*:*)
138 echo ${UNAME_MACHINE}-unknown-amigaos
139 exit 0 ;;
115 arc64:OpenBSD:*:*) 140 arc64:OpenBSD:*:*)
116 echo mips64el-unknown-openbsd${UNAME_RELEASE} 141 echo mips64el-unknown-openbsd${UNAME_RELEASE}
117 exit 0 ;; 142 exit 0 ;;
118 arc:OpenBSD:*:*) 143 arc:OpenBSD:*:*)
119 echo mipsel-unknown-openbsd${UNAME_RELEASE} 144 echo mipsel-unknown-openbsd${UNAME_RELEASE}
127 sgi:OpenBSD:*:*) 152 sgi:OpenBSD:*:*)
128 echo mips-unknown-openbsd${UNAME_RELEASE} 153 echo mips-unknown-openbsd${UNAME_RELEASE}
129 exit 0 ;; 154 exit 0 ;;
130 wgrisc:OpenBSD:*:*) 155 wgrisc:OpenBSD:*:*)
131 echo mipsel-unknown-openbsd${UNAME_RELEASE} 156 echo mipsel-unknown-openbsd${UNAME_RELEASE}
157 exit 0 ;;
158 *:OS/390:*:*)
159 echo i370-ibm-openedition
132 exit 0 ;; 160 exit 0 ;;
133 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 161 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
134 echo arm-acorn-riscix${UNAME_RELEASE} 162 echo arm-acorn-riscix${UNAME_RELEASE}
135 exit 0;; 163 exit 0;;
136 arm32:NetBSD:*:*) 164 arm32:NetBSD:*:*)
137 echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 165 echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
138 exit 0 ;; 166 exit 0 ;;
139 SR2?01:HI-UX/MPP:*:*) 167 SR2?01:HI-UX/MPP:*:*)
140 echo hppa1.1-hitachi-hiuxmpp 168 echo hppa1.1-hitachi-hiuxmpp
141 exit 0;; 169 exit 0;;
142 Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) 170 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
143 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 171 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
144 if test "`(/bin/universe) 2>/dev/null`" = att ; then 172 if test "`(/bin/universe) 2>/dev/null`" = att ; then
145 echo pyramid-pyramid-sysv3 173 echo pyramid-pyramid-sysv3
146 else 174 else
147 echo pyramid-pyramid-bsd 175 echo pyramid-pyramid-bsd
148 fi 176 fi
149 exit 0 ;; 177 exit 0 ;;
150 NILE:*:*:dcosx) 178 NILE*:*:*:dcosx)
151 echo pyramid-pyramid-svr4 179 echo pyramid-pyramid-svr4
180 exit 0 ;;
181 sun4H:SunOS:5.*:*)
182 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
152 exit 0 ;; 183 exit 0 ;;
153 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 184 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
154 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 185 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
155 exit 0 ;; 186 exit 0 ;;
156 i86pc:SunOS:5.*:*) 187 i86pc:SunOS:5.*:*)
193 echo m68k-atari-netbsd${UNAME_RELEASE} 224 echo m68k-atari-netbsd${UNAME_RELEASE}
194 exit 0 ;; 225 exit 0 ;;
195 atari*:OpenBSD:*:*) 226 atari*:OpenBSD:*:*)
196 echo m68k-unknown-openbsd${UNAME_RELEASE} 227 echo m68k-unknown-openbsd${UNAME_RELEASE}
197 exit 0 ;; 228 exit 0 ;;
229 # The situation for MiNT is a little confusing. The machine name
230 # can be virtually everything (everything which is not
231 # "atarist" or "atariste" at least should have a processor
232 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
233 # to the lowercase version "mint" (or "freemint"). Finally
234 # the system name "TOS" denotes a system which is actually not
235 # MiNT. But MiNT is downward compatible to TOS, so this should
236 # be no problem.
237 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
238 echo m68k-atari-mint${UNAME_RELEASE}
239 exit 0 ;;
240 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
241 echo m68k-atari-mint${UNAME_RELEASE}
242 exit 0 ;;
243 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
244 echo m68k-atari-mint${UNAME_RELEASE}
245 exit 0 ;;
246 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
247 echo m68k-milan-mint${UNAME_RELEASE}
248 exit 0 ;;
249 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
250 echo m68k-hades-mint${UNAME_RELEASE}
251 exit 0 ;;
252 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
253 echo m68k-unknown-mint${UNAME_RELEASE}
254 exit 0 ;;
198 sun3*:NetBSD:*:*) 255 sun3*:NetBSD:*:*)
199 echo m68k-sun-netbsd${UNAME_RELEASE} 256 echo m68k-sun-netbsd${UNAME_RELEASE}
200 exit 0 ;; 257 exit 0 ;;
201 sun3*:OpenBSD:*:*) 258 sun3*:OpenBSD:*:*)
202 echo m68k-unknown-openbsd${UNAME_RELEASE} 259 echo m68k-unknown-openbsd${UNAME_RELEASE}
214 echo m88k-unknown-openbsd${UNAME_RELEASE} 271 echo m88k-unknown-openbsd${UNAME_RELEASE}
215 exit 0 ;; 272 exit 0 ;;
216 powerpc:machten:*:*) 273 powerpc:machten:*:*)
217 echo powerpc-apple-machten${UNAME_RELEASE} 274 echo powerpc-apple-machten${UNAME_RELEASE}
218 exit 0 ;; 275 exit 0 ;;
276 macppc:NetBSD:*:*)
277 echo powerpc-apple-netbsd${UNAME_RELEASE}
278 exit 0 ;;
219 RISC*:Mach:*:*) 279 RISC*:Mach:*:*)
220 echo mips-dec-mach_bsd4.3 280 echo mips-dec-mach_bsd4.3
221 exit 0 ;; 281 exit 0 ;;
222 RISC*:ULTRIX:*:*) 282 RISC*:ULTRIX:*:*)
223 echo mips-dec-ultrix${UNAME_RELEASE} 283 echo mips-dec-ultrix${UNAME_RELEASE}
224 exit 0 ;; 284 exit 0 ;;
225 VAX*:ULTRIX*:*:*) 285 VAX*:ULTRIX*:*:*)
226 echo vax-dec-ultrix${UNAME_RELEASE} 286 echo vax-dec-ultrix${UNAME_RELEASE}
227 exit 0 ;; 287 exit 0 ;;
228 2020:CLIX:*:*) 288 2020:CLIX:*:* | 2430:CLIX:*:*)
229 echo clipper-intergraph-clix${UNAME_RELEASE} 289 echo clipper-intergraph-clix${UNAME_RELEASE}
230 exit 0 ;; 290 exit 0 ;;
231 mips:*:*:UMIPS | mips:*:*:RISCos) 291 mips:*:*:UMIPS | mips:*:*:RISCos)
232 sed 's/^ //' << EOF >dummy.c 292 sed 's/^ //' << EOF >$dummy.c
233 int main (argc, argv) int argc; char **argv; { 293 #ifdef __cplusplus
294 #include <stdio.h> /* for printf() prototype */
295 int main (int argc, char *argv[]) {
296 #else
297 int main (argc, argv) int argc; char *argv[]; {
298 #endif
234 #if defined (host_mips) && defined (MIPSEB) 299 #if defined (host_mips) && defined (MIPSEB)
235 #if defined (SYSTYPE_SYSV) 300 #if defined (SYSTYPE_SYSV)
236 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 301 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
237 #endif 302 #endif
238 #if defined (SYSTYPE_SVR4) 303 #if defined (SYSTYPE_SVR4)
243 #endif 308 #endif
244 #endif 309 #endif
245 exit (-1); 310 exit (-1);
246 } 311 }
247 EOF 312 EOF
248 ${CC-cc} dummy.c -o dummy \ 313 $CC_FOR_BUILD $dummy.c -o $dummy \
249 && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ 314 && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
250 && rm dummy.c dummy && exit 0 315 && rm $dummy.c $dummy && exit 0
251 rm -f dummy.c dummy 316 rm -f $dummy.c $dummy
252 echo mips-mips-riscos${UNAME_RELEASE} 317 echo mips-mips-riscos${UNAME_RELEASE}
253 exit 0 ;; 318 exit 0 ;;
254 Night_Hawk:Power_UNIX:*:*) 319 Night_Hawk:Power_UNIX:*:*)
255 echo powerpc-harris-powerunix 320 echo powerpc-harris-powerunix
256 exit 0 ;; 321 exit 0 ;;
264 echo m88k-motorola-sysv3 329 echo m88k-motorola-sysv3
265 exit 0 ;; 330 exit 0 ;;
266 AViiON:dgux:*:*) 331 AViiON:dgux:*:*)
267 # DG/UX returns AViiON for all architectures 332 # DG/UX returns AViiON for all architectures
268 UNAME_PROCESSOR=`/usr/bin/uname -p` 333 UNAME_PROCESSOR=`/usr/bin/uname -p`
269 if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then 334 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
270 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ 335 then
271 -o ${TARGET_BINARY_INTERFACE}x = x ] ; then 336 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
337 [ ${TARGET_BINARY_INTERFACE}x = x ]
338 then
272 echo m88k-dg-dgux${UNAME_RELEASE} 339 echo m88k-dg-dgux${UNAME_RELEASE}
340 else
341 echo m88k-dg-dguxbcs${UNAME_RELEASE}
342 fi
273 else 343 else
274 echo m88k-dg-dguxbcs${UNAME_RELEASE} 344 echo i586-dg-dgux${UNAME_RELEASE}
275 fi 345 fi
276 else echo i586-dg-dgux${UNAME_RELEASE}
277 fi
278 exit 0 ;; 346 exit 0 ;;
279 M88*:DolphinOS:*:*) # DolphinOS (SVR3) 347 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
280 echo m88k-dolphin-sysv3 348 echo m88k-dolphin-sysv3
281 exit 0 ;; 349 exit 0 ;;
282 M88*:*:R3*:*) 350 M88*:*:R3*:*)
298 i?86:AIX:*:*) 366 i?86:AIX:*:*)
299 echo i386-ibm-aix 367 echo i386-ibm-aix
300 exit 0 ;; 368 exit 0 ;;
301 *:AIX:2:3) 369 *:AIX:2:3)
302 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 370 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
303 sed 's/^ //' << EOF >dummy.c 371 sed 's/^ //' << EOF >$dummy.c
304 #include <sys/systemcfg.h> 372 #include <sys/systemcfg.h>
305 373
306 main() 374 main()
307 { 375 {
308 if (!__power_pc()) 376 if (!__power_pc())
309 exit(1); 377 exit(1);
310 puts("powerpc-ibm-aix3.2.5"); 378 puts("powerpc-ibm-aix3.2.5");
311 exit(0); 379 exit(0);
312 } 380 }
313 EOF 381 EOF
314 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 382 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
315 rm -f dummy.c dummy 383 rm -f $dummy.c $dummy
316 echo rs6000-ibm-aix3.2.5 384 echo rs6000-ibm-aix3.2.5
317 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 385 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
318 echo rs6000-ibm-aix3.2.4 386 echo rs6000-ibm-aix3.2.4
319 else 387 else
320 echo rs6000-ibm-aix3.2 388 echo rs6000-ibm-aix3.2
321 fi 389 fi
322 exit 0 ;; 390 exit 0 ;;
323 *:AIX:*:4) 391 *:AIX:*:4)
324 if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then 392 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
393 if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
325 IBM_ARCH=rs6000 394 IBM_ARCH=rs6000
326 else 395 else
327 IBM_ARCH=powerpc 396 IBM_ARCH=powerpc
328 fi 397 fi
329 if [ -x /usr/bin/oslevel ] ; then 398 if [ -x /usr/bin/oslevel ] ; then
352 echo m68k-hp-bsd 421 echo m68k-hp-bsd
353 exit 0 ;; 422 exit 0 ;;
354 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 423 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
355 echo m68k-hp-bsd4.4 424 echo m68k-hp-bsd4.4
356 exit 0 ;; 425 exit 0 ;;
357 9000/[3478]??:HP-UX:*:*) 426 9000/[34678]??:HP-UX:*:*)
358 case "${UNAME_MACHINE}" in 427 case "${UNAME_MACHINE}" in
359 9000/31? ) HP_ARCH=m68000 ;; 428 9000/31? ) HP_ARCH=m68000 ;;
360 9000/[34]?? ) HP_ARCH=m68k ;; 429 9000/[34]?? ) HP_ARCH=m68k ;;
361 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; 430 9000/[678][0-9][0-9])
362 9000/8?? ) HP_ARCH=hppa1.0 ;; 431 sed 's/^ //' << EOF >$dummy.c
432 #include <stdlib.h>
433 #include <unistd.h>
434
435 int main ()
436 {
437 #if defined(_SC_KERNEL_BITS)
438 long bits = sysconf(_SC_KERNEL_BITS);
439 #endif
440 long cpu = sysconf (_SC_CPU_VERSION);
441
442 switch (cpu)
443 {
444 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
445 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
446 case CPU_PA_RISC2_0:
447 #if defined(_SC_KERNEL_BITS)
448 switch (bits)
449 {
450 case 64: puts ("hppa2.0w"); break;
451 case 32: puts ("hppa2.0n"); break;
452 default: puts ("hppa2.0"); break;
453 } break;
454 #else /* !defined(_SC_KERNEL_BITS) */
455 puts ("hppa2.0"); break;
456 #endif
457 default: puts ("hppa1.0"); break;
458 }
459 exit (0);
460 }
461 EOF
462 (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
463 rm -f $dummy.c $dummy
363 esac 464 esac
364 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 465 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
365 echo ${HP_ARCH}-hp-hpux${HPUX_REV} 466 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
366 exit 0 ;; 467 exit 0 ;;
367 3050*:HI-UX:*:*) 468 3050*:HI-UX:*:*)
368 sed 's/^ //' << EOF >dummy.c 469 sed 's/^ //' << EOF >$dummy.c
369 #include <unistd.h> 470 #include <unistd.h>
370 int 471 int
371 main () 472 main ()
372 { 473 {
373 long cpu = sysconf (_SC_CPU_VERSION); 474 long cpu = sysconf (_SC_CPU_VERSION);
388 puts ("m68k-hitachi-hiuxwe2"); 489 puts ("m68k-hitachi-hiuxwe2");
389 else puts ("unknown-hitachi-hiuxwe2"); 490 else puts ("unknown-hitachi-hiuxwe2");
390 exit (0); 491 exit (0);
391 } 492 }
392 EOF 493 EOF
393 ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 494 $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
394 rm -f dummy.c dummy 495 rm -f $dummy.c $dummy
395 echo unknown-hitachi-hiuxwe2 496 echo unknown-hitachi-hiuxwe2
396 exit 0 ;; 497 exit 0 ;;
397 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 498 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
398 echo hppa1.1-hp-bsd 499 echo hppa1.1-hp-bsd
399 exit 0 ;; 500 exit 0 ;;
400 9000/8??:4.3bsd:*:*) 501 9000/8??:4.3bsd:*:*)
401 echo hppa1.0-hp-bsd 502 echo hppa1.0-hp-bsd
503 exit 0 ;;
504 *9??*:MPE/iX:*:*)
505 echo hppa1.0-hp-mpeix
402 exit 0 ;; 506 exit 0 ;;
403 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 507 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
404 echo hppa1.1-hp-osf 508 echo hppa1.1-hp-osf
405 exit 0 ;; 509 exit 0 ;;
406 hp8??:OSF1:*:*) 510 hp8??:OSF1:*:*)
414 fi 518 fi
415 exit 0 ;; 519 exit 0 ;;
416 parisc*:Lites*:*:*) 520 parisc*:Lites*:*:*)
417 echo hppa1.1-hp-lites 521 echo hppa1.1-hp-lites
418 exit 0 ;; 522 exit 0 ;;
523 hppa*:OpenBSD:*:*)
524 echo hppa-unknown-openbsd
525 exit 0 ;;
419 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 526 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
420 echo c1-convex-bsd 527 echo c1-convex-bsd
421 exit 0 ;; 528 exit 0 ;;
422 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 529 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
423 if getsysinfo -f scalar_acc 530 if getsysinfo -f scalar_acc
444 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 551 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
445 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 552 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
446 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ 553 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
447 exit 0 ;; 554 exit 0 ;;
448 CRAY*TS:*:*:*) 555 CRAY*TS:*:*:*)
449 echo t90-cray-unicos${UNAME_RELEASE} 556 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
557 exit 0 ;;
558 CRAY*T3E:*:*:*)
559 echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
560 exit 0 ;;
561 CRAY*SV1:*:*:*)
562 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
450 exit 0 ;; 563 exit 0 ;;
451 CRAY-2:*:*:*) 564 CRAY-2:*:*:*)
452 echo cray2-cray-unicos 565 echo cray2-cray-unicos
453 exit 0 ;; 566 exit 0 ;;
454 F300:UNIX_System_V:*:*) 567 F300:UNIX_System_V:*:*)
455 FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` 568 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
456 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 569 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
457 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 570 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
458 exit 0 ;; 571 exit 0 ;;
459 F301:UNIX_System_V:*:*) 572 F301:UNIX_System_V:*:*)
460 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` 573 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
463 echo m68k-hp-netbsd${UNAME_RELEASE} 576 echo m68k-hp-netbsd${UNAME_RELEASE}
464 exit 0 ;; 577 exit 0 ;;
465 hp300:OpenBSD:*:*) 578 hp300:OpenBSD:*:*)
466 echo m68k-unknown-openbsd${UNAME_RELEASE} 579 echo m68k-unknown-openbsd${UNAME_RELEASE}
467 exit 0 ;; 580 exit 0 ;;
468 i?86:BSD/386:*:* | *:BSD/OS:*:*) 581 i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
469 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 582 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
470 exit 0 ;; 583 exit 0 ;;
584 sparc*:BSD/OS:*:*)
585 echo sparc-unknown-bsdi${UNAME_RELEASE}
586 exit 0 ;;
587 *:BSD/OS:*:*)
588 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
589 exit 0 ;;
471 *:FreeBSD:*:*) 590 *:FreeBSD:*:*)
591 if test -x /usr/bin/objformat; then
592 if test "elf" = "`/usr/bin/objformat`"; then
593 echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
594 exit 0
595 fi
596 fi
472 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 597 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
473 exit 0 ;; 598 exit 0 ;;
474 *:NetBSD:*:*) 599 *:NetBSD:*:*)
475 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 600 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
476 exit 0 ;; 601 exit 0 ;;
477 *:OpenBSD:*:*) 602 *:OpenBSD:*:*)
478 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 603 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
479 exit 0 ;; 604 exit 0 ;;
480 i*:CYGWIN*:*) 605 i*:CYGWIN*:*)
481 echo i386-pc-cygwin32 606 echo ${UNAME_MACHINE}-pc-cygwin
482 exit 0 ;; 607 exit 0 ;;
483 i*:MINGW*:*) 608 i*:MINGW*:*)
484 echo i386-pc-mingw32 609 echo ${UNAME_MACHINE}-pc-mingw32
610 exit 0 ;;
611 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
612 # How do we know it's Interix rather than the generic POSIX subsystem?
613 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
614 # UNAME_MACHINE based on the output of uname instead of i386?
615 echo i386-pc-interix
616 exit 0 ;;
617 i*:UWIN*:*)
618 echo ${UNAME_MACHINE}-pc-uwin
485 exit 0 ;; 619 exit 0 ;;
486 p*:CYGWIN*:*) 620 p*:CYGWIN*:*)
487 echo powerpcle-unknown-cygwin32 621 echo powerpcle-unknown-cygwin
488 exit 0 ;; 622 exit 0 ;;
489 prep*:SunOS:5.*:*) 623 prep*:SunOS:5.*:*)
490 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 624 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
491 exit 0 ;; 625 exit 0 ;;
492 *:GNU:*:*) 626 *:GNU:*:*)
493 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 627 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
494 exit 0 ;; 628 exit 0 ;;
495 *:Linux:*:*) 629 *:Linux:*:*)
630
496 # The BFD linker knows what the default object file format is, so 631 # The BFD linker knows what the default object file format is, so
497 # first see if it will tell us. 632 # first see if it will tell us. cd to the root directory to prevent
498 ld_help_string=`ld --help 2>&1` 633 # problems with other programs or directories called `ld' in the path.
634 ld_help_string=`cd /; ld --help 2>&1`
499 ld_supported_emulations=`echo $ld_help_string \ 635 ld_supported_emulations=`echo $ld_help_string \
500 | sed -ne '/supported emulations:/!d 636 | sed -ne '/supported emulations:/!d
501 s/[ ][ ]*/ /g 637 s/[ ][ ]*/ /g
502 s/.*supported emulations: *// 638 s/.*supported emulations: *//
503 s/ .*// 639 s/ .*//
504 p'` 640 p'`
505 case "$ld_supported_emulations" in 641 case "$ld_supported_emulations" in
506 i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; 642 *ia64)
507 i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; 643 echo "${UNAME_MACHINE}-unknown-linux"
508 sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 644 exit 0
509 m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 645 ;;
510 elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; 646 i?86linux)
647 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
648 exit 0
649 ;;
650 i?86coff)
651 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
652 exit 0
653 ;;
654 sparclinux)
655 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
656 exit 0
657 ;;
658 armlinux)
659 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
660 exit 0
661 ;;
662 elf32arm*)
663 echo "${UNAME_MACHINE}-unknown-linux-gnu"
664 exit 0
665 ;;
666 armelf_linux*)
667 echo "${UNAME_MACHINE}-unknown-linux-gnu"
668 exit 0
669 ;;
670 m68klinux)
671 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
672 exit 0
673 ;;
674 elf32ppc | elf32ppclinux)
675 # Determine Lib Version
676 cat >$dummy.c <<EOF
677 #include <features.h>
678 #if defined(__GLIBC__)
679 extern char __libc_version[];
680 extern char __libc_release[];
681 #endif
682 main(argc, argv)
683 int argc;
684 char *argv[];
685 {
686 #if defined(__GLIBC__)
687 printf("%s %s\n", __libc_version, __libc_release);
688 #else
689 printf("unkown\n");
690 #endif
691 return 0;
692 }
693 EOF
694 LIBC=""
695 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
696 if test "$?" = 0 ; then
697 ./$dummy | grep 1\.99 > /dev/null
698 if test "$?" = 0 ; then
699 LIBC="libc1"
700 fi
701 fi
702 rm -f $dummy.c $dummy
703 echo powerpc-unknown-linux-gnu${LIBC}
704 exit 0
705 ;;
511 esac 706 esac
512 707
513 if test "${UNAME_MACHINE}" = "alpha" ; then 708 if test "${UNAME_MACHINE}" = "alpha" ; then
514 sed 's/^ //' <<EOF >dummy.s 709 sed 's/^ //' <<EOF >$dummy.s
515 .globl main 710 .globl main
516 .ent main 711 .ent main
517 main: 712 main:
518 .frame \$30,0,\$26,0 713 .frame \$30,0,\$26,0
519 .prologue 0 714 .prologue 0
527 addl \$2,\$0,\$0 722 addl \$2,\$0,\$0
528 ret \$31,(\$26),1 723 ret \$31,(\$26),1
529 .end main 724 .end main
530 EOF 725 EOF
531 LIBC="" 726 LIBC=""
532 ${CC-cc} dummy.s -o dummy 2>/dev/null 727 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
533 if test "$?" = 0 ; then 728 if test "$?" = 0 ; then
534 ./dummy 729 ./$dummy
535 case "$?" in 730 case "$?" in
536 7) 731 7)
537 UNAME_MACHINE="alpha" 732 UNAME_MACHINE="alpha"
538 ;; 733 ;;
539 15) 734 15)
546 UNAME_MACHINE="alphapca56" 741 UNAME_MACHINE="alphapca56"
547 ;; 742 ;;
548 16) 743 16)
549 UNAME_MACHINE="alphaev6" 744 UNAME_MACHINE="alphaev6"
550 ;; 745 ;;
551 esac 746 esac
552 747
553 objdump --private-headers dummy | \ 748 objdump --private-headers $dummy | \
554 grep ld.so.1 > /dev/null 749 grep ld.so.1 > /dev/null
555 if test "$?" = 0 ; then 750 if test "$?" = 0 ; then
556 LIBC="libc1" 751 LIBC="libc1"
557 fi 752 fi
558 fi 753 fi
559 rm -f dummy.s dummy 754 rm -f $dummy.s $dummy
560 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 755 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
561 elif test "${UNAME_MACHINE}" = "mips" ; then 756 elif test "${UNAME_MACHINE}" = "mips" ; then
562 cat >dummy.c <<EOF 757 cat >$dummy.c <<EOF
563 main(argc, argv) 758 #ifdef __cplusplus
564 int argc; 759 #include <stdio.h> /* for printf() prototype */
565 char *argv[]; 760 int main (int argc, char *argv[]) {
566 { 761 #else
762 int main (argc, argv) int argc; char *argv[]; {
763 #endif
567 #ifdef __MIPSEB__ 764 #ifdef __MIPSEB__
568 printf ("%s-unknown-linux-gnu\n", argv[1]); 765 printf ("%s-unknown-linux-gnu\n", argv[1]);
569 #endif 766 #endif
570 #ifdef __MIPSEL__ 767 #ifdef __MIPSEL__
571 printf ("%sel-unknown-linux-gnu\n", argv[1]); 768 printf ("%sel-unknown-linux-gnu\n", argv[1]);
572 #endif 769 #endif
573 return 0; 770 return 0;
574 } 771 }
575 EOF 772 EOF
576 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 773 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
577 rm -f dummy.c dummy 774 rm -f $dummy.c $dummy
578 else 775 else
579 # Either a pre-BFD a.out linker (linux-gnuoldld) 776 # Either a pre-BFD a.out linker (linux-gnuoldld)
580 # or one that does not give us useful --help. 777 # or one that does not give us useful --help.
581 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. 778 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
582 # If ld does not provide *any* "supported emulations:" 779 # If ld does not provide *any* "supported emulations:"
591 *) 788 *)
592 VENDOR=unknown; 789 VENDOR=unknown;
593 ;; 790 ;;
594 esac 791 esac
595 # Determine whether the default compiler is a.out or elf 792 # Determine whether the default compiler is a.out or elf
596 cat >dummy.c <<EOF 793 cat >$dummy.c <<EOF
597 #include <features.h> 794 #include <features.h>
598 main(argc, argv) 795 #ifdef __cplusplus
599 int argc; 796 #include <stdio.h> /* for printf() prototype */
600 char *argv[]; 797 int main (int argc, char *argv[]) {
601 { 798 #else
799 int main (argc, argv) int argc; char *argv[]; {
800 #endif
602 #ifdef __ELF__ 801 #ifdef __ELF__
603 # ifdef __GLIBC__ 802 # ifdef __GLIBC__
604 # if __GLIBC__ >= 2 803 # if __GLIBC__ >= 2
605 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); 804 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
606 # else 805 # else
613 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); 812 printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
614 #endif 813 #endif
615 return 0; 814 return 0;
616 } 815 }
617 EOF 816 EOF
618 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 817 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
619 rm -f dummy.c dummy 818 rm -f $dummy.c $dummy
620 fi ;; 819 fi ;;
621 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions 820 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
622 # are messed up and put the nodename in both sysname and nodename. 821 # are messed up and put the nodename in both sysname and nodename.
623 i?86:DYNIX/ptx:4*:*) 822 i?86:DYNIX/ptx:4*:*)
624 echo i386-sequent-sysv4 823 echo i386-sequent-sysv4
630 # I just have to hope. -- rms. 829 # I just have to hope. -- rms.
631 # Use sysv4.2uw... so that sysv4* matches it. 830 # Use sysv4.2uw... so that sysv4* matches it.
632 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 831 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
633 exit 0 ;; 832 exit 0 ;;
634 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) 833 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
834 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
635 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 835 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
636 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} 836 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
637 else 837 else
638 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} 838 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
839 fi
840 exit 0 ;;
841 i?86:*:5:7*)
842 # Fixed at (any) Pentium or better
843 UNAME_MACHINE=i586
844 if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
845 echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
846 else
847 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
639 fi 848 fi
640 exit 0 ;; 849 exit 0 ;;
641 i?86:*:3.2:*) 850 i?86:*:3.2:*)
642 if test -f /usr/options/cb.name; then 851 if test -f /usr/options/cb.name; then
643 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 852 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
645 elif /bin/uname -X 2>/dev/null >/dev/null ; then 854 elif /bin/uname -X 2>/dev/null >/dev/null ; then
646 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` 855 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
647 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 856 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
648 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ 857 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
649 && UNAME_MACHINE=i586 858 && UNAME_MACHINE=i586
859 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
860 && UNAME_MACHINE=i686
861 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
862 && UNAME_MACHINE=i686
650 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 863 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
651 else 864 else
652 echo ${UNAME_MACHINE}-pc-sysv32 865 echo ${UNAME_MACHINE}-pc-sysv32
653 fi 866 fi
654 exit 0 ;; 867 exit 0 ;;
868 i?86:*DOS:*:*)
869 echo ${UNAME_MACHINE}-pc-msdosdjgpp
870 exit 0 ;;
655 pc:*:*:*) 871 pc:*:*:*)
872 # Left here for compatibility:
656 # uname -m prints for DJGPP always 'pc', but it prints nothing about 873 # uname -m prints for DJGPP always 'pc', but it prints nothing about
657 # the processor, so we play safe by assuming i386. 874 # the processor, so we play safe by assuming i386.
658 echo i386-pc-msdosdjgpp 875 echo i386-pc-msdosdjgpp
659 exit 0 ;; 876 exit 0 ;;
660 Intel:Mach:3*:*) 877 Intel:Mach:3*:*)
691 echo m68k-unknown-lynxos${UNAME_RELEASE} 908 echo m68k-unknown-lynxos${UNAME_RELEASE}
692 exit 0 ;; 909 exit 0 ;;
693 mc68030:UNIX_System_V:4.*:*) 910 mc68030:UNIX_System_V:4.*:*)
694 echo m68k-atari-sysv4 911 echo m68k-atari-sysv4
695 exit 0 ;; 912 exit 0 ;;
696 i?86:LynxOS:2.*:*) 913 i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
697 echo i386-unknown-lynxos${UNAME_RELEASE} 914 echo i386-unknown-lynxos${UNAME_RELEASE}
698 exit 0 ;; 915 exit 0 ;;
699 TSUNAMI:LynxOS:2.*:*) 916 TSUNAMI:LynxOS:2.*:*)
700 echo sparc-unknown-lynxos${UNAME_RELEASE} 917 echo sparc-unknown-lynxos${UNAME_RELEASE}
701 exit 0 ;; 918 exit 0 ;;
702 rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) 919 rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
703 echo rs6000-unknown-lynxos${UNAME_RELEASE} 920 echo rs6000-unknown-lynxos${UNAME_RELEASE}
704 exit 0 ;; 921 exit 0 ;;
705 SM[BE]S:UNIX_SV:*:*) 922 SM[BE]S:UNIX_SV:*:*)
706 echo mips-dde-sysv${UNAME_RELEASE} 923 echo mips-dde-sysv${UNAME_RELEASE}
924 exit 0 ;;
925 RM*:ReliantUNIX-*:*:*)
926 echo mips-sni-sysv4
707 exit 0 ;; 927 exit 0 ;;
708 RM*:SINIX-*:*:*) 928 RM*:SINIX-*:*:*)
709 echo mips-sni-sysv4 929 echo mips-sni-sysv4
710 exit 0 ;; 930 exit 0 ;;
711 *:SINIX-*:*:*) 931 *:SINIX-*:*:*)
733 echo m68k-apple-aux${UNAME_RELEASE} 953 echo m68k-apple-aux${UNAME_RELEASE}
734 exit 0 ;; 954 exit 0 ;;
735 news*:NEWS-OS:*:6*) 955 news*:NEWS-OS:*:6*)
736 echo mips-sony-newsos6 956 echo mips-sony-newsos6
737 exit 0 ;; 957 exit 0 ;;
738 R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) 958 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
739 if [ -d /usr/nec ]; then 959 if [ -d /usr/nec ]; then
740 echo mips-nec-sysv${UNAME_RELEASE} 960 echo mips-nec-sysv${UNAME_RELEASE}
741 else 961 else
742 echo mips-unknown-sysv${UNAME_RELEASE} 962 echo mips-unknown-sysv${UNAME_RELEASE}
743 fi 963 fi
744 exit 0 ;; 964 exit 0 ;;
965 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
966 echo powerpc-be-beos
967 exit 0 ;;
968 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
969 echo powerpc-apple-beos
970 exit 0 ;;
971 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
972 echo i586-pc-beos
973 exit 0 ;;
974 SX-4:SUPER-UX:*:*)
975 echo sx4-nec-superux${UNAME_RELEASE}
976 exit 0 ;;
977 SX-5:SUPER-UX:*:*)
978 echo sx5-nec-superux${UNAME_RELEASE}
979 exit 0 ;;
980 Power*:Rhapsody:*:*)
981 echo powerpc-apple-rhapsody${UNAME_RELEASE}
982 exit 0 ;;
983 *:Rhapsody:*:*)
984 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
985 exit 0 ;;
986 *:QNX:*:4*)
987 echo i386-qnx-qnx${UNAME_VERSION}
988 exit 0 ;;
745 esac 989 esac
746 990
747 #echo '(No uname command or uname output not recognized.)' 1>&2 991 #echo '(No uname command or uname output not recognized.)' 1>&2
748 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 992 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
749 993
750 cat >dummy.c <<EOF 994 cat >$dummy.c <<EOF
751 #ifdef _SEQUENT_ 995 #ifdef _SEQUENT_
752 # include <sys/types.h> 996 # include <sys/types.h>
753 # include <sys/utsname.h> 997 # include <sys/utsname.h>
754 #endif 998 #endif
755 main () 999 main ()
783 #if !defined (__ARCHITECTURE__) 1027 #if !defined (__ARCHITECTURE__)
784 #define __ARCHITECTURE__ "m68k" 1028 #define __ARCHITECTURE__ "m68k"
785 #endif 1029 #endif
786 int version; 1030 int version;
787 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1031 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
788 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1032 if (version < 4)
1033 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1034 else
1035 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
789 exit (0); 1036 exit (0);
790 #endif 1037 #endif
791 1038
792 #if defined (MULTIMAX) || defined (n16) 1039 #if defined (MULTIMAX) || defined (n16)
793 #if defined (UMAXV) 1040 #if defined (UMAXV)
843 1090
844 exit (1); 1091 exit (1);
845 } 1092 }
846 EOF 1093 EOF
847 1094
848 ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 1095 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
849 rm -f dummy.c dummy 1096 rm -f $dummy.c $dummy
850 1097
851 # Apollos put the system type in the environment. 1098 # Apollos put the system type in the environment.
852 1099
853 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } 1100 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
854 1101