Check-in [a3c60c5f6b]
Overview
Comment:Updated autoconf helper scripts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a3c60c5f6b30bbebd65ca2d42e609a5cde79b3e6
User & Date: rkeene on 2012-02-14 15:57:02
Other Links: manifest | tags
Context
2012-02-14
15:58
Added patch for all versions of Tcl to fix issue with Tcl_StatBuf affecting Tcl 8.5.2+ through current fossil trunk tip check-in: 7f3a9411cf user: rkeene tags: trunk
15:57
Updated autoconf helper scripts check-in: a3c60c5f6b user: rkeene tags: trunk
2012-02-01
07:56
Updated to call "/usr/bin/env" to locate "bash" in case it is not in "/bin" check-in: 4e8d261d38 user: rkeene tags: trunk
Changes

Modified kitsh/buildsrc/kitsh-0.0/config.guess from [23da712e9c] to [62de42768f].

     1      1   #! /bin/sh
     2      2   # Attempt to guess a canonical system name.
     3      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, 2007, 2008, 2009, 2010
            5  +#   Free Software Foundation, Inc.
     5      6   
     6         -timestamp='2005-07-08'
            7  +timestamp='2010-08-21'
     7      8   
     8      9   # This file is free software; you can redistribute it and/or modify it
     9     10   # under the terms of the GNU General Public License as published by
    10     11   # the Free Software Foundation; either version 2 of the License, or
    11     12   # (at your option) any later version.
    12     13   #
    13     14   # This program is distributed in the hope that it will be useful, but
................................................................................
    22     23   #
    23     24   # As a special exception to the GNU General Public License, if you
    24     25   # distribute this file as part of a program that contains a
    25     26   # configuration script generated by Autoconf, you may include it under
    26     27   # the same distribution terms that you use for the rest of that program.
    27     28   
    28     29   
    29         -# Originally written by Per Bothner <per@bothner.com>.
    30         -# Please send patches to <config-patches@gnu.org>.  Submit a context
    31         -# diff and a properly formatted ChangeLog entry.
           30  +# Originally written by Per Bothner.  Please send patches (context
           31  +# diff format) to <config-patches@gnu.org> and include a ChangeLog
           32  +# entry.
    32     33   #
    33     34   # This script attempts to guess a canonical system name similar to
    34     35   # config.sub.  If it succeeds, it prints the system name on stdout, and
    35     36   # exits with 0.  Otherwise, it exits with 1.
    36     37   #
    37         -# The plan is that this can be called by configure scripts if you
    38         -# don't specify an explicit build system type.
           38  +# You can get the latest version of this script from:
           39  +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
    39     40   
    40     41   me=`echo "$0" | sed -e 's,.*/,,'`
    41     42   
    42     43   usage="\
    43     44   Usage: $0 [OPTION]
    44     45   
    45     46   Output the configuration name of the system \`$me' is run on.
................................................................................
    51     52   
    52     53   Report bugs and patches to <config-patches@gnu.org>."
    53     54   
    54     55   version="\
    55     56   GNU config.guess ($timestamp)
    56     57   
    57     58   Originally written by Per Bothner.
    58         -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    59         -Free Software Foundation, Inc.
           59  +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
           60  +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
           61  +Software Foundation, Inc.
    60     62   
    61     63   This is free software; see the source for copying conditions.  There is NO
    62     64   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    63     65   
    64     66   help="
    65     67   Try \`$me --help' for more information."
    66     68   
................................................................................
    86     88   done
    87     89   
    88     90   if test $# != 0; then
    89     91     echo "$me: too many arguments$help" >&2
    90     92     exit 1
    91     93   fi
    92     94   
    93         -trap 'exit 1' 1 2 15
           95  +trap 'exit 1' HUP INT TERM
    94     96   
    95     97   # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
    96     98   # compiler to aid in system detection is discouraged as it requires
    97     99   # temporary files to be created and, as you can see below, it is a
    98    100   # headache to deal with in a portable fashion.
    99    101   
   100    102   # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
   101    103   # use `HOST_CC' if defined, but it is deprecated.
   102    104   
   103    105   # Portable tmp directory creation inspired by the Autoconf team.
   104    106   
   105    107   set_cc_for_build='
   106    108   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 ;
          109  +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
   108    110   : ${TMPDIR=/tmp} ;
   109         - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
          111  + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
   110    112    { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
   111    113    { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
   112    114    { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
   113    115   dummy=$tmp/dummy ;
   114    116   tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
   115    117   case $CC_FOR_BUILD,$HOST_CC,$CC in
   116    118    ,,)    echo "int x;" > $dummy.c ;
................................................................................
   156    158   	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
   157    159   	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
   158    160   	case "${UNAME_MACHINE_ARCH}" in
   159    161   	    armeb) machine=armeb-unknown ;;
   160    162   	    arm*) machine=arm-unknown ;;
   161    163   	    sh3el) machine=shl-unknown ;;
   162    164   	    sh3eb) machine=sh-unknown ;;
          165  +	    sh5el) machine=sh5le-unknown ;;
   163    166   	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
   164    167   	esac
   165    168   	# The Operating System including object format, if it has switched
   166    169   	# to ELF recently, or will in the future.
   167    170   	case "${UNAME_MACHINE_ARCH}" in
   168    171   	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
   169    172   		eval $set_cc_for_build
   170    173   		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   171         -			| grep __ELF__ >/dev/null
          174  +			| grep -q __ELF__
   172    175   		then
   173    176   		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
   174    177   		    # Return netbsd for either.  FIX?
   175    178   		    os=netbsd
   176    179   		else
   177    180   		    os=netbsdelf
   178    181   		fi
................................................................................
   202    205       *:OpenBSD:*:*)
   203    206   	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
   204    207   	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
   205    208   	exit ;;
   206    209       *:ekkoBSD:*:*)
   207    210   	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
   208    211   	exit ;;
          212  +    *:SolidBSD:*:*)
          213  +	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
          214  +	exit ;;
   209    215       macppc:MirBSD:*:*)
   210         -	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
          216  +	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
   211    217   	exit ;;
   212    218       *:MirBSD:*:*)
   213    219   	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
   214    220   	exit ;;
   215    221       alpha:OSF1:*:*)
   216    222   	case $UNAME_RELEASE in
   217    223   	*4.0)
................................................................................
   315    321       DRS?6000:unix:4.0:6*)
   316    322   	echo sparc-icl-nx6
   317    323   	exit ;;
   318    324       DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
   319    325   	case `/usr/bin/uname -p` in
   320    326   	    sparc) echo sparc-icl-nx7; exit ;;
   321    327   	esac ;;
          328  +    s390x:SunOS:*:*)
          329  +	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          330  +	exit ;;
   322    331       sun4H:SunOS:5.*:*)
   323    332   	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   324    333   	exit ;;
   325    334       sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   326    335   	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   327    336   	exit ;;
   328         -    i86pc:SunOS:5.*:*)
   329         -	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          337  +    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
          338  +	echo i386-pc-auroraux${UNAME_RELEASE}
          339  +	exit ;;
          340  +    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
          341  +	eval $set_cc_for_build
          342  +	SUN_ARCH="i386"
          343  +	# If there is a compiler, see if it is configured for 64-bit objects.
          344  +	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
          345  +	# This test works for both compilers.
          346  +	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
          347  +	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
          348  +		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
          349  +		grep IS_64BIT_ARCH >/dev/null
          350  +	    then
          351  +		SUN_ARCH="x86_64"
          352  +	    fi
          353  +	fi
          354  +	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   330    355   	exit ;;
   331    356       sun4*:SunOS:6*:*)
   332    357   	# According to config.sub, this is the proper way to canonicalize
   333    358   	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
   334    359   	# it's likely to be more like Solaris than SunOS4.
   335    360   	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   336    361   	exit ;;
................................................................................
   523    548   		fi
   524    549   	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
   525    550   		echo rs6000-ibm-aix3.2.4
   526    551   	else
   527    552   		echo rs6000-ibm-aix3.2
   528    553   	fi
   529    554   	exit ;;
   530         -    *:AIX:*:[45])
          555  +    *:AIX:*:[4567])
   531    556   	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
   532    557   	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
   533    558   		IBM_ARCH=rs6000
   534    559   	else
   535    560   		IBM_ARCH=powerpc
   536    561   	fi
   537    562   	if [ -x /usr/bin/oslevel ] ; then
................................................................................
   631    656   	    #
   632    657   	    # $ CC_FOR_BUILD=cc ./config.guess
   633    658   	    # => hppa2.0w-hp-hpux11.23
   634    659   	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
   635    660   	    # => hppa64-hp-hpux11.23
   636    661   
   637    662   	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
   638         -		grep __LP64__ >/dev/null
          663  +		grep -q __LP64__
   639    664   	    then
   640    665   		HP_ARCH="hppa2.0w"
   641    666   	    else
   642    667   		HP_ARCH="hppa64"
   643    668   	    fi
   644    669   	fi
   645    670   	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
