/[public]/psiconv/trunk/config.guess
ViewVC logotype

Diff of /psiconv/trunk/config.guess

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2 Revision 96
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 3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4# Free Software Foundation, Inc. 4# Free Software Foundation, Inc.
5# 5#
6# 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
7# 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
8# the Free Software Foundation; either version 2 of the License, or 8# the Free Software Foundation; either version 2 of the License, or
21# distribute this file as part of a program that contains a 21# distribute this file as part of a program that contains a
22# configuration script generated by Autoconf, you may include it under 22# configuration script generated by Autoconf, you may include it under
23# 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.
24 24
25# Written by Per Bothner <bothner@cygnus.com>. 25# Written by Per Bothner <bothner@cygnus.com>.
26# The master version of this file is at the FSF in /home/gd/gnu/lib. 26# Please send patches to <config-patches@gnu.org>.
27# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
28# 27#
29# This script attempts to guess a canonical system name similar to 28# This script attempts to guess a canonical system name similar to
30# 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
31# exits with 0. Otherwise, it exits with 1. 30# exits with 0. Otherwise, it exits with 1.
32# 31#
66trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 65trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
67 66
68# Note: order is significant - the case branches are not exclusive. 67# Note: order is significant - the case branches are not exclusive.
69 68
70case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 69case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
70 *:NetBSD:*:*)
71 # Netbsd (nbsd) targets should (where applicable) match one or
72 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
73 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
74 # switched to ELF, *-*-netbsd* would select the old
75 # object file format. This provides both forward
76 # compatibility and a consistent mechanism for selecting the
77 # object file format.
78 # Determine the machine/vendor (is the vendor relevant).
79 case "${UNAME_MACHINE}" in
80 amiga) machine=m68k-cbm ;;
81 arm32) machine=arm-unknown ;;
82 atari*) machine=m68k-atari ;;
83 sun3*) machine=m68k-sun ;;
84 mac68k) machine=m68k-apple ;;
85 macppc) machine=powerpc-apple ;;
86 hp3[0-9][05]) machine=m68k-hp ;;
87 ibmrt|romp-ibm) machine=romp-ibm ;;
88 *) machine=${UNAME_MACHINE}-unknown ;;
89 esac
90 # The Operating System including object format.
91 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
92 | grep __ELF__ >/dev/null
93 then
94 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
95 # Return netbsd for either. FIX?
96 os=netbsd
97 else
98 os=netbsdelf
99 fi
100 # The OS release
101 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
102 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
103 # contains redundant information, the shorter form:
104 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
105 echo "${machine}-${os}${release}"
106 exit 0 ;;
71 alpha:OSF1:*:*) 107 alpha:OSF1:*:*)
72 if test $UNAME_RELEASE = "V4.0"; then 108 if test $UNAME_RELEASE = "V4.0"; then
73 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 109 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
74 fi 110 fi
75 # A Vn.n version is a released version. 111 # A Vn.n version is a released version.
76 # A Tn.n version is a released field test version. 112 # A Tn.n version is a released field test version.
77 # A Xn.n version is an unreleased experimental baselevel. 113 # A Xn.n version is an unreleased experimental baselevel.
78 # 1.2 uses "1.2" for uname -r. 114 # 1.2 uses "1.2" for uname -r.
79 cat <<EOF >$dummy.s 115 cat <<EOF >$dummy.s
116 .data
117\$Lformat:
118 .byte 37,100,45,37,120,10,0 # "%d-%x\n"
119
120 .text
80 .globl main 121 .globl main
122 .align 4
81 .ent main 123 .ent main
82main: 124main:
83 .frame \$30,0,\$26,0 125 .frame \$30,16,\$26,0
126 ldgp \$29,0(\$27)
84 .prologue 0 127 .prologue 1
85 .long 0x47e03d80 # implver $0 128 .long 0x47e03d80 # implver \$0
86 lda \$2,259 129 lda \$2,-1
87 .long 0x47e20c21 # amask $2,$1 130 .long 0x47e20c21 # amask \$2,\$1
88 srl \$1,8,\$2 131 lda \$16,\$Lformat
89 sll \$2,2,\$2 132 mov \$0,\$17
90 sll \$0,3,\$0 133 not \$1,\$18
91 addl \$1,\$0,\$0 134 jsr \$26,printf
92 addl \$2,\$0,\$0 135 ldgp \$29,0(\$26)
93 ret \$31,(\$26),1 136 mov 0,\$16
137 jsr \$26,exit
94 .end main 138 .end main
95EOF 139EOF
96 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null 140 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
97 if test "$?" = 0 ; then 141 if test "$?" = 0 ; then
98 ./$dummy 142 case `./$dummy` in
99 case "$?" in 143 0-0)
100 7)
101 UNAME_MACHINE="alpha" 144 UNAME_MACHINE="alpha"
102 ;; 145 ;;
103 15) 146 1-0)
104 UNAME_MACHINE="alphaev5" 147 UNAME_MACHINE="alphaev5"
105 ;; 148 ;;
106 14) 149 1-1)
107 UNAME_MACHINE="alphaev56" 150 UNAME_MACHINE="alphaev56"
108 ;; 151 ;;
109 10) 152 1-101)
110 UNAME_MACHINE="alphapca56" 153 UNAME_MACHINE="alphapca56"
111 ;; 154 ;;
112 16) 155 2-303)
113 UNAME_MACHINE="alphaev6" 156 UNAME_MACHINE="alphaev6"
157 ;;
158 2-307)
159 UNAME_MACHINE="alphaev67"
114 ;; 160 ;;
115 esac 161 esac
116 fi 162 fi
117 rm -f $dummy.s $dummy 163 rm -f $dummy.s $dummy
118 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 164 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
127 echo alpha-dec-winnt3.5 173 echo alpha-dec-winnt3.5
128 exit 0 ;; 174 exit 0 ;;
129 Amiga*:UNIX_System_V:4.0:*) 175 Amiga*:UNIX_System_V:4.0:*)
130 echo m68k-cbm-sysv4 176 echo m68k-cbm-sysv4
131 exit 0;; 177 exit 0;;
132 amiga:NetBSD:*:*)
133 echo m68k-cbm-netbsd${UNAME_RELEASE}
134 exit 0 ;;
135 amiga:OpenBSD:*:*) 178 amiga:OpenBSD:*:*)
136 echo m68k-unknown-openbsd${UNAME_RELEASE} 179 echo m68k-unknown-openbsd${UNAME_RELEASE}
137 exit 0 ;; 180 exit 0 ;;
138 *:[Aa]miga[Oo][Ss]:*:*) 181 *:[Aa]miga[Oo][Ss]:*:*)
139 echo ${UNAME_MACHINE}-unknown-amigaos 182 echo ${UNAME_MACHINE}-unknown-amigaos
153 sgi:OpenBSD:*:*) 196 sgi:OpenBSD:*:*)
154 echo mips-unknown-openbsd${UNAME_RELEASE} 197 echo mips-unknown-openbsd${UNAME_RELEASE}
155 exit 0 ;; 198 exit 0 ;;
156 wgrisc:OpenBSD:*:*) 199 wgrisc:OpenBSD:*:*)
157 echo mipsel-unknown-openbsd${UNAME_RELEASE} 200 echo mipsel-unknown-openbsd${UNAME_RELEASE}
201 exit 0 ;;
202 *:OS/390:*:*)
203 echo i370-ibm-openedition
158 exit 0 ;; 204 exit 0 ;;
159 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 205 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
160 echo arm-acorn-riscix${UNAME_RELEASE} 206 echo arm-acorn-riscix${UNAME_RELEASE}
161 exit 0;; 207 exit 0;;
162 arm32:NetBSD:*:*)
163 echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
164 exit 0 ;;
165 SR2?01:HI-UX/MPP:*:*) 208 SR2?01:HI-UX/MPP:*:*)
166 echo hppa1.1-hitachi-hiuxmpp 209 echo hppa1.1-hitachi-hiuxmpp
167 exit 0;; 210 exit 0;;
168 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 211 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
169 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 212 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
216 esac 259 esac
217 exit 0 ;; 260 exit 0 ;;
218 aushp:SunOS:*:*) 261 aushp:SunOS:*:*)
219 echo sparc-auspex-sunos${UNAME_RELEASE} 262 echo sparc-auspex-sunos${UNAME_RELEASE}
220 exit 0 ;; 263 exit 0 ;;
221 atari*:NetBSD:*:*)
222 echo m68k-atari-netbsd${UNAME_RELEASE}
223 exit 0 ;;
224 atari*:OpenBSD:*:*) 264 atari*:OpenBSD:*:*)
225 echo m68k-unknown-openbsd${UNAME_RELEASE} 265 echo m68k-unknown-openbsd${UNAME_RELEASE}
226 exit 0 ;; 266 exit 0 ;;
227 # The situation for MiNT is a little confusing. The machine name 267 # The situation for MiNT is a little confusing. The machine name
228 # can be virtually everything (everything which is not 268 # can be virtually everything (everything which is not
229 # "atarist" or "atariste" at least should have a processor 269 # "atarist" or "atariste" at least should have a processor
230 # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 270 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
231 # to the lowercase version "mint" (or "freemint"). Finally 271 # to the lowercase version "mint" (or "freemint"). Finally
232 # the system name "TOS" denotes a system which is actually not 272 # the system name "TOS" denotes a system which is actually not
233 # MiNT. But MiNT is downward compatible to TOS, so this should 273 # MiNT. But MiNT is downward compatible to TOS, so this should
234 # be no problem. 274 # be no problem.
248 echo m68k-hades-mint${UNAME_RELEASE} 288 echo m68k-hades-mint${UNAME_RELEASE}
249 exit 0 ;; 289 exit 0 ;;
250 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 290 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
251 echo m68k-unknown-mint${UNAME_RELEASE} 291 echo m68k-unknown-mint${UNAME_RELEASE}
252 exit 0 ;; 292 exit 0 ;;
253 sun3*:NetBSD:*:*)
254 echo m68k-sun-netbsd${UNAME_RELEASE}
255 exit 0 ;;
256 sun3*:OpenBSD:*:*) 293 sun3*:OpenBSD:*:*)
257 echo m68k-unknown-openbsd${UNAME_RELEASE} 294 echo m68k-unknown-openbsd${UNAME_RELEASE}
258 exit 0 ;; 295 exit 0 ;;
259 mac68k:NetBSD:*:*)
260 echo m68k-apple-netbsd${UNAME_RELEASE}
261 exit 0 ;;
262 mac68k:OpenBSD:*:*) 296 mac68k:OpenBSD:*:*)
263 echo m68k-unknown-openbsd${UNAME_RELEASE} 297 echo m68k-unknown-openbsd${UNAME_RELEASE}
264 exit 0 ;; 298 exit 0 ;;
265 mvme68k:OpenBSD:*:*) 299 mvme68k:OpenBSD:*:*)
266 echo m68k-unknown-openbsd${UNAME_RELEASE} 300 echo m68k-unknown-openbsd${UNAME_RELEASE}
269 echo m88k-unknown-openbsd${UNAME_RELEASE} 303 echo m88k-unknown-openbsd${UNAME_RELEASE}
270 exit 0 ;; 304 exit 0 ;;
271 powerpc:machten:*:*) 305 powerpc:machten:*:*)
272 echo powerpc-apple-machten${UNAME_RELEASE} 306 echo powerpc-apple-machten${UNAME_RELEASE}
273 exit 0 ;; 307 exit 0 ;;
274 macppc:NetBSD:*:*)
275 echo powerpc-apple-netbsd${UNAME_RELEASE}
276 exit 0 ;;
277 RISC*:Mach:*:*) 308 RISC*:Mach:*:*)
278 echo mips-dec-mach_bsd4.3 309 echo mips-dec-mach_bsd4.3
279 exit 0 ;; 310 exit 0 ;;
280 RISC*:ULTRIX:*:*) 311 RISC*:ULTRIX:*:*)
281 echo mips-dec-ultrix${UNAME_RELEASE} 312 echo mips-dec-ultrix${UNAME_RELEASE}
287 echo clipper-intergraph-clix${UNAME_RELEASE} 318 echo clipper-intergraph-clix${UNAME_RELEASE}
288 exit 0 ;; 319 exit 0 ;;
289 mips:*:*:UMIPS | mips:*:*:RISCos) 320 mips:*:*:UMIPS | mips:*:*:RISCos)
290 sed 's/^ //' << EOF >$dummy.c 321 sed 's/^ //' << EOF >$dummy.c
291#ifdef __cplusplus 322#ifdef __cplusplus
323#include <stdio.h> /* for printf() prototype */
292 int main (int argc, char *argv[]) { 324 int main (int argc, char *argv[]) {
293#else 325#else
294 int main (argc, argv) int argc; char *argv[]; { 326 int main (argc, argv) int argc; char *argv[]; {
295#endif 327#endif
296 #if defined (host_mips) && defined (MIPSEB) 328 #if defined (host_mips) && defined (MIPSEB)
326 echo m88k-motorola-sysv3 358 echo m88k-motorola-sysv3
327 exit 0 ;; 359 exit 0 ;;
328 AViiON:dgux:*:*) 360 AViiON:dgux:*:*)
329 # DG/UX returns AViiON for all architectures 361 # DG/UX returns AViiON for all architectures
330 UNAME_PROCESSOR=`/usr/bin/uname -p` 362 UNAME_PROCESSOR=`/usr/bin/uname -p`
331 if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then 363 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
364 then
332 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ 365 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
333 -o ${TARGET_BINARY_INTERFACE}x = x ] ; then 366 [ ${TARGET_BINARY_INTERFACE}x = x ]
367 then
334 echo m88k-dg-dgux${UNAME_RELEASE} 368 echo m88k-dg-dgux${UNAME_RELEASE}
335 else 369 else
336 echo m88k-dg-dguxbcs${UNAME_RELEASE} 370 echo m88k-dg-dguxbcs${UNAME_RELEASE}
337 fi 371 fi
372 else
338 else echo i586-dg-dgux${UNAME_RELEASE} 373 echo i586-dg-dgux${UNAME_RELEASE}
339 fi 374 fi
340 exit 0 ;; 375 exit 0 ;;
341 M88*:DolphinOS:*:*) # DolphinOS (SVR3) 376 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
342 echo m88k-dolphin-sysv3 377 echo m88k-dolphin-sysv3
343 exit 0 ;; 378 exit 0 ;;
344 M88*:*:R3*:*) 379 M88*:*:R3*:*)
400 echo rs6000-ibm-aix 435 echo rs6000-ibm-aix
401 exit 0 ;; 436 exit 0 ;;
402 ibmrt:4.4BSD:*|romp-ibm:BSD:*) 437 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
403 echo romp-ibm-bsd4.4 438 echo romp-ibm-bsd4.4
404 exit 0 ;; 439 exit 0 ;;
405 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and 440 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
406 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 441 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
407 exit 0 ;; # report: romp-ibm BSD 4.3 442 exit 0 ;; # report: romp-ibm BSD 4.3
408 *:BOSX:*:*) 443 *:BOSX:*:*)
409 echo rs6000-bull-bosx 444 echo rs6000-bull-bosx
410 exit 0 ;; 445 exit 0 ;;
421 case "${UNAME_MACHINE}" in 456 case "${UNAME_MACHINE}" in
422 9000/31? ) HP_ARCH=m68000 ;; 457 9000/31? ) HP_ARCH=m68000 ;;
423 9000/[34]?? ) HP_ARCH=m68k ;; 458 9000/[34]?? ) HP_ARCH=m68k ;;
424 9000/[678][0-9][0-9]) 459 9000/[678][0-9][0-9])
425 sed 's/^ //' << EOF >$dummy.c 460 sed 's/^ //' << EOF >$dummy.c
461
462 #define _HPUX_SOURCE
426 #include <stdlib.h> 463 #include <stdlib.h>
427 #include <unistd.h> 464 #include <unistd.h>
428 465
429 int main () 466 int main ()
430 { 467 {
451 default: puts ("hppa1.0"); break; 488 default: puts ("hppa1.0"); break;
452 } 489 }
453 exit (0); 490 exit (0);
454 } 491 }
455EOF 492EOF
456 ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` 493 (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
457 rm -f $dummy.c $dummy 494 rm -f $dummy.c $dummy
458 esac 495 esac
459 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 496 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
460 echo ${HP_ARCH}-hp-hpux${HPUX_REV} 497 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
461 exit 0 ;; 498 exit 0 ;;
545 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 582 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
546 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 583 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
547 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ 584 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
548 exit 0 ;; 585 exit 0 ;;
549 CRAY*TS:*:*:*) 586 CRAY*TS:*:*:*)
550 echo t90-cray-unicos${UNAME_RELEASE} 587 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
551 exit 0 ;; 588 exit 0 ;;
552 CRAY*T3E:*:*:*) 589 CRAY*T3E:*:*:*)
553 echo t3e-cray-unicosmk${UNAME_RELEASE} 590 echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
591 exit 0 ;;
592 CRAY*SV1:*:*:*)
593 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
554 exit 0 ;; 594 exit 0 ;;
555 CRAY-2:*:*:*) 595 CRAY-2:*:*:*)
556 echo cray2-cray-unicos 596 echo cray2-cray-unicos
557 exit 0 ;; 597 exit 0 ;;
558 F300:UNIX_System_V:*:*) 598 F300:UNIX_System_V:*:*)
561 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 601 echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
562 exit 0 ;; 602 exit 0 ;;
563 F301:UNIX_System_V:*:*) 603 F301:UNIX_System_V:*:*)
564 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` 604 echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
565 exit 0 ;; 605 exit 0 ;;
566 hp3[0-9][05]:NetBSD:*:*)
567 echo m68k-hp-netbsd${UNAME_RELEASE}
568 exit 0 ;;
569 hp300:OpenBSD:*:*) 606 hp300:OpenBSD:*:*)
570 echo m68k-unknown-openbsd${UNAME_RELEASE} 607 echo m68k-unknown-openbsd${UNAME_RELEASE}
571 exit 0 ;; 608 exit 0 ;;
572 i?86:BSD/386:*:* | i?86:BSD/OS:*:*) 609 i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
573 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 610 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
574 exit 0 ;; 611 exit 0 ;;
575 sparc*:BSD/OS:*:*) 612 sparc*:BSD/OS:*:*)
576 echo sparc-unknown-bsdi${UNAME_RELEASE} 613 echo sparc-unknown-bsdi${UNAME_RELEASE}
577 exit 0 ;; 614 exit 0 ;;
578 *:BSD/OS:*:*) 615 *:BSD/OS:*:*)
579 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 616 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
580 exit 0 ;; 617 exit 0 ;;
581 *:FreeBSD:*:*) 618 *:FreeBSD:*:*)
582 if test -x /usr/bin/objformat; then
583 if test "elf" = "`/usr/bin/objformat`"; then
584 echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
585 exit 0
586 fi
587 fi
588 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 619 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
589 exit 0 ;;
590 *:NetBSD:*:*)
591 echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
592 exit 0 ;; 620 exit 0 ;;
593 *:OpenBSD:*:*) 621 *:OpenBSD:*:*)
594 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 622 echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
595 exit 0 ;; 623 exit 0 ;;
596 i*:CYGWIN*:*) 624 i*:CYGWIN*:*)
616 exit 0 ;; 644 exit 0 ;;
617 *:GNU:*:*) 645 *:GNU:*:*)
618 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 646 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
619 exit 0 ;; 647 exit 0 ;;
620 *:Linux:*:*) 648 *:Linux:*:*)
621 # uname on the ARM produces all sorts of strangeness, and we need to
622 # filter it out.
623 case "$UNAME_MACHINE" in
624 armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
625 arm* | sa110*) UNAME_MACHINE="arm" ;;
626 esac
627 649
628 # The BFD linker knows what the default object file format is, so 650 # The BFD linker knows what the default object file format is, so
629 # first see if it will tell us. cd to the root directory to prevent 651 # first see if it will tell us. cd to the root directory to prevent
630 # problems with other programs or directories called `ld' in the path. 652 # problems with other programs or directories called `ld' in the path.
631 ld_help_string=`cd /; ld --help 2>&1` 653 ld_help_string=`cd /; ld --help 2>&1`
634 s/[ ][ ]*/ /g 656 s/[ ][ ]*/ /g
635 s/.*supported emulations: *// 657 s/.*supported emulations: *//
636 s/ .*// 658 s/ .*//
637 p'` 659 p'`
638 case "$ld_supported_emulations" in 660 case "$ld_supported_emulations" in
639 i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; 661 *ia64)
640 i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; 662 echo "${UNAME_MACHINE}-unknown-linux"
663 exit 0
664 ;;
665 i?86linux)
666 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
667 exit 0
668 ;;
669 elf_i?86)
670 echo "${UNAME_MACHINE}-pc-linux"
671 exit 0
672 ;;
673 i?86coff)
674 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
675 exit 0
676 ;;
677 sparclinux)
641 sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 678 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
679 exit 0
680 ;;
681 armlinux)
642 armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 682 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
683 exit 0
684 ;;
685 elf32arm*)
686 echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
687 exit 0
688 ;;
689 armelf_linux*)
690 echo "${UNAME_MACHINE}-unknown-linux-gnu"
691 exit 0
692 ;;
693 m68klinux)
643 m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; 694 echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
644 elf32ppc) 695 exit 0
696 ;;
697 elf32ppc | elf32ppclinux)
645 # Determine Lib Version 698 # Determine Lib Version
646 cat >$dummy.c <<EOF 699 cat >$dummy.c <<EOF
647#include <features.h> 700#include <features.h>
648#if defined(__GLIBC__) 701#if defined(__GLIBC__)
649extern char __libc_version[]; 702extern char __libc_version[];
666 if test "$?" = 0 ; then 719 if test "$?" = 0 ; then
667 ./$dummy | grep 1\.99 > /dev/null 720 ./$dummy | grep 1\.99 > /dev/null
668 if test "$?" = 0 ; then 721 if test "$?" = 0 ; then
669 LIBC="libc1" 722 LIBC="libc1"
670 fi 723 fi
671 fi 724 fi
672 rm -f $dummy.c $dummy 725 rm -f $dummy.c $dummy
673 echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; 726 echo powerpc-unknown-linux-gnu${LIBC}
727 exit 0
728 ;;
674 esac 729 esac
675 730
676 if test "${UNAME_MACHINE}" = "alpha" ; then 731 if test "${UNAME_MACHINE}" = "alpha" ; then
677 sed 's/^ //' <<EOF >$dummy.s 732 cat <<EOF >$dummy.s
733 .data
734 \$Lformat:
735 .byte 37,100,45,37,120,10,0 # "%d-%x\n"
736
737 .text
678 .globl main 738 .globl main
739 .align 4
679 .ent main 740 .ent main
680 main: 741 main:
681 .frame \$30,0,\$26,0 742 .frame \$30,16,\$26,0
743 ldgp \$29,0(\$27)
682 .prologue 0 744 .prologue 1
683 .long 0x47e03d80 # implver $0 745 .long 0x47e03d80 # implver \$0
684 lda \$2,259 746 lda \$2,-1
685 .long 0x47e20c21 # amask $2,$1 747 .long 0x47e20c21 # amask \$2,\$1
686 srl \$1,8,\$2 748 lda \$16,\$Lformat
687 sll \$2,2,\$2 749 mov \$0,\$17
688 sll \$0,3,\$0 750 not \$1,\$18
689 addl \$1,\$0,\$0 751 jsr \$26,printf
690 addl \$2,\$0,\$0 752 ldgp \$29,0(\$26)
691 ret \$31,(\$26),1 753 mov 0,\$16
754 jsr \$26,exit
692 .end main 755 .end main
693EOF 756EOF
694 LIBC="" 757 LIBC=""
695 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null 758 $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
696 if test "$?" = 0 ; then 759 if test "$?" = 0 ; then
697 ./$dummy 760 case `./$dummy` in
698 case "$?" in 761 0-0)
699 7)
700 UNAME_MACHINE="alpha" 762 UNAME_MACHINE="alpha"
701 ;; 763 ;;
702 15) 764 1-0)
703 UNAME_MACHINE="alphaev5" 765 UNAME_MACHINE="alphaev5"
704 ;; 766 ;;
705 14) 767 1-1)
706 UNAME_MACHINE="alphaev56" 768 UNAME_MACHINE="alphaev56"
707 ;; 769 ;;
708 10) 770 1-101)
709 UNAME_MACHINE="alphapca56" 771 UNAME_MACHINE="alphapca56"
710 ;; 772 ;;
711 16) 773 2-303)
712 UNAME_MACHINE="alphaev6" 774 UNAME_MACHINE="alphaev6"
775 ;;
776 2-307)
777 UNAME_MACHINE="alphaev67"
713 ;; 778 ;;
714 esac 779 esac
715 780
716 objdump --private-headers $dummy | \ 781 objdump --private-headers $dummy | \
717 grep ld.so.1 > /dev/null 782 grep ld.so.1 > /dev/null
722 rm -f $dummy.s $dummy 787 rm -f $dummy.s $dummy
723 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 788 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
724 elif test "${UNAME_MACHINE}" = "mips" ; then 789 elif test "${UNAME_MACHINE}" = "mips" ; then
725 cat >$dummy.c <<EOF 790 cat >$dummy.c <<EOF
726#ifdef __cplusplus 791#ifdef __cplusplus
792#include <stdio.h> /* for printf() prototype */
727 int main (int argc, char *argv[]) { 793 int main (int argc, char *argv[]) {
728#else 794#else
729 int main (argc, argv) int argc; char *argv[]; { 795 int main (argc, argv) int argc; char *argv[]; {
730#endif 796#endif
731#ifdef __MIPSEB__ 797#ifdef __MIPSEB__
737 return 0; 803 return 0;
738} 804}
739EOF 805EOF
740 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 806 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
741 rm -f $dummy.c $dummy 807 rm -f $dummy.c $dummy
808 elif test "${UNAME_MACHINE}" = "s390"; then
809 echo s390-ibm-linux && exit 0
742 else 810 else
743 # Either a pre-BFD a.out linker (linux-gnuoldld) 811 # Either a pre-BFD a.out linker (linux-gnuoldld)
744 # or one that does not give us useful --help. 812 # or one that does not give us useful --help.
745 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. 813 # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
746 # If ld does not provide *any* "supported emulations:" 814 # If ld does not provide *any* "supported emulations:"
758 esac 826 esac
759 # Determine whether the default compiler is a.out or elf 827 # Determine whether the default compiler is a.out or elf
760 cat >$dummy.c <<EOF 828 cat >$dummy.c <<EOF
761#include <features.h> 829#include <features.h>
762#ifdef __cplusplus 830#ifdef __cplusplus
831#include <stdio.h> /* for printf() prototype */
763 int main (int argc, char *argv[]) { 832 int main (int argc, char *argv[]) {
764#else 833#else
765 int main (argc, argv) int argc; char *argv[]; { 834 int main (argc, argv) int argc; char *argv[]; {
766#endif 835#endif
767#ifdef __ELF__ 836#ifdef __ELF__
795 # I just have to hope. -- rms. 864 # I just have to hope. -- rms.
796 # Use sysv4.2uw... so that sysv4* matches it. 865 # Use sysv4.2uw... so that sysv4* matches it.
797 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 866 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
798 exit 0 ;; 867 exit 0 ;;
799 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) 868 i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
869 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
800 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 870 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
801 echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} 871 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
802 else 872 else
803 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} 873 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
804 fi 874 fi
805 exit 0 ;; 875 exit 0 ;;
806 i?86:*:5:7*) 876 i?86:*:5:7*)
807 UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` 877 # Fixed at (any) Pentium or better
808 (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 878 UNAME_MACHINE=i586
809 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 879 if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
810 (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 880 echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
811 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 881 else
812 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} 882 echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
883 fi
813 exit 0 ;; 884 exit 0 ;;
814 i?86:*:3.2:*) 885 i?86:*:3.2:*)
815 if test -f /usr/options/cb.name; then 886 if test -f /usr/options/cb.name; then
816 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 887 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
817 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 888 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
827 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 898 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
828 else 899 else
829 echo ${UNAME_MACHINE}-pc-sysv32 900 echo ${UNAME_MACHINE}-pc-sysv32
830 fi 901 fi
831 exit 0 ;; 902 exit 0 ;;
903 i?86:*DOS:*:*)
904 echo ${UNAME_MACHINE}-pc-msdosdjgpp
905 exit 0 ;;
832 pc:*:*:*) 906 pc:*:*:*)
907 # Left here for compatibility:
833 # uname -m prints for DJGPP always 'pc', but it prints nothing about 908 # uname -m prints for DJGPP always 'pc', but it prints nothing about
834 # the processor, so we play safe by assuming i386. 909 # the processor, so we play safe by assuming i386.
835 echo i386-pc-msdosdjgpp 910 echo i386-pc-msdosdjgpp
836 exit 0 ;; 911 exit 0 ;;
837 Intel:Mach:3*:*) 912 Intel:Mach:3*:*)
941 echo powerpc-apple-rhapsody${UNAME_RELEASE} 1016 echo powerpc-apple-rhapsody${UNAME_RELEASE}
942 exit 0 ;; 1017 exit 0 ;;
943 *:Rhapsody:*:*) 1018 *:Rhapsody:*:*)
944 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1019 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
945 exit 0 ;; 1020 exit 0 ;;
1021 *:Darwin:*:*)
1022 echo `uname -p`-apple-darwin${UNAME_RELEASE}
1023 exit 0 ;;
1024 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1025 if test "${UNAME_MACHINE}" = "x86pc"; then
1026 UNAME_MACHINE=pc
1027 fi
1028 echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1029 exit 0 ;;
1030 *:QNX:*:4*)
1031 echo i386-pc-qnx
1032 exit 0 ;;
1033 NSR-W:NONSTOP_KERNEL:*:*)
1034 echo nsr-tandem-nsk${UNAME_RELEASE}
1035 exit 0 ;;
1036 BS2000:POSIX*:*:*)
1037 echo bs2000-siemens-sysv
1038 exit 0 ;;
1039 DS/*:UNIX_System_V:*:*)
1040 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1041 exit 0 ;;
946esac 1042esac
947 1043
948#echo '(No uname command or uname output not recognized.)' 1>&2 1044#echo '(No uname command or uname output not recognized.)' 1>&2
949#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1045#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
950 1046

Legend:
Removed from v.2  
changed lines
  Added in v.96

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26