Mercurial > urweb
comparison config.guess @ 1274:38eb0d0f39b9
Drop in some new autoconf scripts
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 03 Jun 2010 13:35:26 -0400 |
parents | 482815817e99 |
children | 3d0cc841cafd |
comparison
equal
deleted
inserted
replaced
1273:7d0254d15b21 | 1274:38eb0d0f39b9 |
---|---|
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, |
4 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | 4 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
5 # Free Software Foundation, Inc. | 5 # Free Software Foundation, Inc. |
6 | 6 |
7 timestamp='2009-06-10' | 7 timestamp='2009-12-30' |
8 | 8 |
9 # This file is free software; you can redistribute it and/or modify it | 9 # This file is free software; you can redistribute it and/or modify it |
10 # under the terms of the GNU General Public License as published by | 10 # under the terms of the GNU General Public License as published by |
11 # the Free Software Foundation; either version 2 of the License, or | 11 # the Free Software Foundation; either version 2 of the License, or |
12 # (at your option) any later version. | 12 # (at your option) any later version. |
25 # distribute this file as part of a program that contains a | 25 # distribute this file as part of a program that contains a |
26 # configuration script generated by Autoconf, you may include it under | 26 # configuration script generated by Autoconf, you may include it under |
27 # the same distribution terms that you use for the rest of that program. | 27 # the same distribution terms that you use for the rest of that program. |
28 | 28 |
29 | 29 |
30 # Originally written by Per Bothner <per@bothner.com>. | 30 # Originally written by Per Bothner. Please send patches (context |
31 # Please send patches to <config-patches@gnu.org>. Submit a context | 31 # diff format) to <config-patches@gnu.org> and include a ChangeLog |
32 # diff and a properly formatted ChangeLog entry. | 32 # entry. |
33 # | 33 # |
34 # This script attempts to guess a canonical system name similar to | 34 # This script attempts to guess a canonical system name similar to |
35 # config.sub. If it succeeds, it prints the system name on stdout, and | 35 # config.sub. If it succeeds, it prints the system name on stdout, and |
36 # exits with 0. Otherwise, it exits with 1. | 36 # exits with 0. Otherwise, it exits with 1. |
37 # | 37 # |
38 # The plan is that this can be called by configure scripts if you | 38 # You can get the latest version of this script from: |
39 # don't specify an explicit build system type. | 39 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
40 | 40 |
41 me=`echo "$0" | sed -e 's,.*/,,'` | 41 me=`echo "$0" | sed -e 's,.*/,,'` |
42 | 42 |
43 usage="\ | 43 usage="\ |
44 Usage: $0 [OPTION] | 44 Usage: $0 [OPTION] |
54 | 54 |
55 version="\ | 55 version="\ |
56 GNU config.guess ($timestamp) | 56 GNU config.guess ($timestamp) |
57 | 57 |
58 Originally written by Per Bothner. | 58 Originally written by Per Bothner. |
59 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | 59 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
60 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 60 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free |
61 Software Foundation, Inc. | |
61 | 62 |
62 This is free software; see the source for copying conditions. There is NO | 63 This is free software; see the source for copying conditions. There is NO |
63 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | 64 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
64 | 65 |
65 help=" | 66 help=" |
331 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | 332 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
332 exit ;; | 333 exit ;; |
333 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) | 334 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) |
334 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | 335 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
335 exit ;; | 336 exit ;; |
337 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) | |
338 echo i386-pc-auroraux${UNAME_RELEASE} | |
339 exit ;; | |
336 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) | 340 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
337 eval $set_cc_for_build | 341 eval $set_cc_for_build |
338 SUN_ARCH="i386" | 342 SUN_ARCH="i386" |
339 # If there is a compiler, see if it is configured for 64-bit objects. | 343 # If there is a compiler, see if it is configured for 64-bit objects. |
340 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. | 344 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. |
805 echo ${UNAME_MACHINE}-mingw32 | 809 echo ${UNAME_MACHINE}-mingw32 |
806 exit ;; | 810 exit ;; |
807 i*:PW*:*) | 811 i*:PW*:*) |
808 echo ${UNAME_MACHINE}-pc-pw32 | 812 echo ${UNAME_MACHINE}-pc-pw32 |
809 exit ;; | 813 exit ;; |
810 *:Interix*:[3456]*) | 814 *:Interix*:*) |
811 case ${UNAME_MACHINE} in | 815 case ${UNAME_MACHINE} in |
812 x86) | 816 x86) |
813 echo i586-pc-interix${UNAME_RELEASE} | 817 echo i586-pc-interix${UNAME_RELEASE} |
814 exit ;; | 818 exit ;; |
815 EM64T | authenticamd | genuineintel) | 819 authenticamd | genuineintel | EM64T) |
816 echo x86_64-unknown-interix${UNAME_RELEASE} | 820 echo x86_64-unknown-interix${UNAME_RELEASE} |
817 exit ;; | 821 exit ;; |
818 IA64) | 822 IA64) |
819 echo ia64-unknown-interix${UNAME_RELEASE} | 823 echo ia64-unknown-interix${UNAME_RELEASE} |
820 exit ;; | 824 exit ;; |
852 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu | 856 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu |
853 exit ;; | 857 exit ;; |
854 i*86:Minix:*:*) | 858 i*86:Minix:*:*) |
855 echo ${UNAME_MACHINE}-pc-minix | 859 echo ${UNAME_MACHINE}-pc-minix |
856 exit ;; | 860 exit ;; |
861 alpha:Linux:*:*) | |
862 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | |
863 EV5) UNAME_MACHINE=alphaev5 ;; | |
864 EV56) UNAME_MACHINE=alphaev56 ;; | |
865 PCA56) UNAME_MACHINE=alphapca56 ;; | |
866 PCA57) UNAME_MACHINE=alphapca56 ;; | |
867 EV6) UNAME_MACHINE=alphaev6 ;; | |
868 EV67) UNAME_MACHINE=alphaev67 ;; | |
869 EV68*) UNAME_MACHINE=alphaev68 ;; | |
870 esac | |
871 objdump --private-headers /bin/sh | grep -q ld.so.1 | |
872 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | |
873 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | |
874 exit ;; | |
857 arm*:Linux:*:*) | 875 arm*:Linux:*:*) |
858 eval $set_cc_for_build | 876 eval $set_cc_for_build |
859 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | 877 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
860 | grep -q __ARM_EABI__ | 878 | grep -q __ARM_EABI__ |
861 then | 879 then |
873 crisv32:Linux:*:*) | 891 crisv32:Linux:*:*) |
874 echo crisv32-axis-linux-gnu | 892 echo crisv32-axis-linux-gnu |
875 exit ;; | 893 exit ;; |
876 frv:Linux:*:*) | 894 frv:Linux:*:*) |
877 echo frv-unknown-linux-gnu | 895 echo frv-unknown-linux-gnu |
896 exit ;; | |
897 i*86:Linux:*:*) | |
898 LIBC=gnu | |
899 eval $set_cc_for_build | |
900 sed 's/^ //' << EOF >$dummy.c | |
901 #ifdef __dietlibc__ | |
902 LIBC=dietlibc | |
903 #endif | |
904 EOF | |
905 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` | |
906 echo "${UNAME_MACHINE}-pc-linux-${LIBC}" | |
878 exit ;; | 907 exit ;; |
879 ia64:Linux:*:*) | 908 ia64:Linux:*:*) |
880 echo ${UNAME_MACHINE}-unknown-linux-gnu | 909 echo ${UNAME_MACHINE}-unknown-linux-gnu |
881 exit ;; | 910 exit ;; |
882 m32r*:Linux:*:*) | 911 m32r*:Linux:*:*) |
899 #else | 928 #else |
900 CPU= | 929 CPU= |
901 #endif | 930 #endif |
902 #endif | 931 #endif |
903 EOF | 932 EOF |
904 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | 933 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` |
905 /^CPU/{ | |
906 s: ::g | |
907 p | |
908 }'`" | |
909 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | 934 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } |
910 ;; | 935 ;; |
911 or32:Linux:*:*) | 936 or32:Linux:*:*) |
912 echo or32-unknown-linux-gnu | 937 echo or32-unknown-linux-gnu |
913 exit ;; | 938 exit ;; |
914 ppc:Linux:*:*) | |
915 echo powerpc-unknown-linux-gnu | |
916 exit ;; | |
917 ppc64:Linux:*:*) | |
918 echo powerpc64-unknown-linux-gnu | |
919 exit ;; | |
920 alpha:Linux:*:*) | |
921 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | |
922 EV5) UNAME_MACHINE=alphaev5 ;; | |
923 EV56) UNAME_MACHINE=alphaev56 ;; | |
924 PCA56) UNAME_MACHINE=alphapca56 ;; | |
925 PCA57) UNAME_MACHINE=alphapca56 ;; | |
926 EV6) UNAME_MACHINE=alphaev6 ;; | |
927 EV67) UNAME_MACHINE=alphaev67 ;; | |
928 EV68*) UNAME_MACHINE=alphaev68 ;; | |
929 esac | |
930 objdump --private-headers /bin/sh | grep -q ld.so.1 | |
931 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | |
932 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | |
933 exit ;; | |
934 padre:Linux:*:*) | 939 padre:Linux:*:*) |
935 echo sparc-unknown-linux-gnu | 940 echo sparc-unknown-linux-gnu |
941 exit ;; | |
942 parisc64:Linux:*:* | hppa64:Linux:*:*) | |
943 echo hppa64-unknown-linux-gnu | |
936 exit ;; | 944 exit ;; |
937 parisc:Linux:*:* | hppa:Linux:*:*) | 945 parisc:Linux:*:* | hppa:Linux:*:*) |
938 # Look for CPU level | 946 # Look for CPU level |
939 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in | 947 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in |
940 PA7*) echo hppa1.1-unknown-linux-gnu ;; | 948 PA7*) echo hppa1.1-unknown-linux-gnu ;; |
941 PA8*) echo hppa2.0-unknown-linux-gnu ;; | 949 PA8*) echo hppa2.0-unknown-linux-gnu ;; |
942 *) echo hppa-unknown-linux-gnu ;; | 950 *) echo hppa-unknown-linux-gnu ;; |
943 esac | 951 esac |
944 exit ;; | 952 exit ;; |
945 parisc64:Linux:*:* | hppa64:Linux:*:*) | 953 ppc64:Linux:*:*) |
946 echo hppa64-unknown-linux-gnu | 954 echo powerpc64-unknown-linux-gnu |
955 exit ;; | |
956 ppc:Linux:*:*) | |
957 echo powerpc-unknown-linux-gnu | |
947 exit ;; | 958 exit ;; |
948 s390:Linux:*:* | s390x:Linux:*:*) | 959 s390:Linux:*:* | s390x:Linux:*:*) |
949 echo ${UNAME_MACHINE}-ibm-linux | 960 echo ${UNAME_MACHINE}-ibm-linux |
950 exit ;; | 961 exit ;; |
951 sh64*:Linux:*:*) | 962 sh64*:Linux:*:*) |
964 echo x86_64-unknown-linux-gnu | 975 echo x86_64-unknown-linux-gnu |
965 exit ;; | 976 exit ;; |
966 xtensa*:Linux:*:*) | 977 xtensa*:Linux:*:*) |
967 echo ${UNAME_MACHINE}-unknown-linux-gnu | 978 echo ${UNAME_MACHINE}-unknown-linux-gnu |
968 exit ;; | 979 exit ;; |
969 i*86:Linux:*:*) | |
970 # The BFD linker knows what the default object file format is, so | |
971 # first see if it will tell us. cd to the root directory to prevent | |
972 # problems with other programs or directories called `ld' in the path. | |
973 # Set LC_ALL=C to ensure ld outputs messages in English. | |
974 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | |
975 | sed -ne '/supported targets:/!d | |
976 s/[ ][ ]*/ /g | |
977 s/.*supported targets: *// | |
978 s/ .*// | |
979 p'` | |
980 case "$ld_supported_targets" in | |
981 elf32-i386) | |
982 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" | |
983 ;; | |
984 esac | |
985 # Determine whether the default compiler is a.out or elf | |
986 eval $set_cc_for_build | |
987 sed 's/^ //' << EOF >$dummy.c | |
988 #include <features.h> | |
989 #ifdef __ELF__ | |
990 # ifdef __GLIBC__ | |
991 # if __GLIBC__ >= 2 | |
992 LIBC=gnu | |
993 # else | |
994 LIBC=gnulibc1 | |
995 # endif | |
996 # else | |
997 LIBC=gnulibc1 | |
998 # endif | |
999 #else | |
1000 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) | |
1001 LIBC=gnu | |
1002 #else | |
1003 LIBC=gnuaout | |
1004 #endif | |
1005 #endif | |
1006 #ifdef __dietlibc__ | |
1007 LIBC=dietlibc | |
1008 #endif | |
1009 EOF | |
1010 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | |
1011 /^LIBC/{ | |
1012 s: ::g | |
1013 p | |
1014 }'`" | |
1015 test x"${LIBC}" != x && { | |
1016 echo "${UNAME_MACHINE}-pc-linux-${LIBC}" | |
1017 exit | |
1018 } | |
1019 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } | |
1020 ;; | |
1021 i*86:DYNIX/ptx:4*:*) | 980 i*86:DYNIX/ptx:4*:*) |
1022 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. | 981 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
1023 # earlier versions are messed up and put the nodename in both | 982 # earlier versions are messed up and put the nodename in both |
1024 # sysname and nodename. | 983 # sysname and nodename. |
1025 echo i386-sequent-sysv4 | 984 echo i386-sequent-sysv4 |
1245 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} | 1204 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
1246 exit ;; | 1205 exit ;; |
1247 *:Darwin:*:*) | 1206 *:Darwin:*:*) |
1248 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | 1207 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown |
1249 case $UNAME_PROCESSOR in | 1208 case $UNAME_PROCESSOR in |
1209 i386) | |
1210 eval $set_cc_for_build | |
1211 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | |
1212 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | |
1213 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | |
1214 grep IS_64BIT_ARCH >/dev/null | |
1215 then | |
1216 UNAME_PROCESSOR="x86_64" | |
1217 fi | |
1218 fi ;; | |
1250 unknown) UNAME_PROCESSOR=powerpc ;; | 1219 unknown) UNAME_PROCESSOR=powerpc ;; |
1251 esac | 1220 esac |
1252 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} | 1221 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
1253 exit ;; | 1222 exit ;; |
1254 *:procnto*:*:* | *:QNX:[0123456789]*:*) | 1223 *:procnto*:*:* | *:QNX:[0123456789]*:*) |