................................................................................
   760    785       sparc*:BSD/OS:*:*)
   761    786   	echo sparc-unknown-bsdi${UNAME_RELEASE}
   762    787   	exit ;;
   763    788       *:BSD/OS:*:*)
   764    789   	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
   765    790   	exit ;;
   766    791       *:FreeBSD:*:*)
   767         -	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
          792  +	case ${UNAME_MACHINE} in
          793  +	    pc98)
          794  +		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          795  +	    amd64)
          796  +		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          797  +	    *)
          798  +		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          799  +	esac
   768    800   	exit ;;
   769    801       i*:CYGWIN*:*)
   770    802   	echo ${UNAME_MACHINE}-pc-cygwin
   771    803   	exit ;;
   772         -    i*:MINGW*:*)
          804  +    *:MINGW*:*)
   773    805   	echo ${UNAME_MACHINE}-pc-mingw32
   774    806   	exit ;;
   775    807       i*:windows32*:*)
   776    808       	# uname -m includes "-pc" on this system.
   777    809       	echo ${UNAME_MACHINE}-mingw32
   778    810   	exit ;;
   779    811       i*:PW*:*)
   780    812   	echo ${UNAME_MACHINE}-pc-pw32
   781    813   	exit ;;
   782         -    x86:Interix*:[34]*)
   783         -	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
   784         -	exit ;;
          814  +    *:Interix*:*)
          815  +    	case ${UNAME_MACHINE} in
          816  +	    x86)
          817  +		echo i586-pc-interix${UNAME_RELEASE}
          818  +		exit ;;
          819  +	    authenticamd | genuineintel | EM64T)
          820  +		echo x86_64-unknown-interix${UNAME_RELEASE}
          821  +		exit ;;
          822  +	    IA64)
          823  +		echo ia64-unknown-interix${UNAME_RELEASE}
          824  +		exit ;;
          825  +	esac ;;
   785    826       [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
   786    827   	echo i${UNAME_MACHINE}-pc-mks
          828  +	exit ;;
          829  +    8664:Windows_NT:*)
          830  +	echo x86_64-pc-mks
   787    831   	exit ;;
   788    832       i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   789    833   	# How do we know it's Interix rather than the generic POSIX subsystem?
   790    834   	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
   791    835   	# UNAME_MACHINE based on the output of uname instead of i386?
   792    836   	echo i586-pc-interix
   793    837   	exit ;;
   794    838       i*:UWIN*:*)
   795    839   	echo ${UNAME_MACHINE}-pc-uwin
   796    840   	exit ;;
   797         -    amd64:CYGWIN*:*:*)
          841  +    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
   798    842   	echo x86_64-unknown-cygwin
   799    843   	exit ;;
   800    844       p*:CYGWIN*:*)
   801    845   	echo powerpcle-unknown-cygwin
   802    846   	exit ;;
   803    847       prep*:SunOS:5.*:*)
   804    848   	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
................................................................................
   810    854       *:GNU/*:*:*)
   811    855   	# other systems with GNU libc and userland
   812    856   	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
   813    857   	exit ;;
   814    858       i*86:Minix:*:*)
   815    859   	echo ${UNAME_MACHINE}-pc-minix
   816    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 ;;
   817    875       arm*:Linux:*:*)
          876  +	eval $set_cc_for_build
          877  +	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
          878  +	    | grep -q __ARM_EABI__
          879  +	then
          880  +	    echo ${UNAME_MACHINE}-unknown-linux-gnu
          881  +	else
          882  +	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
          883  +	fi
          884  +	exit ;;
          885  +    avr32*:Linux:*:*)
   818    886   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   819    887   	exit ;;
   820    888       cris:Linux:*:*)
   821    889   	echo cris-axis-linux-gnu
   822    890   	exit ;;
   823    891       crisv32:Linux:*:*)
   824    892   	echo crisv32-axis-linux-gnu
   825    893   	exit ;;
   826    894       frv:Linux:*:*)
   827    895       	echo frv-unknown-linux-gnu
   828    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}"
          907  +	exit ;;
   829    908       ia64:Linux:*:*)
   830    909   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   831    910   	exit ;;
   832    911       m32r*:Linux:*:*)
   833    912   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   834    913   	exit ;;
   835    914       m68*:Linux:*:*)
   836    915   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   837    916   	exit ;;
   838         -    mips:Linux:*:*)
          917  +    mips:Linux:*:* | mips64:Linux:*:*)
   839    918   	eval $set_cc_for_build
   840    919   	sed 's/^	//' << EOF >$dummy.c
   841    920   	#undef CPU
   842         -	#undef mips
   843         -	#undef mipsel
          921  +	#undef ${UNAME_MACHINE}
          922  +	#undef ${UNAME_MACHINE}el
   844    923   	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   845         -	CPU=mipsel
          924  +	CPU=${UNAME_MACHINE}el
   846    925   	#else
   847    926   	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   848         -	CPU=mips
          927  +	CPU=${UNAME_MACHINE}
   849    928   	#else
   850    929   	CPU=
   851    930   	#endif
   852    931   	#endif
   853    932   EOF
   854         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
          933  +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
   855    934   	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   856    935   	;;
   857         -    mips64:Linux:*:*)
   858         -	eval $set_cc_for_build
   859         -	sed 's/^	//' << EOF >$dummy.c
   860         -	#undef CPU
   861         -	#undef mips64
   862         -	#undef mips64el
   863         -	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   864         -	CPU=mips64el
   865         -	#else
   866         -	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   867         -	CPU=mips64
   868         -	#else
   869         -	CPU=
   870         -	#endif
   871         -	#endif
   872         -EOF
   873         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
   874         -	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   875         -	;;
   876         -    ppc:Linux:*:*)
   877         -	echo powerpc-unknown-linux-gnu
          936  +    or32:Linux:*:*)
          937  +	echo or32-unknown-linux-gnu
   878    938   	exit ;;
   879         -    ppc64:Linux:*:*)
   880         -	echo powerpc64-unknown-linux-gnu
          939  +    padre:Linux:*:*)
          940  +	echo sparc-unknown-linux-gnu
   881    941   	exit ;;
   882         -    alpha:Linux:*:*)
   883         -	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   884         -	  EV5)   UNAME_MACHINE=alphaev5 ;;
   885         -	  EV56)  UNAME_MACHINE=alphaev56 ;;
   886         -	  PCA56) UNAME_MACHINE=alphapca56 ;;
   887         -	  PCA57) UNAME_MACHINE=alphapca56 ;;
   888         -	  EV6)   UNAME_MACHINE=alphaev6 ;;
   889         -	  EV67)  UNAME_MACHINE=alphaev67 ;;
   890         -	  EV68*) UNAME_MACHINE=alphaev68 ;;
   891         -        esac
   892         -	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
   893         -	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
   894         -	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
          942  +    parisc64:Linux:*:* | hppa64:Linux:*:*)
          943  +	echo hppa64-unknown-linux-gnu
   895    944   	exit ;;
   896    945       parisc:Linux:*:* | hppa:Linux:*:*)
   897    946   	# Look for CPU level
   898    947   	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   899    948   	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
   900    949   	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
   901    950   	  *)    echo hppa-unknown-linux-gnu ;;
   902    951   	esac
   903    952   	exit ;;
   904         -    parisc64:Linux:*:* | hppa64:Linux:*:*)
   905         -	echo hppa64-unknown-linux-gnu
          953  +    ppc64:Linux:*:*)
          954  +	echo powerpc64-unknown-linux-gnu
          955  +	exit ;;
          956  +    ppc:Linux:*:*)
          957  +	echo powerpc-unknown-linux-gnu
   906    958   	exit ;;
   907    959       s390:Linux:*:* | s390x:Linux:*:*)
   908    960   	echo ${UNAME_MACHINE}-ibm-linux
   909    961   	exit ;;
   910    962       sh64*:Linux:*:*)
   911    963       	echo ${UNAME_MACHINE}-unknown-linux-gnu
   912    964   	exit ;;
   913    965       sh*:Linux:*:*)
   914    966   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   915    967   	exit ;;
   916    968       sparc:Linux:*:* | sparc64:Linux:*:*)
   917    969   	echo ${UNAME_MACHINE}-unknown-linux-gnu
   918    970   	exit ;;
          971  +    tile*:Linux:*:*)
          972  +	echo ${UNAME_MACHINE}-tilera-linux-gnu
          973  +	exit ;;
          974  +    vax:Linux:*:*)
          975  +	echo ${UNAME_MACHINE}-dec-linux-gnu
          976  +	exit ;;
   919    977       x86_64:Linux:*:*)
   920    978   	echo x86_64-unknown-linux-gnu
   921    979   	exit ;;
   922         -    i*86:Linux:*:*)
   923         -	# The BFD linker knows what the default object file format is, so
   924         -	# first see if it will tell us. cd to the root directory to prevent
   925         -	# problems with other programs or directories called `ld' in the path.
   926         -	# Set LC_ALL=C to ensure ld outputs messages in English.
   927         -	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
   928         -			 | sed -ne '/supported targets:/!d
   929         -				    s/[ 	][ 	]*/ /g
   930         -				    s/.*supported targets: *//
   931         -				    s/ .*//
   932         -				    p'`
   933         -        case "$ld_supported_targets" in
   934         -	  elf32-i386)
   935         -		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
   936         -		;;
   937         -	  a.out-i386-linux)
   938         -		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
   939         -		exit ;;
   940         -	  coff-i386)
   941         -		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
   942         -		exit ;;
   943         -	  "")
   944         -		# Either a pre-BFD a.out linker (linux-gnuoldld) or
   945         -		# one that does not give us useful --help.
   946         -		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
   947         -		exit ;;
   948         -	esac
   949         -	# Determine whether the default compiler is a.out or elf
   950         -	eval $set_cc_for_build
   951         -	sed 's/^	//' << EOF >$dummy.c
   952         -	#include <features.h>
   953         -	#ifdef __ELF__
   954         -	# ifdef __GLIBC__
   955         -	#  if __GLIBC__ >= 2
   956         -	LIBC=gnu
   957         -	#  else
   958         -	LIBC=gnulibc1
   959         -	#  endif
   960         -	# else
   961         -	LIBC=gnulibc1
   962         -	# endif
   963         -	#else
   964         -	#ifdef __INTEL_COMPILER
   965         -	LIBC=gnu
   966         -	#else
   967         -	LIBC=gnuaout
   968         -	#endif
   969         -	#endif
   970         -	#ifdef __dietlibc__
   971         -	LIBC=dietlibc
   972         -	#endif
   973         -EOF
   974         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
   975         -	test x"${LIBC}" != x && {
   976         -		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
   977         -		exit
   978         -	}
   979         -	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
   980         -	;;
          980  +    xtensa*:Linux:*:*)
          981  +    	echo ${UNAME_MACHINE}-unknown-linux-gnu
          982  +	exit ;;
   981    983       i*86:DYNIX/ptx:4*:*)
   982    984   	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
   983    985   	# earlier versions are messed up and put the nodename in both
   984    986   	# sysname and nodename.
   985    987   	echo i386-sequent-sysv4
   986    988   	exit ;;
   987    989       i*86:UNIX_SV:4.2MP:2.*)
