build-scripts/config.guess
changeset 2294 386ebf50dd91
parent 1361 19418e4422cb
child 3086 0102ed19c21a
child 4282 4909c960832e
equal deleted inserted replaced
2293:824f6dee6648 2294:386ebf50dd91
     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 Free Software Foundation, Inc.
     4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
     5 
     5 #   Inc.
     6 timestamp='2006-01-02'
     6 
       
     7 timestamp='2007-12-12'
     7 
     8 
     8 # 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
     9 # 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
    10 # the Free Software Foundation; either version 2 of the License, or
    11 # the Free Software Foundation; either version 2 of the License, or
    11 # (at your option) any later version.
    12 # (at your option) any later version.
   104 
   105 
   105 set_cc_for_build='
   106 set_cc_for_build='
   106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
   107 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
   107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
   108 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
   108 : ${TMPDIR=/tmp} ;
   109 : ${TMPDIR=/tmp} ;
   109  { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
   110  { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
   110  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
   111  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
   111  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
   112  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
   112  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
   113  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
   113 dummy=$tmp/dummy ;
   114 dummy=$tmp/dummy ;
   114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
   115 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
   158 	case "${UNAME_MACHINE_ARCH}" in
   159 	case "${UNAME_MACHINE_ARCH}" in
   159 	    armeb) machine=armeb-unknown ;;
   160 	    armeb) machine=armeb-unknown ;;
   160 	    arm*) machine=arm-unknown ;;
   161 	    arm*) machine=arm-unknown ;;
   161 	    sh3el) machine=shl-unknown ;;
   162 	    sh3el) machine=shl-unknown ;;
   162 	    sh3eb) machine=sh-unknown ;;
   163 	    sh3eb) machine=sh-unknown ;;
       
   164 	    sh5el) machine=sh5le-unknown ;;
   163 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
   165 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
   164 	esac
   166 	esac
   165 	# The Operating System including object format, if it has switched
   167 	# The Operating System including object format, if it has switched
   166 	# to ELF recently, or will in the future.
   168 	# to ELF recently, or will in the future.
   167 	case "${UNAME_MACHINE_ARCH}" in
   169 	case "${UNAME_MACHINE_ARCH}" in
   208 	exit ;;
   210 	exit ;;
   209     *:SolidBSD:*:*)
   211     *:SolidBSD:*:*)
   210 	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
   212 	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
   211 	exit ;;
   213 	exit ;;
   212     macppc:MirBSD:*:*)
   214     macppc:MirBSD:*:*)
   213 	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
   215 	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
   214 	exit ;;
   216 	exit ;;
   215     *:MirBSD:*:*)
   217     *:MirBSD:*:*)
   216 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
   218 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
   217 	exit ;;
   219 	exit ;;
   218     alpha:OSF1:*:*)
   220     alpha:OSF1:*:*)
   326 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   328 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   327 	exit ;;
   329 	exit ;;
   328     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   330     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   329 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   331 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   330 	exit ;;
   332 	exit ;;
   331     i86pc:SunOS:5.*:*)
   333     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
   332 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   334 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   333 	exit ;;
   335 	exit ;;
   334     sun4*:SunOS:6*:*)
   336     sun4*:SunOS:6*:*)
   335 	# According to config.sub, this is the proper way to canonicalize
   337 	# According to config.sub, this is the proper way to canonicalize
   336 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
   338 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
   768 	exit ;;
   770 	exit ;;
   769     *:FreeBSD:*:*)
   771     *:FreeBSD:*:*)
   770 	case ${UNAME_MACHINE} in
   772 	case ${UNAME_MACHINE} in
   771 	    pc98)
   773 	    pc98)
   772 		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   774 		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
       
   775 	    amd64)
       
   776 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   773 	    *)
   777 	    *)
   774 		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   778 		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   775 	esac
   779 	esac
   776 	exit ;;
   780 	exit ;;
   777     i*:CYGWIN*:*)
   781     i*:CYGWIN*:*)
   778 	echo ${UNAME_MACHINE}-pc-cygwin
   782 	echo ${UNAME_MACHINE}-pc-cygwin
   779 	exit ;;
   783 	exit ;;
   780     i*:MINGW*:*)
   784     *:MINGW*:*)
   781 	echo ${UNAME_MACHINE}-pc-mingw32
   785 	echo ${UNAME_MACHINE}-pc-mingw32
   782 	exit ;;
   786 	exit ;;
   783     i*:windows32*:*)
   787     i*:windows32*:*)
   784     	# uname -m includes "-pc" on this system.
   788     	# uname -m includes "-pc" on this system.
   785     	echo ${UNAME_MACHINE}-mingw32
   789     	echo ${UNAME_MACHINE}-mingw32
   786 	exit ;;
   790 	exit ;;
   787     i*:PW*:*)
   791     i*:PW*:*)
   788 	echo ${UNAME_MACHINE}-pc-pw32
   792 	echo ${UNAME_MACHINE}-pc-pw32
   789 	exit ;;
   793 	exit ;;
   790     x86:Interix*:[345]*)
   794     *:Interix*:[3456]*)
   791 	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
   795     	case ${UNAME_MACHINE} in
   792 	exit ;;
   796 	    x86)
       
   797 		echo i586-pc-interix${UNAME_RELEASE}
       
   798 		exit ;;
       
   799 	    EM64T | authenticamd)
       
   800 		echo x86_64-unknown-interix${UNAME_RELEASE}
       
   801 		exit ;;
       
   802 	    IA64)
       
   803 		echo ia64-unknown-interix${UNAME_RELEASE}
       
   804 		exit ;;
       
   805 	esac ;;
   793     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
   806     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
   794 	echo i${UNAME_MACHINE}-pc-mks
   807 	echo i${UNAME_MACHINE}-pc-mks
   795 	exit ;;
   808 	exit ;;
   796     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   809     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   797 	# How do we know it's Interix rather than the generic POSIX subsystem?
   810 	# How do we know it's Interix rather than the generic POSIX subsystem?
   821 	exit ;;
   834 	exit ;;
   822     i*86:Minix:*:*)
   835     i*86:Minix:*:*)
   823 	echo ${UNAME_MACHINE}-pc-minix
   836 	echo ${UNAME_MACHINE}-pc-minix
   824 	exit ;;
   837 	exit ;;
   825     arm*:Linux:*:*)
   838     arm*:Linux:*:*)
       
   839 	eval $set_cc_for_build
       
   840 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
       
   841 	    | grep -q __ARM_EABI__
       
   842 	then
       
   843 	    echo ${UNAME_MACHINE}-unknown-linux-gnu
       
   844 	else
       
   845 	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
       
   846 	fi
       
   847 	exit ;;
       
   848     avr32*:Linux:*:*)
   826 	echo ${UNAME_MACHINE}-unknown-linux-gnu
   849 	echo ${UNAME_MACHINE}-unknown-linux-gnu
   827 	exit ;;
   850 	exit ;;
   828     cris:Linux:*:*)
   851     cris:Linux:*:*)
   829 	echo cris-axis-linux-gnu
   852 	echo cris-axis-linux-gnu
   830 	exit ;;
   853 	exit ;;
   857 	#else
   880 	#else
   858 	CPU=
   881 	CPU=
   859 	#endif
   882 	#endif
   860 	#endif
   883 	#endif
   861 EOF
   884 EOF
   862 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
   885 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
       
   886 	    /^CPU/{
       
   887 		s: ::g
       
   888 		p
       
   889 	    }'`"
   863 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   890 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   864 	;;
   891 	;;
   865     mips64:Linux:*:*)
   892     mips64:Linux:*:*)
   866 	eval $set_cc_for_build
   893 	eval $set_cc_for_build
   867 	sed 's/^	//' << EOF >$dummy.c
   894 	sed 's/^	//' << EOF >$dummy.c
   876 	#else
   903 	#else
   877 	CPU=
   904 	CPU=
   878 	#endif
   905 	#endif
   879 	#endif
   906 	#endif
   880 EOF
   907 EOF
   881 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
   908 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
       
   909 	    /^CPU/{
       
   910 		s: ::g
       
   911 		p
       
   912 	    }'`"
   882 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   913 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   883 	;;
   914 	;;
   884     or32:Linux:*:*)
   915     or32:Linux:*:*)
   885 	echo or32-unknown-linux-gnu
   916 	echo or32-unknown-linux-gnu
   886 	exit ;;
   917 	exit ;;
   930     vax:Linux:*:*)
   961     vax:Linux:*:*)
   931 	echo ${UNAME_MACHINE}-dec-linux-gnu
   962 	echo ${UNAME_MACHINE}-dec-linux-gnu
   932 	exit ;;
   963 	exit ;;
   933     x86_64:Linux:*:*)
   964     x86_64:Linux:*:*)
   934 	echo x86_64-unknown-linux-gnu
   965 	echo x86_64-unknown-linux-gnu
       
   966 	exit ;;
       
   967     xtensa*:Linux:*:*)
       
   968     	echo ${UNAME_MACHINE}-unknown-linux-gnu
   935 	exit ;;
   969 	exit ;;
   936     i*86:Linux:*:*)
   970     i*86:Linux:*:*)
   937 	# The BFD linker knows what the default object file format is, so
   971 	# The BFD linker knows what the default object file format is, so
   938 	# first see if it will tell us. cd to the root directory to prevent
   972 	# first see if it will tell us. cd to the root directory to prevent
   939 	# problems with other programs or directories called `ld' in the path.
   973 	# problems with other programs or directories called `ld' in the path.
   973 	#  endif
  1007 	#  endif
   974 	# else
  1008 	# else
   975 	LIBC=gnulibc1
  1009 	LIBC=gnulibc1
   976 	# endif
  1010 	# endif
   977 	#else
  1011 	#else
   978 	#if defined(__INTEL_COMPILER) || defined(__PGI)
  1012 	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
   979 	LIBC=gnu
  1013 	LIBC=gnu
   980 	#else
  1014 	#else
   981 	LIBC=gnuaout
  1015 	LIBC=gnuaout
   982 	#endif
  1016 	#endif
   983 	#endif
  1017 	#endif
   984 	#ifdef __dietlibc__
  1018 	#ifdef __dietlibc__
   985 	LIBC=dietlibc
  1019 	LIBC=dietlibc
   986 	#endif
  1020 	#endif
   987 EOF
  1021 EOF
   988 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`"
  1022 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
       
  1023 	    /^LIBC/{
       
  1024 		s: ::g
       
  1025 		p
       
  1026 	    }'`"
   989 	test x"${LIBC}" != x && {
  1027 	test x"${LIBC}" != x && {
   990 		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
  1028 		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
   991 		exit
  1029 		exit
   992 	}
  1030 	}
   993 	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
  1031 	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
  1184     SX-5:SUPER-UX:*:*)
  1222     SX-5:SUPER-UX:*:*)
  1185 	echo sx5-nec-superux${UNAME_RELEASE}
  1223 	echo sx5-nec-superux${UNAME_RELEASE}
  1186 	exit ;;
  1224 	exit ;;
  1187     SX-6:SUPER-UX:*:*)
  1225     SX-6:SUPER-UX:*:*)
  1188 	echo sx6-nec-superux${UNAME_RELEASE}
  1226 	echo sx6-nec-superux${UNAME_RELEASE}
       
  1227 	exit ;;
       
  1228     SX-7:SUPER-UX:*:*)
       
  1229 	echo sx7-nec-superux${UNAME_RELEASE}
       
  1230 	exit ;;
       
  1231     SX-8:SUPER-UX:*:*)
       
  1232 	echo sx8-nec-superux${UNAME_RELEASE}
       
  1233 	exit ;;
       
  1234     SX-8R:SUPER-UX:*:*)
       
  1235 	echo sx8r-nec-superux${UNAME_RELEASE}
  1189 	exit ;;
  1236 	exit ;;
  1190     Power*:Rhapsody:*:*)
  1237     Power*:Rhapsody:*:*)
  1191 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1238 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1192 	exit ;;
  1239 	exit ;;
  1193     *:Rhapsody:*:*)
  1240     *:Rhapsody:*:*)