common/autoconf/build-aux/autoconf-config.guess

changeset 794
8dadd26c2a58
parent 576
b66c81dfa291
child 1133
50aaf272884f
equal deleted inserted replaced
788:0874bb4707b7 794:8dadd26c2a58
24 # questions. 24 # questions.
25 # 25 #
26 26
27 # Attempt to guess a canonical system name. 27 # Attempt to guess a canonical system name.
28 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 28 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
29 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 29 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
30 # Free Software Foundation, Inc. 30 # 2011, 2012 Free Software Foundation, Inc.
31 31
32 timestamp='2008-01-23' 32 timestamp='2012-02-10'
33 33
34 # This file is free software; you can redistribute it and/or modify it 34 # This file is free software; you can redistribute it and/or modify it
35 # under the terms of the GNU General Public License as published by 35 # under the terms of the GNU General Public License as published by
36 # the Free Software Foundation; either version 2 of the License, or 36 # the Free Software Foundation; either version 2 of the License, or
37 # (at your option) any later version. 37 # (at your option) any later version.
40 # WITHOUT ANY WARRANTY; without even the implied warranty of 40 # WITHOUT ANY WARRANTY; without even the implied warranty of
41 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 41 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42 # General Public License for more details. 42 # General Public License for more details.
43 # 43 #
44 # You should have received a copy of the GNU General Public License 44 # You should have received a copy of the GNU General Public License
45 # along with this program; if not, write to the Free Software 45 # along with this program; if not, see <http://www.gnu.org/licenses/>.
46 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
47 # 02110-1301, USA.
48 # 46 #
49 # As a special exception to the GNU General Public License, if you 47 # As a special exception to the GNU General Public License, if you
50 # distribute this file as part of a program that contains a 48 # distribute this file as part of a program that contains a
51 # configuration script generated by Autoconf, you may include it under 49 # configuration script generated by Autoconf, you may include it under
52 # the same distribution terms that you use for the rest of that program. 50 # the same distribution terms that you use for the rest of that program.
53 51
54 52
55 # Originally written by Per Bothner <per@bothner.com>. 53 # Originally written by Per Bothner. Please send patches (context
56 # Please send patches to <config-patches@gnu.org>. Submit a context 54 # diff format) to <config-patches@gnu.org> and include a ChangeLog
57 # diff and a properly formatted ChangeLog entry. 55 # entry.
58 # 56 #
59 # This script attempts to guess a canonical system name similar to 57 # This script attempts to guess a canonical system name similar to
60 # config.sub. If it succeeds, it prints the system name on stdout, and 58 # config.sub. If it succeeds, it prints the system name on stdout, and
61 # exits with 0. Otherwise, it exits with 1. 59 # exits with 0. Otherwise, it exits with 1.
62 # 60 #
63 # The plan is that this can be called by configure scripts if you 61 # You can get the latest version of this script from:
64 # don't specify an explicit build system type. 62 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
65 63
66 me=`echo "$0" | sed -e 's,.*/,,'` 64 me=`echo "$0" | sed -e 's,.*/,,'`
67 65
68 usage="\ 66 usage="\
69 Usage: $0 [OPTION] 67 Usage: $0 [OPTION]
79 77
80 version="\ 78 version="\
81 GNU config.guess ($timestamp) 79 GNU config.guess ($timestamp)
82 80
83 Originally written by Per Bothner. 81 Originally written by Per Bothner.
84 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 82 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
85 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 83 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
84 Free Software Foundation, Inc.
86 85
87 This is free software; see the source for copying conditions. There is NO 86 This is free software; see the source for copying conditions. There is NO
88 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 87 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
89 88
90 help=" 89 help="
167 # Note: order is significant - the case branches are not exclusive. 166 # Note: order is significant - the case branches are not exclusive.
168 167
169 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 168 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
170 *:NetBSD:*:*) 169 *:NetBSD:*:*)
171 # NetBSD (nbsd) targets should (where applicable) match one or 170 # NetBSD (nbsd) targets should (where applicable) match one or
172 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 171 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
173 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 172 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
174 # switched to ELF, *-*-netbsd* would select the old 173 # switched to ELF, *-*-netbsd* would select the old
175 # object file format. This provides both forward 174 # object file format. This provides both forward
176 # compatibility and a consistent mechanism for selecting the 175 # compatibility and a consistent mechanism for selecting the
177 # object file format. 176 # object file format.
193 # to ELF recently, or will in the future. 192 # to ELF recently, or will in the future.
194 case "${UNAME_MACHINE_ARCH}" in 193 case "${UNAME_MACHINE_ARCH}" in
195 arm*|i386|m68k|ns32k|sh3*|sparc|vax) 194 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
196 eval $set_cc_for_build 195 eval $set_cc_for_build
197 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 196 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
198 | grep __ELF__ >/dev/null 197 | grep -q __ELF__
199 then 198 then
200 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 199 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
201 # Return netbsd for either. FIX? 200 # Return netbsd for either. FIX?
202 os=netbsd 201 os=netbsd
203 else 202 else
204 os=netbsdelf 203 os=netbsdelf
205 fi 204 fi
206 ;; 205 ;;
207 *) 206 *)
208 os=netbsd 207 os=netbsd
209 ;; 208 ;;
210 esac 209 esac
211 # The OS release 210 # The OS release
212 # Debian GNU/NetBSD machines have a different userland, and 211 # Debian GNU/NetBSD machines have a different userland, and
213 # thus, need a distinct triplet. However, they do not need 212 # thus, need a distinct triplet. However, they do not need
246 case $UNAME_RELEASE in 245 case $UNAME_RELEASE in
247 *4.0) 246 *4.0)
248 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 247 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
249 ;; 248 ;;
250 *5.*) 249 *5.*)
251 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 250 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
252 ;; 251 ;;
253 esac 252 esac
254 # According to Compaq, /usr/sbin/psrinfo has been available on 253 # According to Compaq, /usr/sbin/psrinfo has been available on
255 # OSF/1 and Tru64 systems produced since 1995. I hope that 254 # OSF/1 and Tru64 systems produced since 1995. I hope that
256 # covers most systems running today. This code pipes the CPU 255 # covers most systems running today. This code pipes the CPU
292 # A Vn.n version is a released version. 291 # A Vn.n version is a released version.
293 # A Tn.n version is a released field test version. 292 # A Tn.n version is a released field test version.
294 # A Xn.n version is an unreleased experimental baselevel. 293 # A Xn.n version is an unreleased experimental baselevel.
295 # 1.2 uses "1.2" for uname -r. 294 # 1.2 uses "1.2" for uname -r.
296 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 295 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
297 exit ;; 296 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
297 exitcode=$?
298 trap '' 0
299 exit $exitcode ;;
298 Alpha\ *:Windows_NT*:*) 300 Alpha\ *:Windows_NT*:*)
299 # How do we know it's Interix rather than the generic POSIX subsystem? 301 # How do we know it's Interix rather than the generic POSIX subsystem?
300 # Should we change UNAME_MACHINE based on the output of uname instead 302 # Should we change UNAME_MACHINE based on the output of uname instead
301 # of the specific Alpha model? 303 # of the specific Alpha model?
302 echo alpha-pc-interix 304 echo alpha-pc-interix
318 exit ;; 320 exit ;;
319 *:z/VM:*:*) 321 *:z/VM:*:*)
320 echo s390-ibm-zvmoe 322 echo s390-ibm-zvmoe
321 exit ;; 323 exit ;;
322 *:OS400:*:*) 324 *:OS400:*:*)
323 echo powerpc-ibm-os400 325 echo powerpc-ibm-os400
324 exit ;; 326 exit ;;
325 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 327 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
326 echo arm-acorn-riscix${UNAME_RELEASE} 328 echo arm-acorn-riscix${UNAME_RELEASE}
327 exit ;; 329 exit ;;
328 arm:riscos:*:*|arm:RISCOS:*:*) 330 arm:riscos:*:*|arm:RISCOS:*:*)
347 exit ;; 349 exit ;;
348 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 350 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
349 case `/usr/bin/uname -p` in 351 case `/usr/bin/uname -p` in
350 sparc) echo sparc-icl-nx7; exit ;; 352 sparc) echo sparc-icl-nx7; exit ;;
351 esac ;; 353 esac ;;
354 s390x:SunOS:*:*)
355 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356 exit ;;
352 sun4H:SunOS:5.*:*) 357 sun4H:SunOS:5.*:*)
353 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 358 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
354 exit ;; 359 exit ;;
355 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 360 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
356 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 361 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
357 exit ;; 362 exit ;;
363 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
364 echo i386-pc-auroraux${UNAME_RELEASE}
365 exit ;;
358 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 366 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
359 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 367 eval $set_cc_for_build
368 SUN_ARCH="i386"
369 # If there is a compiler, see if it is configured for 64-bit objects.
370 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
371 # This test works for both compilers.
372 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
373 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
374 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
375 grep IS_64BIT_ARCH >/dev/null
376 then
377 SUN_ARCH="x86_64"
378 fi
379 fi
380 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
360 exit ;; 381 exit ;;
361 sun4*:SunOS:6*:*) 382 sun4*:SunOS:6*:*)
362 # According to config.sub, this is the proper way to canonicalize 383 # According to config.sub, this is the proper way to canonicalize
363 # SunOS6. Hard to guess exactly what SunOS6 will be like, but 384 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
364 # it's likely to be more like Solaris than SunOS4. 385 # it's likely to be more like Solaris than SunOS4.
398 # to the lowercase version "mint" (or "freemint"). Finally 419 # to the lowercase version "mint" (or "freemint"). Finally
399 # the system name "TOS" denotes a system which is actually not 420 # the system name "TOS" denotes a system which is actually not
400 # MiNT. But MiNT is downward compatible to TOS, so this should 421 # MiNT. But MiNT is downward compatible to TOS, so this should
401 # be no problem. 422 # be no problem.
402 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 423 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
403 echo m68k-atari-mint${UNAME_RELEASE} 424 echo m68k-atari-mint${UNAME_RELEASE}
404 exit ;; 425 exit ;;
405 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 426 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
406 echo m68k-atari-mint${UNAME_RELEASE} 427 echo m68k-atari-mint${UNAME_RELEASE}
407 exit ;; 428 exit ;;
408 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 429 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
409 echo m68k-atari-mint${UNAME_RELEASE} 430 echo m68k-atari-mint${UNAME_RELEASE}
410 exit ;; 431 exit ;;
411 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 432 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
412 echo m68k-milan-mint${UNAME_RELEASE} 433 echo m68k-milan-mint${UNAME_RELEASE}
413 exit ;; 434 exit ;;
414 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 435 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
415 echo m68k-hades-mint${UNAME_RELEASE} 436 echo m68k-hades-mint${UNAME_RELEASE}
416 exit ;; 437 exit ;;
417 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 438 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
418 echo m68k-unknown-mint${UNAME_RELEASE} 439 echo m68k-unknown-mint${UNAME_RELEASE}
419 exit ;; 440 exit ;;
420 m68k:machten:*:*) 441 m68k:machten:*:*)
421 echo m68k-apple-machten${UNAME_RELEASE} 442 echo m68k-apple-machten${UNAME_RELEASE}
422 exit ;; 443 exit ;;
423 powerpc:machten:*:*) 444 powerpc:machten:*:*)
424 echo powerpc-apple-machten${UNAME_RELEASE} 445 echo powerpc-apple-machten${UNAME_RELEASE}
484 exit ;; 505 exit ;;
485 m88k:*:3*:R3*) 506 m88k:*:3*:R3*)
486 echo m88k-motorola-sysv3 507 echo m88k-motorola-sysv3
487 exit ;; 508 exit ;;
488 AViiON:dgux:*:*) 509 AViiON:dgux:*:*)
489 # DG/UX returns AViiON for all architectures 510 # DG/UX returns AViiON for all architectures
490 UNAME_PROCESSOR=`/usr/bin/uname -p` 511 UNAME_PROCESSOR=`/usr/bin/uname -p`
491 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 512 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
492 then 513 then
493 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 514 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
494 [ ${TARGET_BINARY_INTERFACE}x = x ] 515 [ ${TARGET_BINARY_INTERFACE}x = x ]
495 then 516 then
498 echo m88k-dg-dguxbcs${UNAME_RELEASE} 519 echo m88k-dg-dguxbcs${UNAME_RELEASE}
499 fi 520 fi
500 else 521 else
501 echo i586-dg-dgux${UNAME_RELEASE} 522 echo i586-dg-dgux${UNAME_RELEASE}
502 fi 523 fi
503 exit ;; 524 exit ;;
504 M88*:DolphinOS:*:*) # DolphinOS (SVR3) 525 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
505 echo m88k-dolphin-sysv3 526 echo m88k-dolphin-sysv3
506 exit ;; 527 exit ;;
507 M88*:*:R3*:*) 528 M88*:*:R3*:*)
508 # Delta 88k system running SVR3 529 # Delta 88k system running SVR3
555 echo rs6000-ibm-aix3.2.4 576 echo rs6000-ibm-aix3.2.4
556 else 577 else
557 echo rs6000-ibm-aix3.2 578 echo rs6000-ibm-aix3.2
558 fi 579 fi
559 exit ;; 580 exit ;;
560 *:AIX:*:[456]) 581 *:AIX:*:[4567])
561 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 582 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
562 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 583 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
563 IBM_ARCH=rs6000 584 IBM_ARCH=rs6000
564 else 585 else
565 IBM_ARCH=powerpc 586 IBM_ARCH=powerpc
598 9000/31? ) HP_ARCH=m68000 ;; 619 9000/31? ) HP_ARCH=m68000 ;;
599 9000/[34]?? ) HP_ARCH=m68k ;; 620 9000/[34]?? ) HP_ARCH=m68k ;;
600 9000/[678][0-9][0-9]) 621 9000/[678][0-9][0-9])
601 if [ -x /usr/bin/getconf ]; then 622 if [ -x /usr/bin/getconf ]; then
602 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 623 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
603 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 624 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
604 case "${sc_cpu_version}" in 625 case "${sc_cpu_version}" in
605 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 626 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
606 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 627 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
607 532) # CPU_PA_RISC2_0 628 532) # CPU_PA_RISC2_0
608 case "${sc_kernel_bits}" in 629 case "${sc_kernel_bits}" in
609 32) HP_ARCH="hppa2.0n" ;; 630 32) HP_ARCH="hppa2.0n" ;;
610 64) HP_ARCH="hppa2.0w" ;; 631 64) HP_ARCH="hppa2.0w" ;;
611 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 632 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
612 esac ;; 633 esac ;;
613 esac 634 esac
614 fi 635 fi
615 if [ "${HP_ARCH}" = "" ]; then 636 if [ "${HP_ARCH}" = "" ]; then
616 eval $set_cc_for_build 637 eval $set_cc_for_build
617 sed 's/^ //' << EOF >$dummy.c 638 sed 's/^ //' << EOF >$dummy.c
618 639
619 #define _HPUX_SOURCE 640 #define _HPUX_SOURCE
620 #include <stdlib.h> 641 #include <stdlib.h>
621 #include <unistd.h> 642 #include <unistd.h>
622 643
623 int main () 644 int main ()
624 { 645 {
625 #if defined(_SC_KERNEL_BITS) 646 #if defined(_SC_KERNEL_BITS)
626 long bits = sysconf(_SC_KERNEL_BITS); 647 long bits = sysconf(_SC_KERNEL_BITS);
627 #endif 648 #endif
628 long cpu = sysconf (_SC_CPU_VERSION); 649 long cpu = sysconf (_SC_CPU_VERSION);
629 650
630 switch (cpu) 651 switch (cpu)
631 { 652 {
632 case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 653 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
633 case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 654 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
634 case CPU_PA_RISC2_0: 655 case CPU_PA_RISC2_0:
635 #if defined(_SC_KERNEL_BITS) 656 #if defined(_SC_KERNEL_BITS)
636 switch (bits) 657 switch (bits)
637 { 658 {
638 case 64: puts ("hppa2.0w"); break; 659 case 64: puts ("hppa2.0w"); break;
639 case 32: puts ("hppa2.0n"); break; 660 case 32: puts ("hppa2.0n"); break;
640 default: puts ("hppa2.0"); break; 661 default: puts ("hppa2.0"); break;
641 } break; 662 } break;
642 #else /* !defined(_SC_KERNEL_BITS) */ 663 #else /* !defined(_SC_KERNEL_BITS) */
643 puts ("hppa2.0"); break; 664 puts ("hppa2.0"); break;
644 #endif 665 #endif
645 default: puts ("hppa1.0"); break; 666 default: puts ("hppa1.0"); break;
646 } 667 }
647 exit (0); 668 exit (0);
648 } 669 }
649 EOF 670 EOF
650 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 671 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
651 test -z "$HP_ARCH" && HP_ARCH=hppa 672 test -z "$HP_ARCH" && HP_ARCH=hppa
652 fi ;; 673 fi ;;
653 esac 674 esac
663 # => hppa2.0w-hp-hpux11.23 684 # => hppa2.0w-hp-hpux11.23
664 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 685 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
665 # => hppa64-hp-hpux11.23 686 # => hppa64-hp-hpux11.23
666 687
667 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 688 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
668 grep __LP64__ >/dev/null 689 grep -q __LP64__
669 then 690 then
670 HP_ARCH="hppa2.0w" 691 HP_ARCH="hppa2.0w"
671 else 692 else
672 HP_ARCH="hppa64" 693 HP_ARCH="hppa64"
673 fi 694 fi
734 parisc*:Lites*:*:*) 755 parisc*:Lites*:*:*)
735 echo hppa1.1-hp-lites 756 echo hppa1.1-hp-lites
736 exit ;; 757 exit ;;
737 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 758 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
738 echo c1-convex-bsd 759 echo c1-convex-bsd
739 exit ;; 760 exit ;;
740 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 761 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
741 if getsysinfo -f scalar_acc 762 if getsysinfo -f scalar_acc
742 then echo c32-convex-bsd 763 then echo c32-convex-bsd
743 else echo c2-convex-bsd 764 else echo c2-convex-bsd
744 fi 765 fi
745 exit ;; 766 exit ;;
746 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 767 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
747 echo c34-convex-bsd 768 echo c34-convex-bsd
748 exit ;; 769 exit ;;
749 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 770 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
750 echo c38-convex-bsd 771 echo c38-convex-bsd
751 exit ;; 772 exit ;;
752 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 773 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
753 echo c4-convex-bsd 774 echo c4-convex-bsd
754 exit ;; 775 exit ;;
755 CRAY*Y-MP:*:*:*) 776 CRAY*Y-MP:*:*:*)
756 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 777 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
757 exit ;; 778 exit ;;
758 CRAY*[A-Z]90:*:*:*) 779 CRAY*[A-Z]90:*:*:*)
759 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 780 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
773 *:UNICOS/mp:*:*) 794 *:UNICOS/mp:*:*)
774 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 795 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
775 exit ;; 796 exit ;;
776 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 797 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
777 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 798 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
778 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 799 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 800 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
780 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 801 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781 exit ;; 802 exit ;;
782 5000:UNIX_System_V:4.*:*) 803 5000:UNIX_System_V:4.*:*)
783 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 804 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
784 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 805 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
785 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 806 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
786 exit ;; 807 exit ;;
787 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 808 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
788 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 809 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
789 exit ;; 810 exit ;;
790 sparc*:BSD/OS:*:*) 811 sparc*:BSD/OS:*:*)
792 exit ;; 813 exit ;;
793 *:BSD/OS:*:*) 814 *:BSD/OS:*:*)
794 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 815 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
795 exit ;; 816 exit ;;
796 *:FreeBSD:*:*) 817 *:FreeBSD:*:*)
797 case ${UNAME_MACHINE} in 818 UNAME_PROCESSOR=`/usr/bin/uname -p`
798 pc98) 819 case ${UNAME_PROCESSOR} in
799 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
800 amd64) 820 amd64)
801 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 821 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
802 *) 822 *)
803 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 823 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
804 esac 824 esac
805 exit ;; 825 exit ;;
806 i*:CYGWIN*:*) 826 i*:CYGWIN*:*)
807 echo ${UNAME_MACHINE}-pc-cygwin 827 echo ${UNAME_MACHINE}-pc-cygwin
808 exit ;; 828 exit ;;
809 *:MINGW*:*) 829 *:MINGW*:*)
810 echo ${UNAME_MACHINE}-pc-mingw32 830 echo ${UNAME_MACHINE}-pc-mingw32
811 exit ;; 831 exit ;;
832 i*:MSYS*:*)
833 echo ${UNAME_MACHINE}-pc-msys
834 exit ;;
812 i*:windows32*:*) 835 i*:windows32*:*)
813 # uname -m includes "-pc" on this system. 836 # uname -m includes "-pc" on this system.
814 echo ${UNAME_MACHINE}-mingw32 837 echo ${UNAME_MACHINE}-mingw32
815 exit ;; 838 exit ;;
816 i*:PW*:*) 839 i*:PW*:*)
817 echo ${UNAME_MACHINE}-pc-pw32 840 echo ${UNAME_MACHINE}-pc-pw32
818 exit ;; 841 exit ;;
819 *:Interix*:[3456]*) 842 *:Interix*:*)
820 case ${UNAME_MACHINE} in 843 case ${UNAME_MACHINE} in
821 x86) 844 x86)
822 echo i586-pc-interix${UNAME_RELEASE} 845 echo i586-pc-interix${UNAME_RELEASE}
823 exit ;; 846 exit ;;
824 EM64T | authenticamd) 847 authenticamd | genuineintel | EM64T)
825 echo x86_64-unknown-interix${UNAME_RELEASE} 848 echo x86_64-unknown-interix${UNAME_RELEASE}
826 exit ;; 849 exit ;;
827 IA64) 850 IA64)
828 echo ia64-unknown-interix${UNAME_RELEASE} 851 echo ia64-unknown-interix${UNAME_RELEASE}
829 exit ;; 852 exit ;;
830 esac ;; 853 esac ;;
831 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 854 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
832 echo i${UNAME_MACHINE}-pc-mks 855 echo i${UNAME_MACHINE}-pc-mks
833 exit ;; 856 exit ;;
857 8664:Windows_NT:*)
858 echo x86_64-pc-mks
859 exit ;;
834 i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 860 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
835 # How do we know it's Interix rather than the generic POSIX subsystem? 861 # How do we know it's Interix rather than the generic POSIX subsystem?
836 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 862 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
837 # UNAME_MACHINE based on the output of uname instead of i386? 863 # UNAME_MACHINE based on the output of uname instead of i386?
838 echo i586-pc-interix 864 echo i586-pc-interix
858 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 884 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
859 exit ;; 885 exit ;;
860 i*86:Minix:*:*) 886 i*86:Minix:*:*)
861 echo ${UNAME_MACHINE}-pc-minix 887 echo ${UNAME_MACHINE}-pc-minix
862 exit ;; 888 exit ;;
863 arm*:Linux:*:*) 889 aarch64:Linux:*:*)
864 eval $set_cc_for_build
865 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
866 | grep -q __ARM_EABI__
867 then
868 echo ${UNAME_MACHINE}-unknown-linux-gnu
869 else
870 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
871 fi
872 exit ;;
873 avr32*:Linux:*:*)
874 echo ${UNAME_MACHINE}-unknown-linux-gnu 890 echo ${UNAME_MACHINE}-unknown-linux-gnu
875 exit ;; 891 exit ;;
876 cris:Linux:*:*) 892 aarch64_be:Linux:*:*)
877 echo cris-axis-linux-gnu 893 UNAME_MACHINE=aarch64_be
878 exit ;;
879 crisv32:Linux:*:*)
880 echo crisv32-axis-linux-gnu
881 exit ;;
882 frv:Linux:*:*)
883 echo frv-unknown-linux-gnu
884 exit ;;
885 ia64:Linux:*:*)
886 echo ${UNAME_MACHINE}-unknown-linux-gnu 894 echo ${UNAME_MACHINE}-unknown-linux-gnu
887 exit ;;
888 m32r*:Linux:*:*)
889 echo ${UNAME_MACHINE}-unknown-linux-gnu
890 exit ;;
891 m68*:Linux:*:*)
892 echo ${UNAME_MACHINE}-unknown-linux-gnu
893 exit ;;
894 mips:Linux:*:*)
895 eval $set_cc_for_build
896 sed 's/^ //' << EOF >$dummy.c
897 #undef CPU
898 #undef mips
899 #undef mipsel
900 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
901 CPU=mipsel
902 #else
903 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
904 CPU=mips
905 #else
906 CPU=
907 #endif
908 #endif
909 EOF
910 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
911 /^CPU/{
912 s: ::g
913 p
914 }'`"
915 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
916 ;;
917 mips64:Linux:*:*)
918 eval $set_cc_for_build
919 sed 's/^ //' << EOF >$dummy.c
920 #undef CPU
921 #undef mips64
922 #undef mips64el
923 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
924 CPU=mips64el
925 #else
926 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
927 CPU=mips64
928 #else
929 CPU=
930 #endif
931 #endif
932 EOF
933 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
934 /^CPU/{
935 s: ::g
936 p
937 }'`"
938 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
939 ;;
940 or32:Linux:*:*)
941 echo or32-unknown-linux-gnu
942 exit ;;
943 ppc:Linux:*:*)
944 echo powerpc-unknown-linux-gnu
945 exit ;;
946 ppc64:Linux:*:*)
947 echo powerpc64-unknown-linux-gnu
948 exit ;; 895 exit ;;
949 alpha:Linux:*:*) 896 alpha:Linux:*:*)
950 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 897 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
951 EV5) UNAME_MACHINE=alphaev5 ;; 898 EV5) UNAME_MACHINE=alphaev5 ;;
952 EV56) UNAME_MACHINE=alphaev56 ;; 899 EV56) UNAME_MACHINE=alphaev56 ;;
953 PCA56) UNAME_MACHINE=alphapca56 ;; 900 PCA56) UNAME_MACHINE=alphapca56 ;;
954 PCA57) UNAME_MACHINE=alphapca56 ;; 901 PCA57) UNAME_MACHINE=alphapca56 ;;
955 EV6) UNAME_MACHINE=alphaev6 ;; 902 EV6) UNAME_MACHINE=alphaev6 ;;
956 EV67) UNAME_MACHINE=alphaev67 ;; 903 EV67) UNAME_MACHINE=alphaev67 ;;
957 EV68*) UNAME_MACHINE=alphaev68 ;; 904 EV68*) UNAME_MACHINE=alphaev68 ;;
958 esac 905 esac
959 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 906 objdump --private-headers /bin/sh | grep -q ld.so.1
960 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 907 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
961 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 908 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
909 exit ;;
910 arm*:Linux:*:*)
911 eval $set_cc_for_build
912 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
913 | grep -q __ARM_EABI__
914 then
915 echo ${UNAME_MACHINE}-unknown-linux-gnu
916 else
917 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918 | grep -q __ARM_PCS_VFP
919 then
920 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
921 else
922 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
923 fi
924 fi
925 exit ;;
926 avr32*:Linux:*:*)
927 echo ${UNAME_MACHINE}-unknown-linux-gnu
928 exit ;;
929 cris:Linux:*:*)
930 echo ${UNAME_MACHINE}-axis-linux-gnu
931 exit ;;
932 crisv32:Linux:*:*)
933 echo ${UNAME_MACHINE}-axis-linux-gnu
934 exit ;;
935 frv:Linux:*:*)
936 echo ${UNAME_MACHINE}-unknown-linux-gnu
937 exit ;;
938 hexagon:Linux:*:*)
939 echo ${UNAME_MACHINE}-unknown-linux-gnu
940 exit ;;
941 i*86:Linux:*:*)
942 LIBC=gnu
943 eval $set_cc_for_build
944 sed 's/^ //' << EOF >$dummy.c
945 #ifdef __dietlibc__
946 LIBC=dietlibc
947 #endif
948 EOF
949 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
950 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
951 exit ;;
952 ia64:Linux:*:*)
953 echo ${UNAME_MACHINE}-unknown-linux-gnu
954 exit ;;
955 m32r*:Linux:*:*)
956 echo ${UNAME_MACHINE}-unknown-linux-gnu
957 exit ;;
958 m68*:Linux:*:*)
959 echo ${UNAME_MACHINE}-unknown-linux-gnu
960 exit ;;
961 mips:Linux:*:* | mips64:Linux:*:*)
962 eval $set_cc_for_build
963 sed 's/^ //' << EOF >$dummy.c
964 #undef CPU
965 #undef ${UNAME_MACHINE}
966 #undef ${UNAME_MACHINE}el
967 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
968 CPU=${UNAME_MACHINE}el
969 #else
970 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
971 CPU=${UNAME_MACHINE}
972 #else
973 CPU=
974 #endif
975 #endif
976 EOF
977 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
978 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
979 ;;
980 or32:Linux:*:*)
981 echo ${UNAME_MACHINE}-unknown-linux-gnu
982 exit ;;
983 padre:Linux:*:*)
984 echo sparc-unknown-linux-gnu
985 exit ;;
986 parisc64:Linux:*:* | hppa64:Linux:*:*)
987 echo hppa64-unknown-linux-gnu
962 exit ;; 988 exit ;;
963 parisc:Linux:*:* | hppa:Linux:*:*) 989 parisc:Linux:*:* | hppa:Linux:*:*)
964 # Look for CPU level 990 # Look for CPU level
965 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 991 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
966 PA7*) echo hppa1.1-unknown-linux-gnu ;; 992 PA7*) echo hppa1.1-unknown-linux-gnu ;;
967 PA8*) echo hppa2.0-unknown-linux-gnu ;; 993 PA8*) echo hppa2.0-unknown-linux-gnu ;;
968 *) echo hppa-unknown-linux-gnu ;; 994 *) echo hppa-unknown-linux-gnu ;;
969 esac 995 esac
970 exit ;; 996 exit ;;
971 parisc64:Linux:*:* | hppa64:Linux:*:*) 997 ppc64:Linux:*:*)
972 echo hppa64-unknown-linux-gnu 998 echo powerpc64-unknown-linux-gnu
999 exit ;;
1000 ppc:Linux:*:*)
1001 echo powerpc-unknown-linux-gnu
973 exit ;; 1002 exit ;;
974 s390:Linux:*:* | s390x:Linux:*:*) 1003 s390:Linux:*:* | s390x:Linux:*:*)
975 echo ${UNAME_MACHINE}-ibm-linux 1004 echo ${UNAME_MACHINE}-ibm-linux
976 exit ;; 1005 exit ;;
977 sh64*:Linux:*:*) 1006 sh64*:Linux:*:*)
978 echo ${UNAME_MACHINE}-unknown-linux-gnu 1007 echo ${UNAME_MACHINE}-unknown-linux-gnu
979 exit ;; 1008 exit ;;
980 sh*:Linux:*:*) 1009 sh*:Linux:*:*)
981 echo ${UNAME_MACHINE}-unknown-linux-gnu 1010 echo ${UNAME_MACHINE}-unknown-linux-gnu
982 exit ;; 1011 exit ;;
983 sparc:Linux:*:* | sparc64:Linux:*:*) 1012 sparc:Linux:*:* | sparc64:Linux:*:*)
984 echo ${UNAME_MACHINE}-unknown-linux-gnu 1013 echo ${UNAME_MACHINE}-unknown-linux-gnu
985 exit ;; 1014 exit ;;
1015 tile*:Linux:*:*)
1016 echo ${UNAME_MACHINE}-unknown-linux-gnu
1017 exit ;;
986 vax:Linux:*:*) 1018 vax:Linux:*:*)
987 echo ${UNAME_MACHINE}-dec-linux-gnu 1019 echo ${UNAME_MACHINE}-dec-linux-gnu
988 exit ;; 1020 exit ;;
989 x86_64:Linux:*:*) 1021 x86_64:Linux:*:*)
990 echo x86_64-unknown-linux-gnu 1022 echo ${UNAME_MACHINE}-unknown-linux-gnu
991 exit ;; 1023 exit ;;
992 xtensa*:Linux:*:*) 1024 xtensa*:Linux:*:*)
993 echo ${UNAME_MACHINE}-unknown-linux-gnu 1025 echo ${UNAME_MACHINE}-unknown-linux-gnu
994 exit ;; 1026 exit ;;
995 i*86:Linux:*:*)
996 # The BFD linker knows what the default object file format is, so
997 # first see if it will tell us. cd to the root directory to prevent
998 # problems with other programs or directories called `ld' in the path.
999 # Set LC_ALL=C to ensure ld outputs messages in English.
1000 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
1001 | sed -ne '/supported targets:/!d
1002 s/[ ][ ]*/ /g
1003 s/.*supported targets: *//
1004 s/ .*//
1005 p'`
1006 case "$ld_supported_targets" in
1007 elf32-i386)
1008 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1009 ;;
1010 a.out-i386-linux)
1011 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
1012 exit ;;
1013 coff-i386)
1014 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
1015 exit ;;
1016 "")
1017 # Either a pre-BFD a.out linker (linux-gnuoldld) or
1018 # one that does not give us useful --help.
1019 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
1020 exit ;;
1021 esac
1022 # Determine whether the default compiler is a.out or elf
1023 eval $set_cc_for_build
1024 sed 's/^ //' << EOF >$dummy.c
1025 #include <features.h>
1026 #ifdef __ELF__
1027 # ifdef __GLIBC__
1028 # if __GLIBC__ >= 2
1029 LIBC=gnu
1030 # else
1031 LIBC=gnulibc1
1032 # endif
1033 # else
1034 LIBC=gnulibc1
1035 # endif
1036 #else
1037 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1038 LIBC=gnu
1039 #else
1040 LIBC=gnuaout
1041 #endif
1042 #endif
1043 #ifdef __dietlibc__
1044 LIBC=dietlibc
1045 #endif
1046 EOF
1047 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1048 /^LIBC/{
1049 s: ::g
1050 p
1051 }'`"
1052 test x"${LIBC}" != x && {
1053 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1054 exit
1055 }
1056 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1057 ;;
1058 i*86:DYNIX/ptx:4*:*) 1027 i*86:DYNIX/ptx:4*:*)
1059 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1028 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1060 # earlier versions are messed up and put the nodename in both 1029 # earlier versions are messed up and put the nodename in both
1061 # sysname and nodename. 1030 # sysname and nodename.
1062 echo i386-sequent-sysv4 1031 echo i386-sequent-sysv4
1063 exit ;; 1032 exit ;;
1064 i*86:UNIX_SV:4.2MP:2.*) 1033 i*86:UNIX_SV:4.2MP:2.*)
1065 # Unixware is an offshoot of SVR4, but it has its own version 1034 # Unixware is an offshoot of SVR4, but it has its own version
1066 # number series starting with 2... 1035 # number series starting with 2...
1067 # I am not positive that other SVR4 systems won't match this, 1036 # I am not positive that other SVR4 systems won't match this,
1068 # I just have to hope. -- rms. 1037 # I just have to hope. -- rms.
1069 # Use sysv4.2uw... so that sysv4* matches it. 1038 # Use sysv4.2uw... so that sysv4* matches it.
1070 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1039 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1071 exit ;; 1040 exit ;;
1072 i*86:OS/2:*:*) 1041 i*86:OS/2:*:*)
1073 # If we were able to find `uname', then EMX Unix compatibility 1042 # If we were able to find `uname', then EMX Unix compatibility
1074 # is probably installed. 1043 # is probably installed.
1081 echo ${UNAME_MACHINE}-unknown-atheos 1050 echo ${UNAME_MACHINE}-unknown-atheos
1082 exit ;; 1051 exit ;;
1083 i*86:syllable:*:*) 1052 i*86:syllable:*:*)
1084 echo ${UNAME_MACHINE}-pc-syllable 1053 echo ${UNAME_MACHINE}-pc-syllable
1085 exit ;; 1054 exit ;;
1086 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 1055 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1087 echo i386-unknown-lynxos${UNAME_RELEASE} 1056 echo i386-unknown-lynxos${UNAME_RELEASE}
1088 exit ;; 1057 exit ;;
1089 i*86:*DOS:*:*) 1058 i*86:*DOS:*:*)
1090 echo ${UNAME_MACHINE}-pc-msdosdjgpp 1059 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1091 exit ;; 1060 exit ;;
1096 else 1065 else
1097 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1066 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1098 fi 1067 fi
1099 exit ;; 1068 exit ;;
1100 i*86:*:5:[678]*) 1069 i*86:*:5:[678]*)
1101 # UnixWare 7.x, OpenUNIX and OpenServer 6. 1070 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1102 case `/bin/uname -X | grep "^Machine"` in 1071 case `/bin/uname -X | grep "^Machine"` in
1103 *486*) UNAME_MACHINE=i486 ;; 1072 *486*) UNAME_MACHINE=i486 ;;
1104 *Pentium) UNAME_MACHINE=i586 ;; 1073 *Pentium) UNAME_MACHINE=i586 ;;
1105 *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1074 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1106 esac 1075 esac
1124 echo ${UNAME_MACHINE}-pc-sysv32 1093 echo ${UNAME_MACHINE}-pc-sysv32
1125 fi 1094 fi
1126 exit ;; 1095 exit ;;
1127 pc:*:*:*) 1096 pc:*:*:*)
1128 # Left here for compatibility: 1097 # Left here for compatibility:
1129 # uname -m prints for DJGPP always 'pc', but it prints nothing about 1098 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1130 # the processor, so we play safe by assuming i386. 1099 # the processor, so we play safe by assuming i586.
1131 echo i386-pc-msdosdjgpp 1100 # Note: whatever this is, it MUST be the same as what config.sub
1132 exit ;; 1101 # prints for the "djgpp" host, or else GDB configury will decide that
1102 # this is a cross-build.
1103 echo i586-pc-msdosdjgpp
1104 exit ;;
1133 Intel:Mach:3*:*) 1105 Intel:Mach:3*:*)
1134 echo i386-pc-mach3 1106 echo i386-pc-mach3
1135 exit ;; 1107 exit ;;
1136 paragon:*:*:*) 1108 paragon:*:*:*)
1137 echo i860-intel-osf1 1109 echo i860-intel-osf1
1162 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1134 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1163 && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1135 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1164 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1136 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1165 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1137 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1166 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1138 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1167 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1139 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1168 && { echo i486-ncr-sysv4; exit; } ;; 1140 && { echo i486-ncr-sysv4; exit; } ;;
1141 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1142 OS_REL='.3'
1143 test -r /etc/.relid \
1144 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1145 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1146 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1147 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1148 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1149 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1150 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1169 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1151 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1170 echo m68k-unknown-lynxos${UNAME_RELEASE} 1152 echo m68k-unknown-lynxos${UNAME_RELEASE}
1171 exit ;; 1153 exit ;;
1172 mc68030:UNIX_System_V:4.*:*) 1154 mc68030:UNIX_System_V:4.*:*)
1173 echo m68k-atari-sysv4 1155 echo m68k-atari-sysv4
1176 echo sparc-unknown-lynxos${UNAME_RELEASE} 1158 echo sparc-unknown-lynxos${UNAME_RELEASE}
1177 exit ;; 1159 exit ;;
1178 rs6000:LynxOS:2.*:*) 1160 rs6000:LynxOS:2.*:*)
1179 echo rs6000-unknown-lynxos${UNAME_RELEASE} 1161 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1180 exit ;; 1162 exit ;;
1181 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 1163 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1182 echo powerpc-unknown-lynxos${UNAME_RELEASE} 1164 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1183 exit ;; 1165 exit ;;
1184 SM[BE]S:UNIX_SV:*:*) 1166 SM[BE]S:UNIX_SV:*:*)
1185 echo mips-dde-sysv${UNAME_RELEASE} 1167 echo mips-dde-sysv${UNAME_RELEASE}
1186 exit ;; 1168 exit ;;
1196 echo ${UNAME_MACHINE}-sni-sysv4 1178 echo ${UNAME_MACHINE}-sni-sysv4
1197 else 1179 else
1198 echo ns32k-sni-sysv 1180 echo ns32k-sni-sysv
1199 fi 1181 fi
1200 exit ;; 1182 exit ;;
1201 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1183 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1202 # says <Richard.M.Bartel@ccMail.Census.GOV> 1184 # says <Richard.M.Bartel@ccMail.Census.GOV>
1203 echo i586-unisys-sysv4 1185 echo i586-unisys-sysv4
1204 exit ;; 1186 exit ;;
1205 *:UNIX_System_V:4*:FTX*) 1187 *:UNIX_System_V:4*:FTX*)
1206 # From Gerald Hewes <hewes@openmarket.com>. 1188 # From Gerald Hewes <hewes@openmarket.com>.
1207 # How about differentiating between stratus architectures? -djm 1189 # How about differentiating between stratus architectures? -djm
1208 echo hppa1.1-stratus-sysv4 1190 echo hppa1.1-stratus-sysv4
1209 exit ;; 1191 exit ;;
1225 news*:NEWS-OS:6*:*) 1207 news*:NEWS-OS:6*:*)
1226 echo mips-sony-newsos6 1208 echo mips-sony-newsos6
1227 exit ;; 1209 exit ;;
1228 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1210 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1229 if [ -d /usr/nec ]; then 1211 if [ -d /usr/nec ]; then
1230 echo mips-nec-sysv${UNAME_RELEASE} 1212 echo mips-nec-sysv${UNAME_RELEASE}
1231 else 1213 else
1232 echo mips-unknown-sysv${UNAME_RELEASE} 1214 echo mips-unknown-sysv${UNAME_RELEASE}
1233 fi 1215 fi
1234 exit ;; 1216 exit ;;
1235 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1217 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1236 echo powerpc-be-beos 1218 echo powerpc-be-beos
1237 exit ;; 1219 exit ;;
1238 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1220 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1239 echo powerpc-apple-beos 1221 echo powerpc-apple-beos
1240 exit ;; 1222 exit ;;
1241 BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1223 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1242 echo i586-pc-beos 1224 echo i586-pc-beos
1243 exit ;; 1225 exit ;;
1226 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1227 echo i586-pc-haiku
1228 exit ;;
1244 SX-4:SUPER-UX:*:*) 1229 SX-4:SUPER-UX:*:*)
1245 echo sx4-nec-superux${UNAME_RELEASE} 1230 echo sx4-nec-superux${UNAME_RELEASE}
1246 exit ;; 1231 exit ;;
1247 SX-5:SUPER-UX:*:*) 1232 SX-5:SUPER-UX:*:*)
1248 echo sx5-nec-superux${UNAME_RELEASE} 1233 echo sx5-nec-superux${UNAME_RELEASE}
1265 *:Rhapsody:*:*) 1250 *:Rhapsody:*:*)
1266 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1251 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1267 exit ;; 1252 exit ;;
1268 *:Darwin:*:*) 1253 *:Darwin:*:*)
1269 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1254 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1270 eval $set_cc_for_build
1271 echo "int main(){}" > $dummy.c
1272 if test "`$CC_FOR_BUILD -o $dummy $dummy.c; file $dummy | grep -c x86_64`" = 1 ; then
1273 UNAME_PROCESSOR=x86_64
1274 fi
1275 case $UNAME_PROCESSOR in 1255 case $UNAME_PROCESSOR in
1256 i386)
1257 eval $set_cc_for_build
1258 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1259 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1260 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1261 grep IS_64BIT_ARCH >/dev/null
1262 then
1263 UNAME_PROCESSOR="x86_64"
1264 fi
1265 fi ;;
1276 unknown) UNAME_PROCESSOR=powerpc ;; 1266 unknown) UNAME_PROCESSOR=powerpc ;;
1277 esac 1267 esac
1278 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1268 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1279 exit ;; 1269 exit ;;
1280 *:procnto*:*:* | *:QNX:[0123456789]*:*) 1270 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1285 fi 1275 fi
1286 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1276 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1287 exit ;; 1277 exit ;;
1288 *:QNX:*:4*) 1278 *:QNX:*:4*)
1289 echo i386-pc-qnx 1279 echo i386-pc-qnx
1280 exit ;;
1281 NEO-?:NONSTOP_KERNEL:*:*)
1282 echo neo-tandem-nsk${UNAME_RELEASE}
1290 exit ;; 1283 exit ;;
1291 NSE-?:NONSTOP_KERNEL:*:*) 1284 NSE-?:NONSTOP_KERNEL:*:*)
1292 echo nse-tandem-nsk${UNAME_RELEASE} 1285 echo nse-tandem-nsk${UNAME_RELEASE}
1293 exit ;; 1286 exit ;;
1294 NSR-?:NONSTOP_KERNEL:*:*) 1287 NSR-?:NONSTOP_KERNEL:*:*)
1331 exit ;; 1324 exit ;;
1332 *:ITS:*:*) 1325 *:ITS:*:*)
1333 echo pdp10-unknown-its 1326 echo pdp10-unknown-its
1334 exit ;; 1327 exit ;;
1335 SEI:*:*:SEIUX) 1328 SEI:*:*:SEIUX)
1336 echo mips-sei-seiux${UNAME_RELEASE} 1329 echo mips-sei-seiux${UNAME_RELEASE}
1337 exit ;; 1330 exit ;;
1338 *:DragonFly:*:*) 1331 *:DragonFly:*:*)
1339 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1332 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1340 exit ;; 1333 exit ;;
1341 *:*VMS:*:*) 1334 *:*VMS:*:*)
1342 UNAME_MACHINE=`(uname -p) 2>/dev/null` 1335 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1343 case "${UNAME_MACHINE}" in 1336 case "${UNAME_MACHINE}" in
1344 A*) echo alpha-dec-vms ; exit ;; 1337 A*) echo alpha-dec-vms ; exit ;;
1345 I*) echo ia64-dec-vms ; exit ;; 1338 I*) echo ia64-dec-vms ; exit ;;
1346 V*) echo vax-dec-vms ; exit ;; 1339 V*) echo vax-dec-vms ; exit ;;
1347 esac ;; 1340 esac ;;
1351 i*86:skyos:*:*) 1344 i*86:skyos:*:*)
1352 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1345 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1353 exit ;; 1346 exit ;;
1354 i*86:rdos:*:*) 1347 i*86:rdos:*:*)
1355 echo ${UNAME_MACHINE}-pc-rdos 1348 echo ${UNAME_MACHINE}-pc-rdos
1349 exit ;;
1350 i*86:AROS:*:*)
1351 echo ${UNAME_MACHINE}-pc-aros
1352 exit ;;
1353 x86_64:VMkernel:*:*)
1354 echo ${UNAME_MACHINE}-unknown-esx
1356 exit ;; 1355 exit ;;
1357 esac 1356 esac
1358 1357
1359 #echo '(No uname command or uname output not recognized.)' 1>&2 1358 #echo '(No uname command or uname output not recognized.)' 1>&2
1360 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1359 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1374 printf ("mips-sony-bsd\n"); exit (0); 1373 printf ("mips-sony-bsd\n"); exit (0);
1375 #else 1374 #else
1376 #include <sys/param.h> 1375 #include <sys/param.h>
1377 printf ("m68k-sony-newsos%s\n", 1376 printf ("m68k-sony-newsos%s\n",
1378 #ifdef NEWSOS4 1377 #ifdef NEWSOS4
1379 "4" 1378 "4"
1380 #else 1379 #else
1381 "" 1380 ""
1382 #endif 1381 #endif
1383 ); exit (0); 1382 ); exit (0);
1384 #endif 1383 #endif
1385 #endif 1384 #endif
1386 1385
1387 #if defined (__arm) && defined (__acorn) && defined (__unix) 1386 #if defined (__arm) && defined (__acorn) && defined (__unix)
1388 printf ("arm-acorn-riscix\n"); exit (0); 1387 printf ("arm-acorn-riscix\n"); exit (0);

mercurial