................................................................................
  1002   1004   	exit ;;
  1003   1005       i*86:atheos:*:*)
  1004   1006   	echo ${UNAME_MACHINE}-unknown-atheos
  1005   1007   	exit ;;
  1006   1008       i*86:syllable:*:*)
  1007   1009   	echo ${UNAME_MACHINE}-pc-syllable
  1008   1010   	exit ;;
  1009         -    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
         1011  +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
  1010   1012   	echo i386-unknown-lynxos${UNAME_RELEASE}
  1011   1013   	exit ;;
  1012   1014       i*86:*DOS:*:*)
  1013   1015   	echo ${UNAME_MACHINE}-pc-msdosdjgpp
  1014   1016   	exit ;;
  1015   1017       i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  1016   1018   	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
................................................................................
  1046   1048   	else
  1047   1049   		echo ${UNAME_MACHINE}-pc-sysv32
  1048   1050   	fi
  1049   1051   	exit ;;
  1050   1052       pc:*:*:*)
  1051   1053   	# Left here for compatibility:
  1052   1054           # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1053         -        # the processor, so we play safe by assuming i386.
  1054         -	echo i386-pc-msdosdjgpp
         1055  +        # the processor, so we play safe by assuming i586.
         1056  +	# Note: whatever this is, it MUST be the same as what config.sub
         1057  +	# prints for the "djgpp" host, or else GDB configury will decide that
         1058  +	# this is a cross-build.
         1059  +	echo i586-pc-msdosdjgpp
  1055   1060           exit ;;
  1056   1061       Intel:Mach:3*:*)
  1057   1062   	echo i386-pc-mach3
  1058   1063   	exit ;;
  1059   1064       paragon:*:*:*)
  1060   1065   	echo i860-intel-osf1
  1061   1066   	exit ;;
................................................................................
  1085   1090   	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1086   1091   	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
  1087   1092   	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1088   1093   	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
  1089   1094       3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1090   1095           /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1091   1096             && { echo i486-ncr-sysv4; exit; } ;;
         1097  +    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
         1098  +	OS_REL='.3'
         1099  +	test -r /etc/.relid \
         1100  +	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
         1101  +	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
         1102  +	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
         1103  +	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
         1104  +	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
         1105  +	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
         1106  +	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
  1092   1107       m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1093   1108   	echo m68k-unknown-lynxos${UNAME_RELEASE}
  1094   1109   	exit ;;
  1095   1110       mc68030:UNIX_System_V:4.*:*)
  1096   1111   	echo m68k-atari-sysv4
  1097   1112   	exit ;;
  1098   1113       TSUNAMI:LynxOS:2.*:*)
  1099   1114   	echo sparc-unknown-lynxos${UNAME_RELEASE}
  1100   1115   	exit ;;
  1101   1116       rs6000:LynxOS:2.*:*)
  1102   1117   	echo rs6000-unknown-lynxos${UNAME_RELEASE}
  1103   1118   	exit ;;
  1104         -    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
         1119  +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
  1105   1120   	echo powerpc-unknown-lynxos${UNAME_RELEASE}
  1106   1121   	exit ;;
  1107   1122       SM[BE]S:UNIX_SV:*:*)
  1108   1123   	echo mips-dde-sysv${UNAME_RELEASE}
  1109   1124   	exit ;;
  1110   1125       RM*:ReliantUNIX-*:*:*)
  1111   1126   	echo mips-sni-sysv4
................................................................................
  1159   1174   	echo powerpc-be-beos
  1160   1175   	exit ;;
  1161   1176       BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
  1162   1177   	echo powerpc-apple-beos
  1163   1178   	exit ;;
  1164   1179       BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
  1165   1180   	echo i586-pc-beos
         1181  +	exit ;;
         1182  +    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
         1183  +	echo i586-pc-haiku
  1166   1184   	exit ;;
  1167   1185       SX-4:SUPER-UX:*:*)
  1168   1186   	echo sx4-nec-superux${UNAME_RELEASE}
  1169   1187   	exit ;;
  1170   1188       SX-5:SUPER-UX:*:*)
  1171   1189   	echo sx5-nec-superux${UNAME_RELEASE}
  1172   1190   	exit ;;
  1173   1191       SX-6:SUPER-UX:*:*)
  1174   1192   	echo sx6-nec-superux${UNAME_RELEASE}
  1175   1193   	exit ;;
         1194  +    SX-7:SUPER-UX:*:*)
         1195  +	echo sx7-nec-superux${UNAME_RELEASE}
         1196  +	exit ;;
         1197  +    SX-8:SUPER-UX:*:*)
         1198  +	echo sx8-nec-superux${UNAME_RELEASE}
         1199  +	exit ;;
         1200  +    SX-8R:SUPER-UX:*:*)
         1201  +	echo sx8r-nec-superux${UNAME_RELEASE}
         1202  +	exit ;;
  1176   1203       Power*:Rhapsody:*:*)
  1177   1204   	echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1178   1205   	exit ;;
  1179   1206       *:Rhapsody:*:*)
  1180   1207   	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1181   1208   	exit ;;
  1182   1209       *:Darwin:*:*)
  1183   1210   	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
  1184   1211   	case $UNAME_PROCESSOR in
  1185         -	    *86) UNAME_PROCESSOR=i686 ;;
         1212  +	    i386)
         1213  +		eval $set_cc_for_build
         1214  +		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
         1215  +		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
         1216  +		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
         1217  +		      grep IS_64BIT_ARCH >/dev/null
         1218  +		  then
         1219  +		      UNAME_PROCESSOR="x86_64"
         1220  +		  fi
         1221  +		fi ;;
  1186   1222   	    unknown) UNAME_PROCESSOR=powerpc ;;
  1187   1223   	esac
  1188   1224   	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
  1189   1225   	exit ;;
  1190   1226       *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1191   1227   	UNAME_PROCESSOR=`uname -p`
  1192   1228   	if test "$UNAME_PROCESSOR" = "x86"; then
................................................................................
  1257   1293   	esac ;;
  1258   1294       *:XENIX:*:SysV)
  1259   1295   	echo i386-pc-xenix
  1260   1296   	exit ;;
  1261   1297       i*86:skyos:*:*)
  1262   1298   	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
  1263   1299   	exit ;;
         1300  +    i*86:rdos:*:*)
         1301  +	echo ${UNAME_MACHINE}-pc-rdos
         1302  +	exit ;;
         1303  +    i*86:AROS:*:*)
         1304  +	echo ${UNAME_MACHINE}-pc-aros
         1305  +	exit ;;
  1264   1306   esac
  1265   1307   
  1266   1308   #echo '(No uname command or uname output not recognized.)' 1>&2
  1267   1309   #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1268   1310   
  1269   1311   eval $set_cc_for_build
  1270   1312   cat >$dummy.c <<EOF
................................................................................
  1417   1459   cat >&2 <<EOF
  1418   1460   $0: unable to guess system type
  1419   1461   
  1420   1462   This script, last modified $timestamp, has failed to recognize
  1421   1463   the operating system you are using. It is advised that you
  1422   1464   download the most up to date version of the config scripts from
  1423   1465   
  1424         -  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
         1466  +  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
  1425   1467   and
  1426         -  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
         1468  +  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
  1427   1469   
  1428   1470   If the version you run ($0) is already up to date, please
  1429   1471   send the following data and any information you think might be
  1430   1472   pertinent to <config-patches@gnu.org> in order to provide the needed
  1431   1473   information to handle your system.
  1432   1474   
  1433   1475   config.guess timestamp = $timestamp

Modified kitsh/buildsrc/kitsh-0.0/config.sub from [1f0ad14050] to [32f90ac76a].

     1      1   #! /bin/sh
     2      2   # Configuration validation subroutine script.
     3      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, 2007, 2008, 2009, 2010
            5  +#   Free Software Foundation, Inc.
     5      6   
     6         -timestamp='2005-07-08'
            7  +timestamp='2010-09-11'
     7      8   
     8      9   # This file is (in principle) common to ALL GNU software.
     9     10   # The presence of a machine in this file suggests that SOME GNU software
    10     11   # can handle that machine.  It does not imply ALL GNU software can.
    11     12   #
    12     13   # This file is free software; you can redistribute it and/or modify
    13     14   # it under the terms of the GNU General Public License as published by
................................................................................
    27     28   # As a special exception to the GNU General Public License, if you
    28     29   # distribute this file as part of a program that contains a
    29     30   # configuration script generated by Autoconf, you may include it under
    30     31   # the same distribution terms that you use for the rest of that program.
    31     32   
    32     33   
    33     34   # Please send patches to <config-patches@gnu.org>.  Submit a context
    34         -# diff and a properly formatted ChangeLog entry.
           35  +# diff and a properly formatted GNU ChangeLog entry.
    35     36   #
    36     37   # Configuration subroutine to validate and canonicalize a configuration type.
    37     38   # Supply the specified configuration type as an argument.
    38     39   # If it is invalid, we print an error message on stderr and exit with code 1.
    39     40   # Otherwise, we print the canonical config type on stdout and succeed.
    40     41   
           42  +# You can get the latest version of this script from:
           43  +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
           44  +
    41     45   # This file is supposed to be the same for all GNU packages
    42     46   # and recognize all the CPU types, system types and aliases
    43     47   # that are meaningful with *any* GNU software.
    44     48   # Each package is responsible for reporting which valid configurations
    45     49   # it does not support.  The user should be able to distinguish
    46     50   # a failure to support a valid configuration from a meaningless
    47     51   # configuration.
