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] |
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} |
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 |
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. |