................................................................................
    67     71     -v, --version      print version number, then exit
    68     72   
    69     73   Report bugs and patches to <config-patches@gnu.org>."
    70     74   
    71     75   version="\
    72     76   GNU config.sub ($timestamp)
    73     77   
    74         -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    75         -Free Software Foundation, Inc.
           78  +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
           79  +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
           80  +Software Foundation, Inc.
    76     81   
    77     82   This is free software; see the source for copying conditions.  There is NO
    78     83   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    79     84   
    80     85   help="
    81     86   Try \`$me --help' for more information."
    82     87   
................................................................................
   115    120       exit 1;;
   116    121   esac
   117    122   
   118    123   # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
   119    124   # Here we must recognize all the valid KERNEL-OS combinations.
   120    125   maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
   121    126   case $maybe_os in
   122         -  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
   123         -  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
          127  +  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
          128  +  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
          129  +  knetbsd*-gnu* | netbsd*-gnu* | \
          130  +  kopensolaris*-gnu* | \
          131  +  storm-chaos* | os2-emx* | rtmk-nova*)
   124    132       os=-$maybe_os
   125    133       basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
   126    134       ;;
   127    135     *)
   128    136       basic_machine=`echo $1 | sed 's/-[^-]*$//'`
   129    137       if [ $basic_machine != $1 ]
   130    138       then os=`echo $1 | sed 's/.*-/-/'`
................................................................................
   142    150   		;;
   143    151   	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
   144    152   	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
   145    153   	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
   146    154   	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
   147    155   	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
   148    156   	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
   149         -	-apple | -axis | -knuth | -cray)
          157  +	-apple | -axis | -knuth | -cray | -microblaze)
   150    158   		os=
   151    159   		basic_machine=$1
          160  +		;;
          161  +        -bluegene*)
          162  +	        os=-cnk
   152    163   		;;
   153    164   	-sim | -cisco | -oki | -wec | -winbond)
   154    165   		os=
   155    166   		basic_machine=$1
   156    167   		;;
   157    168   	-scout)
   158    169   		;;
................................................................................
   167    178    	-chorusrdb)
   168    179    		os=-chorusrdb
   169    180   		basic_machine=$1
   170    181    		;;
   171    182   	-hiux*)
   172    183   		os=-hiuxwe2
   173    184   		;;
          185  +	-sco6)
          186  +		os=-sco5v6
          187  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          188  +		;;
   174    189   	-sco5)
   175    190   		os=-sco3.2v5
   176    191   		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
   177    192   		;;
   178    193   	-sco4)
   179    194   		os=-sco3.2v4
   180    195   		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
   181    196   		;;
   182    197   	-sco3.2.[4-9]*)
   183    198   		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
   184    199   		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
   185    200   		;;
   186    201   	-sco3.2v[4-9]*)
          202  +		# Don't forget version if it is 3.2v4 or newer.
          203  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          204  +		;;
          205  +	-sco5v6*)
   187    206   		# Don't forget version if it is 3.2v4 or newer.
   188    207   		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
   189    208   		;;
   190    209   	-sco*)
   191    210   		os=-sco3.2v2
   192    211   		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
   193    212   		;;
................................................................................
   227    246   	# Recognize the basic CPU types without company name.
   228    247   	# Some are omitted here because they have special meanings below.
   229    248   	1750a | 580 \
   230    249   	| a29k \
   231    250   	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
   232    251   	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
   233    252   	| am33_2.0 \
   234         -	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
          253  +	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
   235    254   	| bfin \
   236    255   	| c4x | clipper \
   237    256   	| d10v | d30v | dlx | dsp16xx \
   238         -	| fr30 | frv \
          257  +	| fido | fr30 | frv \
   239    258   	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
   240    259   	| i370 | i860 | i960 | ia64 \
   241    260   	| ip2k | iq2000 \
   242         -	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
          261  +	| lm32 \
          262  +	| m32c | m32r | m32rle | m68000 | m68k | m88k \
          263  +	| maxq | mb | microblaze | mcore | mep | metag \
   243    264   	| mips | mipsbe | mipseb | mipsel | mipsle \
   244    265   	| mips16 \
   245    266   	| mips64 | mips64el \
   246         -	| mips64vr | mips64vrel \
          267  +	| mips64octeon | mips64octeonel \
   247    268   	| mips64orion | mips64orionel \
          269  +	| mips64r5900 | mips64r5900el \
          270  +	| mips64vr | mips64vrel \
   248    271   	| mips64vr4100 | mips64vr4100el \
   249    272   	| mips64vr4300 | mips64vr4300el \
   250    273   	| mips64vr5000 | mips64vr5000el \
   251    274   	| mips64vr5900 | mips64vr5900el \
   252    275   	| mipsisa32 | mipsisa32el \
   253    276   	| mipsisa32r2 | mipsisa32r2el \
   254    277   	| mipsisa64 | mipsisa64el \
   255    278   	| mipsisa64r2 | mipsisa64r2el \
   256    279   	| mipsisa64sb1 | mipsisa64sb1el \
   257    280   	| mipsisa64sr71k | mipsisa64sr71kel \
   258    281   	| mipstx39 | mipstx39el \
   259    282   	| mn10200 | mn10300 \
   260         -	| ms1 \
          283  +	| moxie \
          284  +	| mt \
   261    285   	| msp430 \
          286  +	| nds32 | nds32le | nds32be \
          287  +	| nios | nios2 \
   262    288   	| ns16k | ns32k \
   263    289   	| or32 \
   264    290   	| pdp10 | pdp11 | pj | pjl \
   265    291   	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
   266    292   	| pyramid \
   267         -	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
          293  +	| rx \
          294  +	| score \
          295  +	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
   268    296   	| sh64 | sh64le \
   269         -	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
   270         -	| sparcv8 | sparcv9 | sparcv9b \
   271         -	| strongarm \
   272         -	| tahoe | thumb | tic4x | tic80 | tron \
          297  +	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
          298  +	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
          299  +	| spu | strongarm \
          300  +	| tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
          301  +	| ubicom32 \
   273    302   	| v850 | v850e \
   274    303   	| we32k \
   275         -	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
   276         -	| z8k)
          304  +	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
          305  +	| z8k | z80)
   277    306   		basic_machine=$basic_machine-unknown
   278    307   		;;
   279         -	m32c)
   280         -		basic_machine=$basic_machine-unknown
          308  +	c54x)
          309  +		basic_machine=tic54x-unknown
   281    310   		;;
   282         -	m6811 | m68hc11 | m6812 | m68hc12)
          311  +	c55x)
          312  +		basic_machine=tic55x-unknown
          313  +		;;
          314  +	c6x)
          315  +		basic_machine=tic6x-unknown
          316  +		;;
          317  +	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
   283    318   		# Motorola 68HC11/12.
   284    319   		basic_machine=$basic_machine-unknown
   285    320   		os=-none
   286    321   		;;
   287    322   	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
   288    323   		;;
          324  +	ms1)
          325  +		basic_machine=mt-unknown
          326  +		;;
   289    327   
   290    328   	# We use `pc' rather than `unknown'
   291    329   	# because (1) that's what they normally are, and
   292    330   	# (2) the word "unknown" tends to confuse beginning users.
   293    331   	i*86 | x86_64)
   294    332   	  basic_machine=$basic_machine-pc
   295    333   	  ;;
................................................................................
   301    339   	# Recognize the basic CPU types with company name.
   302    340   	580-* \
   303    341   	| a29k-* \
   304    342   	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
   305    343   	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
   306    344   	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
   307    345   	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
   308         -	| avr-* \
          346  +	| avr-* | avr32-* \
   309    347   	| bfin-* | bs2000-* \
   310         -	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
          348  +	| c[123]* | c30-* | [cjt]90-* | c4x-* \
   311    349   	| clipper-* | craynv-* | cydra-* \
   312    350   	| d10v-* | d30v-* | dlx-* \
   313    351   	| elxsi-* \
   314         -	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
          352  +	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
   315    353   	| h8300-* | h8500-* \
   316    354   	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
   317    355   	| i*86-* | i860-* | i960-* | ia64-* \
   318    356   	| ip2k-* | iq2000-* \
   319         -	| m32r-* | m32rle-* \
          357  +	| lm32-* \
          358  +	| m32c-* | m32r-* | m32rle-* \
   320    359   	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
   321         -	| m88110-* | m88k-* | maxq-* | mcore-* \
          360  +	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
   322    361   	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
   323    362   	| mips16-* \
   324    363   	| mips64-* | mips64el-* \
   325         -	| mips64vr-* | mips64vrel-* \
          364  +	| mips64octeon-* | mips64octeonel-* \
   326    365   	| mips64orion-* | mips64orionel-* \
          366  +	| mips64r5900-* | mips64r5900el-* \
          367  +	| mips64vr-* | mips64vrel-* \
   327    368   	| mips64vr4100-* | mips64vr4100el-* \
   328    369   	| mips64vr4300-* | mips64vr4300el-* \
   329    370   	| mips64vr5000-* | mips64vr5000el-* \
   330    371   	| mips64vr5900-* | mips64vr5900el-* \
   331    372   	| mipsisa32-* | mipsisa32el-* \
   332    373   	| mipsisa32r2-* | mipsisa32r2el-* \
   333    374   	| mipsisa64-* | mipsisa64el-* \
   334    375   	| mipsisa64r2-* | mipsisa64r2el-* \
   335    376   	| mipsisa64sb1-* | mipsisa64sb1el-* \
   336    377   	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
   337    378   	| mipstx39-* | mipstx39el-* \
   338    379   	| mmix-* \
   339         -	| ms1-* \
          380  +	| mt-* \
   340    381   	| msp430-* \
          382  +	| nds32-* | nds32le-* | nds32be-* \
          383  +	| nios-* | nios2-* \
   341    384   	| none-* | np1-* | ns16k-* | ns32k-* \
   342    385   	| orion-* \
   343    386   	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
   344    387   	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
   345    388   	| pyramid-* \
   346         -	| romp-* | rs6000-* \
   347         -	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
          389  +	| romp-* | rs6000-* | rx-* \
          390  +	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
   348    391   	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
   349         -	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
          392  +	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
   350    393   	| sparclite-* \
   351         -	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
          394  +	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
   352    395   	| tahoe-* | thumb-* \
   353    396   	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
          397  +	| tile-* | tilegx-* \
   354    398   	| tron-* \
          399  +	| ubicom32-* \
   355    400   	| v850-* | v850e-* | vax-* \
   356    401   	| we32k-* \
   357         -	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
   358         -	| xstormy16-* | xtensa-* \
          402  +	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
          403  +	| xstormy16-* | xtensa*-* \
   359    404   	| ymp-* \
   360         -	| z8k-*)
          405  +	| z8k-* | z80-*)
   361    406   		;;
   362         -	m32c-*)
          407  +	# Recognize the basic CPU types without company name, with glob match.
          408  +	xtensa*)
          409  +		basic_machine=$basic_machine-unknown
   363    410   		;;
   364    411   	# Recognize the various machine names and aliases which stand
   365    412   	# for a CPU type and a company and sometimes even an OS.
   366    413   	386bsd)
   367    414   		basic_machine=i386-unknown
   368    415   		os=-bsd
   369    416   		;;
................................................................................
   419    466   		basic_machine=m68k-apollo
   420    467   		os=-sysv
   421    468   		;;
   422    469   	apollo68bsd)
   423    470   		basic_machine=m68k-apollo
   424    471   		os=-bsd
   425    472   		;;
          473  +	aros)
          474  +		basic_machine=i386-pc
          475  +		os=-aros
          476  +		;;
   426    477   	aux)
   427    478   		basic_machine=m68k-apple
   428    479   		os=-aux
   429    480   		;;
   430    481   	balance)
   431    482   		basic_machine=ns32k-sequent
   432    483   		os=-dynix
   433    484   		;;
          485  +	blackfin)
          486  +		basic_machine=bfin-unknown
          487  +		os=-linux
          488  +		;;
          489  +	blackfin-*)
          490  +		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
          491  +		os=-linux
          492  +		;;
          493  +	bluegene*)
          494  +		basic_machine=powerpc-ibm
          495  +		os=-cnk
          496  +		;;
          497  +	c54x-*)
          498  +		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
          499  +		;;
          500  +	c55x-*)
          501  +		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
          502  +		;;
          503  +	c6x-*)
          504  +		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
          505  +		;;
   434    506   	c90)
   435    507   		basic_machine=c90-cray
   436    508   		os=-unicos
          509  +		;;
          510  +        cegcc)
          511  +		basic_machine=arm-unknown
          512  +		os=-cegcc
   437    513   		;;
   438    514   	convex-c1)
   439    515   		basic_machine=c1-convex
   440    516   		os=-bsd
   441    517   		;;
   442    518   	convex-c2)
   443    519   		basic_machine=c2-convex
................................................................................
   459    535   		basic_machine=j90-cray
   460    536   		os=-unicos
   461    537   		;;
   462    538   	craynv)
   463    539   		basic_machine=craynv-cray
   464    540   		os=-unicosmp
   465    541   		;;
   466         -	cr16c)
   467         -		basic_machine=cr16c-unknown
          542  +	cr16)
          543  +		basic_machine=cr16-unknown
   468    544   		os=-elf
   469    545   		;;
   470    546   	crds | unos)
   471    547   		basic_machine=m68k-crds
   472    548   		;;
   473    549   	crisv32 | crisv32-* | etraxfs*)
   474    550   		basic_machine=crisv32-axis
................................................................................
   498    574   	      | 3300-motorola | delta-motorola)
   499    575   		basic_machine=m68k-motorola
   500    576   		;;
   501    577   	delta88)
   502    578   		basic_machine=m88k-motorola
   503    579   		os=-sysv3
   504    580   		;;
          581  +	dicos)
          582  +		basic_machine=i686-pc
          583  +		os=-dicos
          584  +		;;
   505    585   	djgpp)
   506    586   		basic_machine=i586-pc
   507    587   		os=-msdosdjgpp
   508    588   		;;
   509    589   	dpx20 | dpx20-*)
   510    590   		basic_machine=rs6000-bull
   511    591   		os=-bosx
................................................................................
   651    731   			os=-irix4
   652    732   			;;
   653    733   		esac
   654    734   		;;
   655    735   	isi68 | isi)
   656    736   		basic_machine=m68k-isi
   657    737   		os=-sysv
          738  +		;;
          739  +	m68knommu)
          740  +		basic_machine=m68k-unknown
          741  +		os=-linux
          742  +		;;
          743  +	m68knommu-*)
          744  +		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
          745  +		os=-linux
   658    746   		;;
   659    747   	m88k-omron*)
   660    748   		basic_machine=m88k-omron
   661    749   		;;
   662    750   	magnum | m3230)
   663    751   		basic_machine=mips-mips
   664    752   		os=-sysv
   665    753   		;;
   666    754   	merlin)
   667    755   		basic_machine=ns32k-utek
   668    756   		os=-sysv
   669    757   		;;
          758  +        microblaze)
          759  +		basic_machine=microblaze-xilinx
          760  +		;;
   670    761   	mingw32)
   671    762   		basic_machine=i386-pc
   672    763   		os=-mingw32
   673    764   		;;
          765  +	mingw32ce)
          766  +		basic_machine=arm-unknown
          767  +		os=-mingw32ce
          768  +		;;
   674    769   	miniframe)
   675    770   		basic_machine=m68000-convergent
   676    771   		;;
   677    772   	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
   678    773   		basic_machine=m68k-atari
   679    774   		os=-mint
   680    775   		;;
................................................................................
   692    787   		basic_machine=powerpc-unknown
   693    788   		os=-morphos
   694    789   		;;
   695    790   	msdos)
   696    791   		basic_machine=i386-pc
   697    792   		os=-msdos
   698    793   		;;
          794  +	ms1-*)
          795  +		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
          796  +		;;
   699    797   	mvs)
   700    798   		basic_machine=i370-ibm
   701    799   		os=-mvs
   702    800   		;;
   703    801   	ncr3000)
   704    802   		basic_machine=i486-ncr
   705    803   		os=-sysv4
................................................................................
   760    858   	nonstopux)
   761    859   		basic_machine=mips-compaq
   762    860   		os=-nonstopux
   763    861   		;;
   764    862   	np1)
   765    863   		basic_machine=np1-gould
   766    864   		;;
          865  +        neo-tandem)
          866  +		basic_machine=neo-tandem
          867  +		;;
          868  +        nse-tandem)
          869  +		basic_machine=nse-tandem
          870  +		;;
   767    871   	nsr-tandem)
   768    872   		basic_machine=nsr-tandem
   769    873   		;;
   770    874   	op50n-* | op60c-*)
   771    875   		basic_machine=hppa1.1-oki
   772    876   		os=-proelf
   773    877   		;;
................................................................................
   790    894   		basic_machine=hppa1.1-hitachi
   791    895   		os=-hiuxwe2
   792    896   		;;
   793    897   	paragon)
   794    898   		basic_machine=i860-intel
   795    899   		os=-osf
   796    900   		;;
          901  +	parisc)
          902  +		basic_machine=hppa-unknown
          903  +		os=-linux
          904  +		;;
          905  +	parisc-*)
          906  +		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
          907  +		os=-linux
          908  +		;;
   797    909   	pbd)
   798    910   		basic_machine=sparc-tti
   799    911   		;;
   800    912   	pbb)
   801    913   		basic_machine=m68k-tti
   802    914   		;;
   803    915   	pc532 | pc532-*)
   804    916   		basic_machine=ns32k-pc532
   805    917   		;;
          918  +	pc98)
          919  +		basic_machine=i386-pc
          920  +		;;
          921  +	pc98-*)
          922  +		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
          923  +		;;
   806    924   	pentium | p5 | k5 | k6 | nexgen | viac3)
   807    925   		basic_machine=i586-pc
   808    926   		;;
   809    927   	pentiumpro | p6 | 6x86 | athlon | athlon_*)
   810    928   		basic_machine=i686-pc
   811    929   		;;
   812    930   	pentiumii | pentium2 | pentiumiii | pentium3)
................................................................................
   855    973   	ps2)
   856    974   		basic_machine=i386-ibm
   857    975   		;;
   858    976   	pw32)
   859    977   		basic_machine=i586-unknown
   860    978   		os=-pw32
   861    979   		;;
          980  +	rdos)
          981  +		basic_machine=i386-pc
          982  +		os=-rdos
          983  +		;;
   862    984   	rom68k)
   863    985   		basic_machine=m68k-rom68k
   864    986   		os=-coff
   865    987   		;;
   866    988   	rm[46]00)
   867    989   		basic_machine=mips-siemens
   868    990   		;;
................................................................................
   881   1003   		;;
   882   1004   	sb1)
   883   1005   		basic_machine=mipsisa64sb1-unknown
   884   1006   		;;
   885   1007   	sb1el)
   886   1008   		basic_machine=mipsisa64sb1el-unknown
   887   1009   		;;
         1010  +	sde)
         1011  +		basic_machine=mipsisa32-sde
         1012  +		os=-elf
         1013  +		;;
   888   1014   	sei)
   889   1015   		basic_machine=mips-sei
   890   1016   		os=-seiux
   891   1017   		;;
   892   1018   	sequent)
   893   1019   		basic_machine=i386-sequent
   894   1020   		;;
   895   1021   	sh)
   896   1022   		basic_machine=sh-hitachi
   897   1023   		os=-hms
   898   1024   		;;
         1025  +	sh5el)
         1026  +		basic_machine=sh5le-unknown
         1027  +		;;
   899   1028   	sh64)
   900   1029   		basic_machine=sh64-unknown
   901   1030   		;;
   902   1031   	sparclite-wrs | simso-wrs)
   903   1032   		basic_machine=sparclite-wrs
   904   1033   		os=-vxworks
   905   1034   		;;
................................................................................
   969   1098   		basic_machine=alphaev5-cray
   970   1099   		os=-unicos
   971   1100   		;;
   972   1101   	t90)
   973   1102   		basic_machine=t90-cray
   974   1103   		os=-unicos
   975   1104   		;;
   976         -	tic54x | c54x*)
   977         -		basic_machine=tic54x-unknown
   978         -		os=-coff
         1105  +        # This must be matched before tile*.
         1106  +        tilegx*)
         1107  +		basic_machine=tilegx-unknown
         1108  +		os=-linux-gnu
   979   1109   		;;
   980         -	tic55x | c55x*)
   981         -		basic_machine=tic55x-unknown
   982         -		os=-coff
   983         -		;;
   984         -	tic6x | c6x*)
   985         -		basic_machine=tic6x-unknown
   986         -		os=-coff
         1110  +	tile*)
         1111  +		basic_machine=tile-unknown
         1112  +		os=-linux-gnu
   987   1113   		;;
   988   1114   	tx39)
   989   1115   		basic_machine=mipstx39-unknown
   990   1116   		;;
   991   1117   	tx39el)
   992   1118   		basic_machine=mipstx39el-unknown
   993   1119   		;;
................................................................................
  1056   1182   		basic_machine=ymp-cray
  1057   1183   		os=-unicos
  1058   1184   		;;
  1059   1185   	z8k-*-coff)
  1060   1186   		basic_machine=z8k-unknown
  1061   1187   		os=-sim
  1062   1188   		;;
         1189  +	z80-*-coff)
         1190  +		basic_machine=z80-unknown
         1191  +		os=-sim
         1192  +		;;
  1063   1193   	none)
  1064   1194   		basic_machine=none-none
  1065   1195   		os=-none
  1066   1196   		;;
  1067   1197   
  1068   1198   # Here we handle the default manufacturer of certain CPU types.  It is in
  1069   1199   # some cases the only manufacturer, in others, it is the most popular.
................................................................................
  1094   1224   		;;
  1095   1225   	pdp11)
  1096   1226   		basic_machine=pdp11-dec
  1097   1227   		;;
  1098   1228   	we32k)
  1099   1229   		basic_machine=we32k-att
  1100   1230   		;;
  1101         -	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
         1231  +	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
  1102   1232   		basic_machine=sh-unknown
  1103   1233   		;;
  1104         -	sparc | sparcv8 | sparcv9 | sparcv9b)
         1234  +	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
  1105   1235   		basic_machine=sparc-sun
  1106   1236   		;;
  1107   1237   	cydra)
  1108   1238   		basic_machine=cydra-cydrome
  1109   1239   		;;
  1110   1240   	orion)
  1111   1241   		basic_machine=orion-highlevel
................................................................................
  1144   1274   
  1145   1275   if [ x"$os" != x"" ]
  1146   1276   then
  1147   1277   case $os in
  1148   1278           # First match some system type aliases
  1149   1279           # that might get confused with valid system types.
  1150   1280   	# -solaris* is a basic system type, with this one exception.
         1281  +        -auroraux)
         1282  +	        os=-auroraux
         1283  +		;;
  1151   1284   	-solaris1 | -solaris1.*)
  1152   1285   		os=`echo $os | sed -e 's|solaris1|sunos4|'`
  1153   1286   		;;
  1154   1287   	-solaris)
  1155   1288   		os=-solaris2
  1156   1289   		;;
  1157   1290   	-svr4*)
................................................................................
  1164   1297   		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  1165   1298   		;;
  1166   1299   	# First accept the basic system types.
  1167   1300   	# The portable systems comes first.
  1168   1301   	# Each alternative MUST END IN A *, to match a version number.
  1169   1302   	# -sysv* is not here because it comes later, after sysvr4.
  1170   1303   	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  1171         -	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
  1172         -	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
         1304  +	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
         1305  +	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
         1306  +	      | -sym* | -kopensolaris* \
  1173   1307   	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  1174         -	      | -aos* \
         1308  +	      | -aos* | -aros* \
  1175   1309   	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  1176   1310   	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  1177         -	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
         1311  +	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
         1312  +	      | -openbsd* | -solidbsd* \
  1178   1313   	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
  1179   1314   	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  1180   1315   	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  1181   1316   	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  1182         -	      | -chorusos* | -chorusrdb* \
         1317  +	      | -chorusos* | -chorusrdb* | -cegcc* \
  1183   1318   	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  1184         -	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
         1319  +	      | -mingw32* | -linux-gnu* | -linux-android* \
         1320  +	      | -linux-newlib* | -linux-uclibc* \
         1321  +	      | -uxpv* | -beos* | -mpeix* | -udk* \
  1185   1322   	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
  1186   1323   	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  1187   1324   	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
  1188   1325   	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
  1189   1326   	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
  1190   1327   	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
  1191         -	      | -skyos* | -haiku*)
         1328  +	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
  1192   1329   	# Remember, each alternative MUST END IN *, to match a version number.
  1193   1330   		;;
  1194   1331   	-qnx*)
  1195   1332   		case $basic_machine in
  1196   1333   		    x86-* | i*86-*)
  1197   1334   			;;
  1198   1335   		    *)
................................................................................
  1314   1451   		;;
  1315   1452   	-kaos*)
  1316   1453   		os=-kaos
  1317   1454   		;;
  1318   1455   	-zvmoe)
  1319   1456   		os=-zvmoe
  1320   1457   		;;
         1458  +	-dicos*)
         1459  +		os=-dicos
         1460  +		;;
         1461  +        -nacl*)
         1462  +	        ;;
  1321   1463   	-none)
  1322   1464   		;;
  1323   1465   	*)
  1324   1466   		# Get rid of the `-' at the beginning of $os.
  1325   1467   		os=`echo $os | sed 's/[^-]*-//'`
  1326   1468   		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  1327   1469   		exit 1
................................................................................
  1336   1478   # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1337   1479   # "-sun"), then you have to tell the case statement up towards the top
  1338   1480   # that MANUFACTURER isn't an operating system.  Otherwise, code above
  1339   1481   # will signal an error saying that MANUFACTURER isn't an operating
  1340   1482   # system, and we'll never get to this point.
  1341   1483   
  1342   1484   case $basic_machine in
         1485  +        score-*)
         1486  +		os=-elf
         1487  +		;;
         1488  +        spu-*)
         1489  +		os=-elf
         1490  +		;;
  1343   1491   	*-acorn)
  1344   1492   		os=-riscix1.2
  1345   1493   		;;
  1346   1494   	arm*-rebel)
  1347   1495   		os=-linux
  1348   1496   		;;
  1349   1497   	arm*-semi)
  1350   1498   		os=-aout
  1351   1499   		;;
  1352         -    c4x-* | tic4x-*)
  1353         -        os=-coff
  1354         -        ;;
         1500  +        c4x-* | tic4x-*)
         1501  +        	os=-coff
         1502  +		;;
         1503  +	tic54x-*)
         1504  +		os=-coff
         1505  +		;;
         1506  +	tic55x-*)
         1507  +		os=-coff
         1508  +		;;
         1509  +	tic6x-*)
         1510  +		os=-coff
         1511  +		;;
  1355   1512   	# This must come before the *-dec entry.
  1356   1513   	pdp10-*)
  1357   1514   		os=-tops20
  1358   1515   		;;
  1359   1516   	pdp11-*)
  1360   1517   		os=-none
  1361   1518   		;;
................................................................................
  1372   1529   		os=-sunos3
  1373   1530   		# This also exists in the configure program, but was not the
  1374   1531   		# default.
  1375   1532   		# os=-sunos4
  1376   1533   		;;
  1377   1534   	m68*-cisco)
  1378   1535   		os=-aout
         1536  +		;;
         1537  +        mep-*)
         1538  +		os=-elf
  1379   1539   		;;
  1380   1540   	mips*-cisco)
  1381   1541   		os=-elf
  1382   1542   		;;
  1383   1543   	mips*-*)
  1384   1544   		os=-elf
  1385   1545   		;;
................................................................................
  1502   1662   		case $os in
  1503   1663   			-riscix*)
  1504   1664   				vendor=acorn
  1505   1665   				;;
  1506   1666   			-sunos*)
  1507   1667   				vendor=sun
  1508   1668   				;;
  1509         -			-aix*)
         1669  +			-cnk*|-aix*)
  1510   1670   				vendor=ibm
  1511   1671   				;;
  1512   1672   			-beos*)
  1513   1673   				vendor=be
  1514   1674   				;;
  1515   1675   			-hpux*)
  1516   1676   				vendor=hp

Modified kitsh/buildsrc/kitsh-0.0/install-sh from [82b003ed45] to [6381bb24b0].

     1      1   #!/bin/sh
     2      2   # install - install a program, script, or datafile
     3      3   
     4         -scriptversion=2005-05-14.22
            4  +scriptversion=2010-02-06.18; # UTC
     5      5   
     6      6   # This originates from X11R5 (mit/util/scripts/install.sh), which was
     7      7   # later released in X11R6 (xc/config/util/install.sh) with the
     8      8   # following copyright and license.
     9      9   #
    10     10   # Copyright (C) 1994 X Consortium
    11     11   #
................................................................................
    35     35   # FSF changes to this file are in the public domain.
    36     36   #
    37     37   # Calling this script install-sh is preferred over install.sh, to prevent
    38     38   # `make' implicit rules from creating a file called install from it
    39     39   # when there is no Makefile.
    40     40   #
    41     41   # This script is compatible with the BSD install script, but was written
    42         -# from scratch.  It can only install one file at a time, a restriction
    43         -# shared with many OS's install programs.
           42  +# from scratch.
           43  +
           44  +nl='
           45  +'
           46  +IFS=" ""	$nl"
    44     47   
    45     48   # set DOITPROG to echo to test this script
    46     49   
    47     50   # Don't use :- since 4.3BSD and earlier shells don't like it.
    48         -doit="${DOITPROG-}"
    49         -
    50         -# put in absolute paths if you don't have them in your path; or use env. vars.
    51         -
    52         -mvprog="${MVPROG-mv}"
    53         -cpprog="${CPPROG-cp}"
    54         -chmodprog="${CHMODPROG-chmod}"
    55         -chownprog="${CHOWNPROG-chown}"
    56         -chgrpprog="${CHGRPPROG-chgrp}"
    57         -stripprog="${STRIPPROG-strip}"
    58         -rmprog="${RMPROG-rm}"
    59         -mkdirprog="${MKDIRPROG-mkdir}"
    60         -
    61         -chmodcmd="$chmodprog 0755"
    62         -chowncmd=
           51  +doit=${DOITPROG-}
           52  +if test -z "$doit"; then
           53  +  doit_exec=exec
           54  +else
           55  +  doit_exec=$doit
           56  +fi
           57  +
           58  +# Put in absolute file names if you don't have them in your path;
           59  +# or use environment vars.
           60  +
           61  +chgrpprog=${CHGRPPROG-chgrp}
           62  +chmodprog=${CHMODPROG-chmod}
           63  +chownprog=${CHOWNPROG-chown}
           64  +cmpprog=${CMPPROG-cmp}
           65  +cpprog=${CPPROG-cp}
           66  +mkdirprog=${MKDIRPROG-mkdir}
           67  +mvprog=${MVPROG-mv}
           68  +rmprog=${RMPROG-rm}
           69  +stripprog=${STRIPPROG-strip}
           70  +
           71  +posix_glob='?'
           72  +initialize_posix_glob='
           73  +  test "$posix_glob" != "?" || {
           74  +    if (set -f) 2>/dev/null; then
           75  +      posix_glob=
           76  +    else
           77  +      posix_glob=:
           78  +    fi
           79  +  }
           80  +'
           81  +
           82  +posix_mkdir=
           83  +
           84  +# Desired mode of installed file.
           85  +mode=0755
           86  +
    63     87   chgrpcmd=
    64         -stripcmd=
           88  +chmodcmd=$chmodprog
           89  +chowncmd=
           90  +mvcmd=$mvprog
    65     91   rmcmd="$rmprog -f"
    66         -mvcmd="$mvprog"
           92  +stripcmd=
           93  +
    67     94   src=
    68     95   dst=
    69     96   dir_arg=
    70         -dstarg=
           97  +dst_arg=
           98  +
           99  +copy_on_change=false
    71    100   no_target_directory=
    72    101   
    73         -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
          102  +usage="\
          103  +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    74    104      or: $0 [OPTION]... SRCFILES... DIRECTORY
    75    105      or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    76    106      or: $0 [OPTION]... -d DIRECTORIES...
    77    107   
    78    108   In the 1st form, copy SRCFILE to DSTFILE.
    79    109   In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
    80    110   In the 4th, create DIRECTORIES.
    81    111   
    82    112   Options:
    83         --c         (ignored)
    84         --d         create directories instead of installing files.
    85         --g GROUP   $chgrpprog installed files to GROUP.
    86         --m MODE    $chmodprog installed files to MODE.
    87         --o USER    $chownprog installed files to USER.
    88         --s         $stripprog installed files.
    89         --t DIRECTORY  install into DIRECTORY.
    90         --T         report an error if DSTFILE is a directory.
    91         ---help     display this help and exit.
    92         ---version  display version info and exit.
          113  +     --help     display this help and exit.
          114  +     --version  display version info and exit.
          115  +
          116  +  -c            (ignored)
          117  +  -C            install only if different (preserve the last data modification time)
          118  +  -d            create directories instead of installing files.
          119  +  -g GROUP      $chgrpprog installed files to GROUP.
          120  +  -m MODE       $chmodprog installed files to MODE.
          121  +  -o USER       $chownprog installed files to USER.
          122  +  -s            $stripprog installed files.
          123  +  -t DIRECTORY  install into DIRECTORY.
          124  +  -T            report an error if DSTFILE is a directory.
    93    125   
    94    126   Environment variables override the default commands:
    95         -  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
          127  +  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
          128  +  RMPROG STRIPPROG
    96    129   "
    97    130   
    98         -while test -n "$1"; do
          131  +while test $# -ne 0; do
    99    132     case $1 in
   100         -    -c) shift
   101         -        continue;;
          133  +    -c) ;;
   102    134   
   103         -    -d) dir_arg=true
   104         -        shift
   105         -        continue;;
          135  +    -C) copy_on_change=true;;
          136  +
          137  +    -d) dir_arg=true;;
   106    138   
   107    139       -g) chgrpcmd="$chgrpprog $2"
   108         -        shift
   109         -        shift
   110         -        continue;;
          140  +	shift;;
   111    141   
   112    142       --help) echo "$usage"; exit $?;;
   113    143   
   114         -    -m) chmodcmd="$chmodprog $2"
   115         -        shift
   116         -        shift
   117         -        continue;;
          144  +    -m) mode=$2
          145  +	case $mode in
          146  +	  *' '* | *'	'* | *'
          147  +'*	  | *'*'* | *'?'* | *'['*)
          148  +	    echo "$0: invalid mode: $mode" >&2
          149  +	    exit 1;;
          150  +	esac
          151  +	shift;;
   118    152   
   119    153       -o) chowncmd="$chownprog $2"
   120         -        shift
   121         -        shift
   122         -        continue;;
          154  +	shift;;
   123    155   
   124         -    -s) stripcmd=$stripprog
   125         -        shift
   126         -        continue;;
          156  +    -s) stripcmd=$stripprog;;
   127    157   
   128         -    -t) dstarg=$2
   129         -	shift
   130         -	shift
   131         -	continue;;
          158  +    -t) dst_arg=$2
          159  +	shift;;
   132    160   
   133         -    -T) no_target_directory=true
   134         -	shift
   135         -	continue;;
          161  +    -T) no_target_directory=true;;
   136    162   
   137    163       --version) echo "$0 $scriptversion"; exit $?;;
   138    164   
   139         -    *)  # When -d is used, all remaining arguments are directories to create.
   140         -	# When -t is used, the destination is already specified.
   141         -	test -n "$dir_arg$dstarg" && break
   142         -        # Otherwise, the last argument is the destination.  Remove it from $@.
   143         -	for arg
   144         -	do
   145         -          if test -n "$dstarg"; then
   146         -	    # $@ is not empty: it contains at least $arg.
   147         -	    set fnord "$@" "$dstarg"
   148         -	    shift # fnord
   149         -	  fi
   150         -	  shift # arg
   151         -	  dstarg=$arg
   152         -	done
          165  +    --)	shift
   153    166   	break;;
          167  +
          168  +    -*)	echo "$0: invalid option: $1" >&2
          169  +	exit 1;;
          170  +
          171  +    *)  break;;
   154    172     esac
          173  +  shift
   155    174   done
   156    175   
   157         -if test -z "$1"; then
          176  +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
          177  +  # When -d is used, all remaining arguments are directories to create.
          178  +  # When -t is used, the destination is already specified.
          179  +  # Otherwise, the last argument is the destination.  Remove it from $@.
          180  +  for arg
          181  +  do
          182  +    if test -n "$dst_arg"; then
          183  +      # $@ is not empty: it contains at least $arg.
          184  +      set fnord "$@" "$dst_arg"
          185  +      shift # fnord
          186  +    fi
          187  +    shift # arg
          188  +    dst_arg=$arg
          189  +  done
          190  +fi
          191  +
          192  +if test $# -eq 0; then
   158    193     if test -z "$dir_arg"; then
   159    194       echo "$0: no input file specified." >&2
   160    195       exit 1
   161    196     fi
   162    197     # It's OK to call `install-sh -d' without argument.
   163    198     # This can happen when creating conditional directories.
   164    199     exit 0
   165    200   fi
          201  +
          202  +if test -z "$dir_arg"; then
          203  +  do_exit='(exit $ret); exit $ret'
          204  +  trap "ret=129; $do_exit" 1
          205  +  trap "ret=130; $do_exit" 2
          206  +  trap "ret=141; $do_exit" 13
          207  +  trap "ret=143; $do_exit" 15
          208  +
          209  +  # Set umask so as not to create temps with too-generous modes.
          210  +  # However, 'strip' requires both read and write access to temps.
          211  +  case $mode in
          212  +    # Optimize common cases.
          213  +    *644) cp_umask=133;;
          214  +    *755) cp_umask=22;;
          215  +
          216  +    *[0-7])
          217  +      if test -z "$stripcmd"; then
          218  +	u_plus_rw=
          219  +      else
          220  +	u_plus_rw='% 200'
          221  +      fi
          222  +      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
          223  +    *)
          224  +      if test -z "$stripcmd"; then
          225  +	u_plus_rw=
          226  +      else
          227  +	u_plus_rw=,u+rw
          228  +      fi
          229  +      cp_umask=$mode$u_plus_rw;;
          230  +  esac
          231  +fi
   166    232   
   167    233   for src
   168    234   do
   169    235     # Protect names starting with `-'.
   170    236     case $src in
   171         -    -*) src=./$src ;;
          237  +    -*) src=./$src;;
   172    238     esac
   173    239   
   174    240     if test -n "$dir_arg"; then
   175    241       dst=$src
   176         -    src=
   177         -
   178         -    if test -d "$dst"; then
   179         -      mkdircmd=:
   180         -      chmodcmd=
   181         -    else
   182         -      mkdircmd=$mkdirprog
   183         -    fi
          242  +    dstdir=$dst
          243  +    test -d "$dstdir"
          244  +    dstdir_status=$?
   184    245     else
          246  +
   185    247       # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
   186    248       # might cause directories to be created, which would be especially bad
   187    249       # if $src (and thus $dsttmp) contains '*'.
   188    250       if test ! -f "$src" && test ! -d "$src"; then
   189    251         echo "$0: $src does not exist." >&2
   190    252         exit 1
   191    253       fi
   192    254   
   193         -    if test -z "$dstarg"; then
          255  +    if test -z "$dst_arg"; then
   194    256         echo "$0: no destination specified." >&2
   195    257         exit 1
   196    258       fi
   197    259   
   198         -    dst=$dstarg
          260  +    dst=$dst_arg
   199    261       # Protect names starting with `-'.
   200    262       case $dst in
   201         -      -*) dst=./$dst ;;
          263  +      -*) dst=./$dst;;
   202    264       esac
   203    265   
   204    266       # If destination is a directory, append the input filename; won't work
   205    267       # if double slashes aren't ignored.
   206    268       if test -d "$dst"; then
   207    269         if test -n "$no_target_directory"; then
   208         -	echo "$0: $dstarg: Is a directory" >&2
          270  +	echo "$0: $dst_arg: Is a directory" >&2
   209    271   	exit 1
   210    272         fi
   211         -      dst=$dst/`basename "$src"`
          273  +      dstdir=$dst
          274  +      dst=$dstdir/`basename "$src"`
          275  +      dstdir_status=0
          276  +    else
          277  +      # Prefer dirname, but fall back on a substitute if dirname fails.
          278  +      dstdir=`
          279  +	(dirname "$dst") 2>/dev/null ||
          280  +	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
          281  +	     X"$dst" : 'X\(//\)[^/]' \| \
          282  +	     X"$dst" : 'X\(//\)$' \| \
          283  +	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
          284  +	echo X"$dst" |
          285  +	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
          286  +		   s//\1/
          287  +		   q
          288  +		 }
          289  +		 /^X\(\/\/\)[^/].*/{
          290  +		   s//\1/
          291  +		   q
          292  +		 }
          293  +		 /^X\(\/\/\)$/{
          294  +		   s//\1/
          295  +		   q
          296  +		 }
          297  +		 /^X\(\/\).*/{
          298  +		   s//\1/
          299  +		   q
          300  +		 }
          301  +		 s/.*/./; q'
          302  +      `
          303  +
          304  +      test -d "$dstdir"
          305  +      dstdir_status=$?
   212    306       fi
   213    307     fi
   214    308   
   215         -  # This sed command emulates the dirname command.
   216         -  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
   217         -
   218         -  # Make sure that the destination directory exists.
   219         -
   220         -  # Skip lots of stat calls in the usual case.
   221         -  if test ! -d "$dstdir"; then
   222         -    defaultIFS='
   223         -	 '
   224         -    IFS="${IFS-$defaultIFS}"
   225         -
   226         -    oIFS=$IFS
   227         -    # Some sh's can't handle IFS=/ for some reason.
   228         -    IFS='%'
   229         -    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
   230         -    shift
   231         -    IFS=$oIFS
   232         -
   233         -    pathcomp=
   234         -
   235         -    while test $# -ne 0 ; do
   236         -      pathcomp=$pathcomp$1
          309  +  obsolete_mkdir_used=false
          310  +
          311  +  if test $dstdir_status != 0; then
          312  +    case $posix_mkdir in
          313  +      '')
          314  +	# Create intermediate dirs using mode 755 as modified by the umask.
          315  +	# This is like FreeBSD 'install' as of 1997-10-28.
          316  +	umask=`umask`
          317  +	case $stripcmd.$umask in
          318  +	  # Optimize common cases.
          319  +	  *[2367][2367]) mkdir_umask=$umask;;
          320  +	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
          321  +
          322  +	  *[0-7])
          323  +	    mkdir_umask=`expr $umask + 22 \
          324  +	      - $umask % 100 % 40 + $umask % 20 \
          325  +	      - $umask % 10 % 4 + $umask % 2
          326  +	    `;;
          327  +	  *) mkdir_umask=$umask,go-w;;
          328  +	esac
          329  +
          330  +	# With -d, create the new directory with the user-specified mode.
          331  +	# Otherwise, rely on $mkdir_umask.
          332  +	if test -n "$dir_arg"; then
          333  +	  mkdir_mode=-m$mode
          334  +	else
          335  +	  mkdir_mode=
          336  +	fi
          337  +
          338  +	posix_mkdir=false
          339  +	case $umask in
          340  +	  *[123567][0-7][0-7])
          341  +	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
          342  +	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
          343  +	    ;;
          344  +	  *)
          345  +	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
          346  +	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
          347  +
          348  +	    if (umask $mkdir_umask &&
          349  +		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
          350  +	    then
          351  +	      if test -z "$dir_arg" || {
          352  +		   # Check for POSIX incompatibilities with -m.
          353  +		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
          354  +		   # other-writeable bit of parent directory when it shouldn't.
          355  +		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
          356  +		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
          357  +		   case $ls_ld_tmpdir in
          358  +		     d????-?r-*) different_mode=700;;
          359  +		     d????-?--*) different_mode=755;;
          360  +		     *) false;;
          361  +		   esac &&
          362  +		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
          363  +		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
          364  +		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
          365  +		   }
          366  +		 }
          367  +	      then posix_mkdir=:
          368  +	      fi
          369  +	      rmdir "$tmpdir/d" "$tmpdir"
          370  +	    else
          371  +	      # Remove any dirs left behind by ancient mkdir implementations.
          372  +	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
          373  +	    fi
          374  +	    trap '' 0;;
          375  +	esac;;
          376  +    esac
          377  +
          378  +    if
          379  +      $posix_mkdir && (
          380  +	umask $mkdir_umask &&
          381  +	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
          382  +      )
          383  +    then :
          384  +    else
          385  +
          386  +      # The umask is ridiculous, or mkdir does not conform to POSIX,
          387  +      # or it failed possibly due to a race condition.  Create the
          388  +      # directory the slow way, step by step, checking for races as we go.
          389  +
          390  +      case $dstdir in
          391  +	/*) prefix='/';;
          392  +	-*) prefix='./';;
          393  +	*)  prefix='';;
          394  +      esac
          395  +
          396  +      eval "$initialize_posix_glob"
          397  +
          398  +      oIFS=$IFS
          399  +      IFS=/
          400  +      $posix_glob set -f
          401  +      set fnord $dstdir
   237    402         shift
   238         -      if test ! -d "$pathcomp"; then
   239         -        $mkdirprog "$pathcomp"
   240         -	# mkdir can fail with a `File exist' error in case several
   241         -	# install-sh are creating the directory concurrently.  This
   242         -	# is OK.
   243         -	test -d "$pathcomp" || exit
          403  +      $posix_glob set +f
          404  +      IFS=$oIFS
          405  +
          406  +      prefixes=
          407  +
          408  +      for d
          409  +      do
          410  +	test -z "$d" && continue
          411  +
          412  +	prefix=$prefix$d
          413  +	if test -d "$prefix"; then
          414  +	  prefixes=
          415  +	else
          416  +	  if $posix_mkdir; then
          417  +	    (umask=$mkdir_umask &&
          418  +	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
          419  +	    # Don't fail if two instances are running concurrently.
          420  +	    test -d "$prefix" || exit 1
          421  +	  else
          422  +	    case $prefix in
          423  +	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
          424  +	      *) qprefix=$prefix;;
          425  +	    esac
          426  +	    prefixes="$prefixes '$qprefix'"
          427  +	  fi
          428  +	fi
          429  +	prefix=$prefix/
          430  +      done
          431  +
          432  +      if test -n "$prefixes"; then
          433  +	# Don't fail if two instances are running concurrently.
          434  +	(umask $mkdir_umask &&
          435  +	 eval "\$doit_exec \$mkdirprog $prefixes") ||
          436  +	  test -d "$dstdir" || exit 1
          437  +	obsolete_mkdir_used=true
   244    438         fi
   245         -      pathcomp=$pathcomp/
   246         -    done
          439  +    fi
   247    440     fi
   248    441   
   249    442     if test -n "$dir_arg"; then
   250         -    $doit $mkdircmd "$dst" \
   251         -      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
   252         -      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
   253         -      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
   254         -      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
   255         -
          443  +    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
          444  +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
          445  +    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
          446  +      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   256    447     else
   257         -    dstfile=`basename "$dst"`
   258    448   
   259    449       # Make a couple of temp file names in the proper directory.
   260    450       dsttmp=$dstdir/_inst.$$_
   261    451       rmtmp=$dstdir/_rm.$$_
   262    452   
   263    453       # Trap to clean up those temp files at exit.
   264    454       trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
   265         -    trap '(exit $?); exit' 1 2 13 15
   266    455   
   267    456       # Copy the file name to the temp name.
   268         -    $doit $cpprog "$src" "$dsttmp" &&
          457  +    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
   269    458   
   270    459       # and set any options; do chmod last to preserve setuid bits.
   271    460       #
   272    461       # If any of these fail, we abort the whole thing.  If we want to
   273    462       # ignore errors from any of these, just make sure not to ignore
   274    463       # errors from the above "$doit $cpprog $src $dsttmp" command.
   275    464       #
   276         -    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
   277         -      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
   278         -      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
   279         -      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
          465  +    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
          466  +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
          467  +    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
          468  +    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
          469  +
          470  +    # If -C, don't bother to copy if it wouldn't change the file.
          471  +    if $copy_on_change &&
          472  +       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
          473  +       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
          474  +
          475  +       eval "$initialize_posix_glob" &&
          476  +       $posix_glob set -f &&
          477  +       set X $old && old=:$2:$4:$5:$6 &&
          478  +       set X $new && new=:$2:$4:$5:$6 &&
          479  +       $posix_glob set +f &&
          480  +
          481  +       test "$old" = "$new" &&
          482  +       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
          483  +    then
          484  +      rm -f "$dsttmp"
          485  +    else
          486  +      # Rename the file to the real destination.
          487  +      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
   280    488   
   281         -    # Now rename the file to the real destination.
   282         -    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
   283         -      || {
   284         -	   # The rename failed, perhaps because mv can't rename something else
   285         -	   # to itself, or perhaps because mv is so ancient that it does not
   286         -	   # support -f.
          489  +      # The rename failed, perhaps because mv can't rename something else
          490  +      # to itself, or perhaps because mv is so ancient that it does not
          491  +      # support -f.
          492  +      {
          493  +	# Now remove or move aside any old file at destination location.
          494  +	# We try this two ways since rm can't unlink itself on some
          495  +	# systems and the destination file might be busy for other
          496  +	# reasons.  In this case, the final cleanup might fail but the new
          497  +	# file should still install successfully.
          498  +	{
          499  +	  test ! -f "$dst" ||
          500  +	  $doit $rmcmd -f "$dst" 2>/dev/null ||
          501  +	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
          502  +	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          503  +	  } ||
          504  +	  { echo "$0: cannot unlink or rename $dst" >&2
          505  +	    (exit 1); exit 1
          506  +	  }
          507  +	} &&
   287    508   
   288         -	   # Now remove or move aside any old file at destination location.
   289         -	   # We try this two ways since rm can't unlink itself on some
   290         -	   # systems and the destination file might be busy for other
   291         -	   # reasons.  In this case, the final cleanup might fail but the new
   292         -	   # file should still install successfully.
   293         -	   {
   294         -	     if test -f "$dstdir/$dstfile"; then
   295         -	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
   296         -	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
   297         -	       || {
   298         -		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
   299         -		 (exit 1); exit 1
   300         -	       }
   301         -	     else
   302         -	       :
   303         -	     fi
   304         -	   } &&
          509  +	# Now rename the file to the real destination.
          510  +	$doit $mvcmd "$dsttmp" "$dst"
          511  +      }
          512  +    fi || exit 1
   305    513   
   306         -	   # Now rename the file to the real destination.
   307         -	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
   308         -	 }
   309         -    }
   310         -  fi || { (exit 1); exit 1; }
          514  +    trap '' 0
          515  +  fi
   311    516   done
   312    517   
   313         -# The final little trick to "correctly" pass the exit status to the exit trap.
   314         -{
   315         -  (exit 0); exit 0
   316         -}
   317         -
   318    518   # Local variables:
   319    519   # eval: (add-hook 'write-file-hooks 'time-stamp)
   320    520   # time-stamp-start: "scriptversion="
   321    521   # time-stamp-format: "%:y-%02m-%02d.%02H"
   322         -# time-stamp-end: "$"
          522  +# time-stamp-time-zone: "UTC"
          523  +# time-stamp-end: "; # UTC"
   323    524   # End: