Jim Tcl
Check-in [ddb44ce9e6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update autosetup to v0.6.8

autosetup changes: - The syntax for templates has changed slightly - Update config.guess and config.sub to 2018-03-08 - Add rpath support - Add --runstatedir

Also: - enable rpath when building libjim as shared - ensure that 'make test' works on MacOS when libjim is shared

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ddb44ce9e6c94a8c393d7b92373576e230d0cc45
User & Date: steveb@workware.net.au 2018-07-25 05:30:45
Context
2018-07-25
07:04
linenoise: Update for optimised insert

Update to version: https://github.com/msteveb/linenoise/commit/d7bcf93d4de7581e043283ab461eca2310dd8fdc

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: e8aebbb399 user: steveb@workware.net.au tags: trunk

05:30
Update autosetup to v0.6.8

autosetup changes: - The syntax for templates has changed slightly - Update config.guess and config.sub to 2018-03-08 - Add rpath support - Add --runstatedir

Also: - enable rpath when building libjim as shared - ensure that 'make test' works on MacOS when libjim is shared

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: ddb44ce9e6 user: steveb@workware.net.au tags: trunk

2018-07-08
21:33
exec: Finally get the environ right

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 5e5468aebd user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

    40     40   LIBS += @LIBS@
    41     41   exec_prefix ?= @exec_prefix@
    42     42   prefix ?= @prefix@
    43     43   docdir = @docdir@
    44     44   
    45     45   CC += -Wall $(OPTIM) -I.
    46     46   CXX += -Wall $(OPTIM) -I.
    47         -@if srcdir != .
           47  +@if [get-define srcdir] ne "."
    48     48   CFLAGS += -I@srcdir@
    49     49   CXXFLAGS += -I@srcdir@
    50     50   VPATH := @srcdir@
    51     51   @endif
    52     52   
    53     53   @if JIM_STATICLIB
    54     54   LIBJIM := libjim.a
................................................................................
    89     89   
    90     90   .c.o:
    91     91   	$(ECHO) "	CC	$@"
    92     92   	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
    93     93   
    94     94   $(JIMSH): $(LIBJIM) jimsh.o initjimsh.o
    95     95   	$(ECHO) "	LINK	$@"
    96         -	$(Q)$(JIMSH_CC) @SH_LINKFLAGS@ $(LDFLAGS) -o $@ jimsh.o initjimsh.o $(LIBJIM) $(LDLIBS) $(LIBS)
           96  +	$(Q)$(JIMSH_CC) @SH_LINKRPATH_FLAGS@ @SH_LINKFLAGS@ $(LDFLAGS) -o $@ jimsh.o initjimsh.o $(LIBJIM) $(LDLIBS) $(LIBS)
    97     97   
    98     98   @if JIM_INSTALL
    99     99   install: all @TCL_EXTS@ install-exec install-docs
   100    100   	$(INSTALL_DATA_DIR) $(DESTDIR)@libdir@/jim
   101    101   	$(INSTALL_DATA) $(LIBJIM) $(DESTDIR)@libdir@
   102    102   	$(INSTALL_DATA) @srcdir@/README.extensions @C_EXT_SHOBJS@ $(DESTDIR)@libdir@/jim
   103    103   	for i in tcltest.tcl @TCL_EXTS@; do $(INSTALL_DATA) @srcdir@/$$i $(DESTDIR)@libdir@/jim; done
................................................................................
   249    249   	$(ECHO)	"	CC	${@:.so=.o}"
   250    250   	$(Q)$(CC) $(CFLAGS) $(SHOBJ_CFLAGS) -c -o jim-zlib.o $> $^
   251    251   	$(ECHO)	"	LDSO	$@"
   252    252   	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(SHOBJ_LDFLAGS) -o $@ jim-zlib.o $(SH_LIBJIM) @LDLIBS_zlib@
   253    253   
   254    254   docs: Tcl.html
   255    255   
   256         -@if INSTALL_DOCS == nodocs
          256  +@if INSTALL_DOCS eq "nodocs"
   257    257   install-docs:
   258    258   @endif
   259    259   
   260         -@if INSTALL_DOCS == docs
          260  +@if INSTALL_DOCS eq "docs"
   261    261   install-docs: docs
   262    262   	$(INSTALL_DATA_DIR) $(DESTDIR)$(docdir)
   263    263   	$(INSTALL_DATA) Tcl.html $(DESTDIR)$(docdir)
   264    264   @endif
   265    265   
   266         -@if INSTALL_DOCS == shipped
          266  +@if INSTALL_DOCS eq "shipped"
   267    267   install-docs:
   268    268   	$(INSTALL_DATA_DIR) $(DESTDIR)$(docdir)
   269    269   	@echo "Warning: asciidoc not available - installing Tcl_shipped.html"
   270    270   	$(INSTALL_DATA) Tcl_shipped.html $(DESTDIR)$(docdir)/Tcl.html
   271    271   @endif
   272    272   
   273    273   Tcl.html: jim_tcl.txt @srcdir@/make-index

Changes to auto.def.

   296    296       msg-result "Building shared library"
   297    297   } else {
   298    298       msg-result "Building static library"
   299    299       define JIM_STATICLIB
   300    300   }
   301    301   define VERSION [format %.2f [expr {[get-define JIM_VERSION] / 100.0}]]
   302    302   define LIBSOEXT [format [get-define SH_SOEXTVER] [get-define VERSION]]
          303  +if {[get-define libdir] ni {/lib /usr/lib}} {
          304  +    define SH_LINKRPATH_FLAGS [format [get-define SH_LINKRPATH] [get-define libdir]]
          305  +} else {
          306  +    define SH_LINKRPATH_FLAGS ""
          307  +}
   303    308   define JIM_INSTALL [opt-bool install-jim]
   304    309   define JIM_DOCS [opt-bool docs]
   305    310   define JIM_RANDOMISE_HASH [opt-bool random-hash]
   306    311   define docdir [opt-str docdir o {${prefix}/docs/jim}]
   307    312   
   308    313   # Attributes of the extensions
   309    314   # tcl=Pure Tcl extension
................................................................................
   480    485   
   481    486   # Restore the user-specified LIBS
   482    487   define LIBS $LIBS
   483    488   
   484    489   make-config-header jim-config.h -auto {HAVE_LONG_LONG* JIM_UTF8} -bare JIM_VERSION -none *
   485    490   make-config-header jimautoconf.h -auto {jim_ext_* TCL_PLATFORM_* TCL_LIBRARY USE_* JIM_* _FILE_OFFSET*} -bare {S_I*}
   486    491   make-template Makefile.in
          492  +make-template tests/Makefile.in
   487    493   make-template build-jim-ext.in
   488    494   make-template jimtcl.pc.in
   489    495   
   490    496   catch {exec chmod +x build-jim-ext}

Changes to autosetup/autosetup.

    76     76   	set autosetup(optset) {}
    77     77   	# optdefault is a dictionary of default values
    78     78   	set autosetup(optdefault) {}
    79     79   	# options-defaults is a dictionary of overrides for default values for options
    80     80   	set autosetup(options-defaults) {}
    81     81   	set autosetup(optionhelp) {}
    82     82   	set autosetup(showhelp) 0
           83  +
           84  +	use util
    83     85   
    84     86   	# Parse options
    85     87   	use getopt
    86     88   
    87     89   	# At the is point we don't know what is a valid option
    88     90   	# We simply parse anything that looks like an option
    89     91   	set autosetup(getopt) [getopt argv]
................................................................................
   460    462   
   461    463   			# Maybe override the default value
   462    464   			if {[dict exists $autosetup(options-defaults) $name]} {
   463    465   				# A default was specified with options-defaults, so use it
   464    466   				set defaultvalue [dict get $autosetup(options-defaults) $name]
   465    467   				dict set autosetup(optdefault) $name $defaultvalue
   466    468   			} elseif {![info exists defaultvalue]} {
   467         -				# For backward compatiblity, if ":name" was given, use name as both
          469  +				# For backward compatibility, if ":name" was given, use name as both
   468    470   				# the display text and the default value, but only if the user
   469    471   				# specified the option without the value
   470    472   				set defaultvalue $value
   471    473   			}
   472    474   
   473    475   			if {$equal eq "="} {
   474    476   				# String option with optional value
................................................................................
   740    742   # @is-defined name
   741    743   #
   742    744   # Returns 1 if the given variable is defined.
   743    745   #
   744    746   proc is-defined {name} {
   745    747   	info exists ::define($name)
   746    748   }
          749  +
          750  +# @is-define-set name
          751  +#
          752  +# Returns 1 if the given variable is defined and is set
          753  +# to a value other than "" or 0
          754  +#
          755  +proc is-define-set {name} {
          756  +	if {[get-define $name] in {0 ""}} {
          757  +		return 0
          758  +	}
          759  +	return 1
          760  +}
   747    761   
   748    762   # @all-defines
   749    763   #
   750    764   # Returns a dictionary (name, value list) of all defined variables.
   751    765   #
   752    766   # This is suitable for use with 'dict', 'array set' or 'foreach'
   753    767   # and allows for arbitrary processing of the defined variables.
................................................................................
  1036   1050   
  1037   1051   # @autosetup-require-version required
  1038   1052   #
  1039   1053   # Checks the current version of 'autosetup' against '$required'.
  1040   1054   # A fatal error is generated if the current version is less than that required.
  1041   1055   #
  1042   1056   proc autosetup-require-version {required} {
  1043         -	use util
  1044   1057   	if {[compare-versions $::autosetup(version) $required] < 0} {
  1045   1058   		user-error "autosetup version $required is required, but this is $::autosetup(version)"
  1046   1059   	}
  1047   1060   }
  1048   1061   
  1049   1062   proc autosetup_version {} {
  1050   1063   	return "autosetup v$::autosetup(version)"
................................................................................
  1837   1850   		}
  1838   1851   	} else {
  1839   1852   		puts "I don't see configure, so I will create it."
  1840   1853   	}
  1841   1854   	if {$shared} {
  1842   1855   		writefile configure \
  1843   1856   {#!/bin/sh
  1844         -# Note that WRAPPER is set here purely to detect an autosetup-created script
  1845         -WRAPPER="-"; "autosetup" "$@"
         1857  +WRAPPER="$0"; export WRAPPER; "autosetup" "$@"
  1846   1858   }
  1847   1859   	} else {
  1848   1860   		writefile configure \
  1849   1861   {#!/bin/sh
  1850   1862   dir="`dirname "$0"`/autosetup"
  1851   1863   WRAPPER="$0"; export WRAPPER; exec "`$dir/autosetup-find-tclsh`" "$dir/autosetup" "$@"
  1852   1864   }
................................................................................
  2341   2353   proc prefix {pre list} {
  2342   2354   	set result {}
  2343   2355   	foreach p $list {
  2344   2356   		lappend result $pre$p
  2345   2357   	}
  2346   2358   	return $result
  2347   2359   }
         2360  +
         2361  +# @lpop list
         2362  +#
         2363  +# Removes the last entry from the given list and returns it.
         2364  +proc lpop {listname} {
         2365  +	upvar $listname list
         2366  +	set val [lindex $list end]
         2367  +	set list [lrange $list 0 end-1]
         2368  +	return $val
         2369  +}
  2348   2370   }
  2349   2371   
  2350   2372   # ----- @module wiki-formatting.tcl -----
  2351   2373   
  2352   2374   set modsource(wiki-formatting.tcl) {
  2353   2375   # Copyright (c) 2010 WorkWare Systems http://www.workware.net.au/
  2354   2376   # All rights reserved

Changes to autosetup/autosetup-config.guess.

     1      1   #! /bin/sh
     2      2   # Attempt to guess a canonical system name.
     3         -#   Copyright 1992-2014 Free Software Foundation, Inc.
            3  +#   Copyright 1992-2018 Free Software Foundation, Inc.
     4      4   
     5         -timestamp='2014-11-04'
            5  +timestamp='2018-03-08'
     6      6   
     7      7   # This file is free software; you can redistribute it and/or modify it
     8      8   # under the terms of the GNU General Public License as published by
     9      9   # the Free Software Foundation; either version 3 of the License, or
    10     10   # (at your option) any later version.
    11     11   #
    12     12   # This program is distributed in the hope that it will be useful, but
    13     13   # WITHOUT ANY WARRANTY; without even the implied warranty of
    14     14   # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    15     15   # General Public License for more details.
    16     16   #
    17     17   # You should have received a copy of the GNU General Public License
    18         -# along with this program; if not, see <http://www.gnu.org/licenses/>.
           18  +# along with this program; if not, see <https://www.gnu.org/licenses/>.
    19     19   #
    20     20   # As a special exception to the GNU General Public License, if you
    21     21   # distribute this file as part of a program that contains a
    22     22   # configuration script generated by Autoconf, you may include it under
    23     23   # the same distribution terms that you use for the rest of that
    24     24   # program.  This Exception is an additional permission under section 7
    25     25   # of the GNU General Public License, version 3 ("GPLv3").
    26     26   #
    27     27   # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
    28     28   #
    29     29   # You can get the latest version of this script from:
    30         -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
           30  +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
    31     31   #
    32     32   # Please send patches to <config-patches@gnu.org>.
    33     33   
    34     34   
    35     35   me=`echo "$0" | sed -e 's,.*/,,'`
    36     36   
    37     37   usage="\
    38     38   Usage: $0 [OPTION]
    39     39   
    40     40   Output the configuration name of the system \`$me' is run on.
    41     41   
    42         -Operation modes:
           42  +Options:
    43     43     -h, --help         print this help, then exit
    44     44     -t, --time-stamp   print date of last modification, then exit
    45     45     -v, --version      print version number, then exit
    46     46   
    47     47   Report bugs and patches to <config-patches@gnu.org>."
    48     48   
    49     49   version="\
    50     50   GNU config.guess ($timestamp)
    51     51   
    52     52   Originally written by Per Bothner.
    53         -Copyright 1992-2014 Free Software Foundation, Inc.
           53  +Copyright 1992-2018 Free Software Foundation, Inc.
    54     54   
    55     55   This is free software; see the source for copying conditions.  There is NO
    56     56   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    57     57   
    58     58   help="
    59     59   Try \`$me --help' for more information."
    60     60   
................................................................................
   103    103    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
   104    104    { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
   105    105    { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
   106    106    { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
   107    107   dummy=$tmp/dummy ;
   108    108   tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
   109    109   case $CC_FOR_BUILD,$HOST_CC,$CC in
   110         - ,,)    echo "int x;" > $dummy.c ;
          110  + ,,)    echo "int x;" > "$dummy.c" ;
   111    111   	for c in cc gcc c89 c99 ; do
   112         -	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
          112  +	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
   113    113   	     CC_FOR_BUILD="$c"; break ;
   114    114   	  fi ;
   115    115   	done ;
   116    116   	if test x"$CC_FOR_BUILD" = x ; then
   117    117   	  CC_FOR_BUILD=no_compiler_found ;
   118    118   	fi
   119    119   	;;
................................................................................
   128    128   fi
   129    129   
   130    130   UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
   131    131   UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
   132    132   UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
   133    133   UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
   134    134   
   135         -case "${UNAME_SYSTEM}" in
          135  +case "$UNAME_SYSTEM" in
   136    136   Linux|GNU|GNU/*)
   137    137   	# If the system lacks a compiler, then just pick glibc.
   138    138   	# We could probably try harder.
   139    139   	LIBC=gnu
   140    140   
   141         -	eval $set_cc_for_build
   142         -	cat <<-EOF > $dummy.c
          141  +	eval "$set_cc_for_build"
          142  +	cat <<-EOF > "$dummy.c"
   143    143   	#include <features.h>
   144    144   	#if defined(__UCLIBC__)
   145    145   	LIBC=uclibc
   146    146   	#elif defined(__dietlibc__)
   147    147   	LIBC=dietlibc
   148    148   	#else
   149    149   	LIBC=gnu
   150    150   	#endif
   151    151   	EOF
   152         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
          152  +	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
          153  +
          154  +	# If ldd exists, use it to detect musl libc.
          155  +	if command -v ldd >/dev/null && \
          156  +		ldd --version 2>&1 | grep -q ^musl
          157  +	then
          158  +	    LIBC=musl
          159  +	fi
   153    160   	;;
   154    161   esac
   155    162   
   156    163   # Note: order is significant - the case branches are not exclusive.
   157    164   
   158         -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          165  +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
   159    166       *:NetBSD:*:*)
   160    167   	# NetBSD (nbsd) targets should (where applicable) match one or
   161    168   	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
   162    169   	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
   163    170   	# switched to ELF, *-*-netbsd* would select the old
   164    171   	# object file format.  This provides both forward
   165    172   	# compatibility and a consistent mechanism for selecting the
   166    173   	# object file format.
   167    174   	#
   168    175   	# Note: NetBSD doesn't particularly care about the vendor
   169    176   	# portion of the name.  We always set it to "unknown".
   170    177   	sysctl="sysctl -n hw.machine_arch"
   171         -	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
   172         -	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
   173         -	case "${UNAME_MACHINE_ARCH}" in
          178  +	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
          179  +	    "/sbin/$sysctl" 2>/dev/null || \
          180  +	    "/usr/sbin/$sysctl" 2>/dev/null || \
          181  +	    echo unknown)`
          182  +	case "$UNAME_MACHINE_ARCH" in
   174    183   	    armeb) machine=armeb-unknown ;;
   175    184   	    arm*) machine=arm-unknown ;;
   176    185   	    sh3el) machine=shl-unknown ;;
   177    186   	    sh3eb) machine=sh-unknown ;;
   178    187   	    sh5el) machine=sh5le-unknown ;;
   179         -	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
          188  +	    earmv*)
          189  +		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
          190  +		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
          191  +		machine="${arch}${endian}"-unknown
          192  +		;;
          193  +	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
   180    194   	esac
   181    195   	# The Operating System including object format, if it has switched
   182         -	# to ELF recently, or will in the future.
   183         -	case "${UNAME_MACHINE_ARCH}" in
          196  +	# to ELF recently (or will in the future) and ABI.
          197  +	case "$UNAME_MACHINE_ARCH" in
          198  +	    earm*)
          199  +		os=netbsdelf
          200  +		;;
   184    201   	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
   185         -		eval $set_cc_for_build
          202  +		eval "$set_cc_for_build"
   186    203   		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   187    204   			| grep -q __ELF__
   188    205   		then
   189    206   		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
   190    207   		    # Return netbsd for either.  FIX?
   191    208   		    os=netbsd
   192    209   		else
   193    210   		    os=netbsdelf
   194    211   		fi
   195    212   		;;
   196    213   	    *)
   197    214   		os=netbsd
   198    215   		;;
          216  +	esac
          217  +	# Determine ABI tags.
          218  +	case "$UNAME_MACHINE_ARCH" in
          219  +	    earm*)
          220  +		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
          221  +		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
          222  +		;;
   199    223   	esac
   200    224   	# The OS release
   201    225   	# Debian GNU/NetBSD machines have a different userland, and
   202    226   	# thus, need a distinct triplet. However, they do not need
   203    227   	# kernel version information, so it can be replaced with a
   204    228   	# suitable tag, in the style of linux-gnu.
   205         -	case "${UNAME_VERSION}" in
          229  +	case "$UNAME_VERSION" in
   206    230   	    Debian*)
   207    231   		release='-gnu'
   208    232   		;;
   209    233   	    *)
   210         -		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
          234  +		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
   211    235   		;;
   212    236   	esac
   213    237   	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
   214    238   	# contains redundant information, the shorter form:
   215    239   	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
   216         -	echo "${machine}-${os}${release}"
          240  +	echo "$machine-${os}${release}${abi}"
   217    241   	exit ;;
   218    242       *:Bitrig:*:*)
   219    243   	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
   220         -	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
          244  +	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
   221    245   	exit ;;
   222    246       *:OpenBSD:*:*)
   223    247   	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
   224         -	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
          248  +	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
          249  +	exit ;;
          250  +    *:LibertyBSD:*:*)
          251  +	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
          252  +	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
          253  +	exit ;;
          254  +    *:MidnightBSD:*:*)
          255  +	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
   225    256   	exit ;;
   226    257       *:ekkoBSD:*:*)
   227         -	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
          258  +	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
   228    259   	exit ;;
   229    260       *:SolidBSD:*:*)
   230         -	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
          261  +	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
   231    262   	exit ;;
   232    263       macppc:MirBSD:*:*)
   233         -	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
          264  +	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
   234    265   	exit ;;
   235    266       *:MirBSD:*:*)
   236         -	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
          267  +	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
   237    268   	exit ;;
          269  +    *:Sortix:*:*)
          270  +	echo "$UNAME_MACHINE"-unknown-sortix
          271  +	exit ;;
          272  +    *:Redox:*:*)
          273  +	echo "$UNAME_MACHINE"-unknown-redox
          274  +	exit ;;
          275  +    mips:OSF1:*.*)
          276  +        echo mips-dec-osf1
          277  +        exit ;;
   238    278       alpha:OSF1:*:*)
   239    279   	case $UNAME_RELEASE in
   240    280   	*4.0)
   241    281   		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
   242    282   		;;
   243    283   	*5.*)
   244    284   		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
................................................................................
   247    287   	# According to Compaq, /usr/sbin/psrinfo has been available on
   248    288   	# OSF/1 and Tru64 systems produced since 1995.  I hope that
   249    289   	# covers most systems running today.  This code pipes the CPU
   250    290   	# types through head -n 1, so we only detect the type of CPU 0.
   251    291   	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
   252    292   	case "$ALPHA_CPU_TYPE" in
   253    293   	    "EV4 (21064)")
   254         -		UNAME_MACHINE="alpha" ;;
          294  +		UNAME_MACHINE=alpha ;;
   255    295   	    "EV4.5 (21064)")
   256         -		UNAME_MACHINE="alpha" ;;
          296  +		UNAME_MACHINE=alpha ;;
   257    297   	    "LCA4 (21066/21068)")
   258         -		UNAME_MACHINE="alpha" ;;
          298  +		UNAME_MACHINE=alpha ;;
   259    299   	    "EV5 (21164)")
   260         -		UNAME_MACHINE="alphaev5" ;;
          300  +		UNAME_MACHINE=alphaev5 ;;
   261    301   	    "EV5.6 (21164A)")
   262         -		UNAME_MACHINE="alphaev56" ;;
          302  +		UNAME_MACHINE=alphaev56 ;;
   263    303   	    "EV5.6 (21164PC)")
   264         -		UNAME_MACHINE="alphapca56" ;;
          304  +		UNAME_MACHINE=alphapca56 ;;
   265    305   	    "EV5.7 (21164PC)")
   266         -		UNAME_MACHINE="alphapca57" ;;
          306  +		UNAME_MACHINE=alphapca57 ;;
   267    307   	    "EV6 (21264)")
   268         -		UNAME_MACHINE="alphaev6" ;;
          308  +		UNAME_MACHINE=alphaev6 ;;
   269    309   	    "EV6.7 (21264A)")
   270         -		UNAME_MACHINE="alphaev67" ;;
          310  +		UNAME_MACHINE=alphaev67 ;;
   271    311   	    "EV6.8CB (21264C)")
   272         -		UNAME_MACHINE="alphaev68" ;;
          312  +		UNAME_MACHINE=alphaev68 ;;
   273    313   	    "EV6.8AL (21264B)")
   274         -		UNAME_MACHINE="alphaev68" ;;
          314  +		UNAME_MACHINE=alphaev68 ;;
   275    315   	    "EV6.8CX (21264D)")
   276         -		UNAME_MACHINE="alphaev68" ;;
          316  +		UNAME_MACHINE=alphaev68 ;;
   277    317   	    "EV6.9A (21264/EV69A)")
   278         -		UNAME_MACHINE="alphaev69" ;;
          318  +		UNAME_MACHINE=alphaev69 ;;
   279    319   	    "EV7 (21364)")
   280         -		UNAME_MACHINE="alphaev7" ;;
          320  +		UNAME_MACHINE=alphaev7 ;;
   281    321   	    "EV7.9 (21364A)")
   282         -		UNAME_MACHINE="alphaev79" ;;
          322  +		UNAME_MACHINE=alphaev79 ;;
   283    323   	esac
   284    324   	# A Pn.n version is a patched version.
   285    325   	# A Vn.n version is a released version.
   286    326   	# A Tn.n version is a released field test version.
   287    327   	# A Xn.n version is an unreleased experimental baselevel.
   288    328   	# 1.2 uses "1.2" for uname -r.
   289         -	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
          329  +	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
   290    330   	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
   291    331   	exitcode=$?
   292    332   	trap '' 0
   293    333   	exit $exitcode ;;
   294         -    Alpha\ *:Windows_NT*:*)
   295         -	# How do we know it's Interix rather than the generic POSIX subsystem?
   296         -	# Should we change UNAME_MACHINE based on the output of uname instead
   297         -	# of the specific Alpha model?
   298         -	echo alpha-pc-interix
   299         -	exit ;;
   300         -    21064:Windows_NT:50:3)
   301         -	echo alpha-dec-winnt3.5
   302         -	exit ;;
   303    334       Amiga*:UNIX_System_V:4.0:*)
   304    335   	echo m68k-unknown-sysv4
   305    336   	exit ;;
   306    337       *:[Aa]miga[Oo][Ss]:*:*)
   307         -	echo ${UNAME_MACHINE}-unknown-amigaos
          338  +	echo "$UNAME_MACHINE"-unknown-amigaos
   308    339   	exit ;;
   309    340       *:[Mm]orph[Oo][Ss]:*:*)
   310         -	echo ${UNAME_MACHINE}-unknown-morphos
          341  +	echo "$UNAME_MACHINE"-unknown-morphos
   311    342   	exit ;;
   312    343       *:OS/390:*:*)
   313    344   	echo i370-ibm-openedition
   314    345   	exit ;;
   315    346       *:z/VM:*:*)
   316    347   	echo s390-ibm-zvmoe
   317    348   	exit ;;
   318    349       *:OS400:*:*)
   319    350   	echo powerpc-ibm-os400
   320    351   	exit ;;
   321    352       arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
   322         -	echo arm-acorn-riscix${UNAME_RELEASE}
          353  +	echo arm-acorn-riscix"$UNAME_RELEASE"
   323    354   	exit ;;
   324    355       arm*:riscos:*:*|arm*:RISCOS:*:*)
   325    356   	echo arm-unknown-riscos
   326    357   	exit ;;
   327    358       SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
   328    359   	echo hppa1.1-hitachi-hiuxmpp
   329    360   	exit ;;
................................................................................
   342    373   	echo sparc-icl-nx6
   343    374   	exit ;;
   344    375       DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
   345    376   	case `/usr/bin/uname -p` in
   346    377   	    sparc) echo sparc-icl-nx7; exit ;;
   347    378   	esac ;;
   348    379       s390x:SunOS:*:*)
   349         -	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          380  +	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
   350    381   	exit ;;
   351    382       sun4H:SunOS:5.*:*)
   352         -	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          383  +	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
   353    384   	exit ;;
   354    385       sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   355         -	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          386  +	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
   356    387   	exit ;;
   357    388       i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
   358         -	echo i386-pc-auroraux${UNAME_RELEASE}
          389  +	echo i386-pc-auroraux"$UNAME_RELEASE"
   359    390   	exit ;;
   360    391       i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
   361         -	eval $set_cc_for_build
   362         -	SUN_ARCH="i386"
          392  +	eval "$set_cc_for_build"
          393  +	SUN_ARCH=i386
   363    394   	# If there is a compiler, see if it is configured for 64-bit objects.
   364    395   	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
   365    396   	# This test works for both compilers.
   366         -	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
          397  +	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
   367    398   	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
   368         -		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
          399  +		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
   369    400   		grep IS_64BIT_ARCH >/dev/null
   370    401   	    then
   371         -		SUN_ARCH="x86_64"
          402  +		SUN_ARCH=x86_64
   372    403   	    fi
   373    404   	fi
   374         -	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          405  +	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
   375    406   	exit ;;
   376    407       sun4*:SunOS:6*:*)
   377    408   	# According to config.sub, this is the proper way to canonicalize
   378    409   	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
   379    410   	# it's likely to be more like Solaris than SunOS4.
   380         -	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          411  +	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
   381    412   	exit ;;
   382    413       sun4*:SunOS:*:*)
   383    414   	case "`/usr/bin/arch -k`" in
   384    415   	    Series*|S4*)
   385    416   		UNAME_RELEASE=`uname -v`
   386    417   		;;
   387    418   	esac
   388    419   	# Japanese Language versions have a version number like `4.1.3-JL'.
   389         -	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
          420  +	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
   390    421   	exit ;;
   391    422       sun3*:SunOS:*:*)
   392         -	echo m68k-sun-sunos${UNAME_RELEASE}
          423  +	echo m68k-sun-sunos"$UNAME_RELEASE"
   393    424   	exit ;;
   394    425       sun*:*:4.2BSD:*)
   395    426   	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
   396         -	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
          427  +	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
   397    428   	case "`/bin/arch`" in
   398    429   	    sun3)
   399         -		echo m68k-sun-sunos${UNAME_RELEASE}
          430  +		echo m68k-sun-sunos"$UNAME_RELEASE"
   400    431   		;;
   401    432   	    sun4)
   402         -		echo sparc-sun-sunos${UNAME_RELEASE}
          433  +		echo sparc-sun-sunos"$UNAME_RELEASE"
   403    434   		;;
   404    435   	esac
   405    436   	exit ;;
   406    437       aushp:SunOS:*:*)
   407         -	echo sparc-auspex-sunos${UNAME_RELEASE}
          438  +	echo sparc-auspex-sunos"$UNAME_RELEASE"
   408    439   	exit ;;
   409    440       # The situation for MiNT is a little confusing.  The machine name
   410    441       # can be virtually everything (everything which is not
   411    442       # "atarist" or "atariste" at least should have a processor
   412    443       # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
   413    444       # to the lowercase version "mint" (or "freemint").  Finally
   414    445       # the system name "TOS" denotes a system which is actually not
   415    446       # MiNT.  But MiNT is downward compatible to TOS, so this should
   416    447       # be no problem.
   417    448       atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
   418         -	echo m68k-atari-mint${UNAME_RELEASE}
          449  +	echo m68k-atari-mint"$UNAME_RELEASE"
   419    450   	exit ;;
   420    451       atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
   421         -	echo m68k-atari-mint${UNAME_RELEASE}
          452  +	echo m68k-atari-mint"$UNAME_RELEASE"
   422    453   	exit ;;
   423    454       *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
   424         -	echo m68k-atari-mint${UNAME_RELEASE}
          455  +	echo m68k-atari-mint"$UNAME_RELEASE"
   425    456   	exit ;;
   426    457       milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
   427         -	echo m68k-milan-mint${UNAME_RELEASE}
          458  +	echo m68k-milan-mint"$UNAME_RELEASE"
   428    459   	exit ;;
   429    460       hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
   430         -	echo m68k-hades-mint${UNAME_RELEASE}
          461  +	echo m68k-hades-mint"$UNAME_RELEASE"
   431    462   	exit ;;
   432    463       *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
   433         -	echo m68k-unknown-mint${UNAME_RELEASE}
          464  +	echo m68k-unknown-mint"$UNAME_RELEASE"
   434    465   	exit ;;
   435    466       m68k:machten:*:*)
   436         -	echo m68k-apple-machten${UNAME_RELEASE}
          467  +	echo m68k-apple-machten"$UNAME_RELEASE"
   437    468   	exit ;;
   438    469       powerpc:machten:*:*)
   439         -	echo powerpc-apple-machten${UNAME_RELEASE}
          470  +	echo powerpc-apple-machten"$UNAME_RELEASE"
   440    471   	exit ;;
   441    472       RISC*:Mach:*:*)
   442    473   	echo mips-dec-mach_bsd4.3
   443    474   	exit ;;
   444    475       RISC*:ULTRIX:*:*)
   445         -	echo mips-dec-ultrix${UNAME_RELEASE}
          476  +	echo mips-dec-ultrix"$UNAME_RELEASE"
   446    477   	exit ;;
   447    478       VAX*:ULTRIX*:*:*)
   448         -	echo vax-dec-ultrix${UNAME_RELEASE}
          479  +	echo vax-dec-ultrix"$UNAME_RELEASE"
   449    480   	exit ;;
   450    481       2020:CLIX:*:* | 2430:CLIX:*:*)
   451         -	echo clipper-intergraph-clix${UNAME_RELEASE}
          482  +	echo clipper-intergraph-clix"$UNAME_RELEASE"
   452    483   	exit ;;
   453    484       mips:*:*:UMIPS | mips:*:*:RISCos)
   454         -	eval $set_cc_for_build
   455         -	sed 's/^	//' << EOF >$dummy.c
          485  +	eval "$set_cc_for_build"
          486  +	sed 's/^	//' << EOF > "$dummy.c"
   456    487   #ifdef __cplusplus
   457    488   #include <stdio.h>  /* for printf() prototype */
   458    489   	int main (int argc, char *argv[]) {
   459    490   #else
   460    491   	int main (argc, argv) int argc; char *argv[]; {
   461    492   #endif
   462    493   	#if defined (host_mips) && defined (MIPSEB)
   463    494   	#if defined (SYSTYPE_SYSV)
   464         -	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
          495  +	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
   465    496   	#endif
   466    497   	#if defined (SYSTYPE_SVR4)
   467         -	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
          498  +	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
   468    499   	#endif
   469    500   	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
   470         -	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
          501  +	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
   471    502   	#endif
   472    503   	#endif
   473    504   	  exit (-1);
   474    505   	}
   475    506   EOF
   476         -	$CC_FOR_BUILD -o $dummy $dummy.c &&
   477         -	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
   478         -	  SYSTEM_NAME=`$dummy $dummyarg` &&
          507  +	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
          508  +	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
          509  +	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
   479    510   	    { echo "$SYSTEM_NAME"; exit; }
   480         -	echo mips-mips-riscos${UNAME_RELEASE}
          511  +	echo mips-mips-riscos"$UNAME_RELEASE"
   481    512   	exit ;;
   482    513       Motorola:PowerMAX_OS:*:*)
   483    514   	echo powerpc-motorola-powermax
   484    515   	exit ;;
   485    516       Motorola:*:4.3:PL8-*)
   486    517   	echo powerpc-harris-powermax
   487    518   	exit ;;
................................................................................
   499    530   	exit ;;
   500    531       m88k:*:3*:R3*)
   501    532   	echo m88k-motorola-sysv3
   502    533   	exit ;;
   503    534       AViiON:dgux:*:*)
   504    535   	# DG/UX returns AViiON for all architectures
   505    536   	UNAME_PROCESSOR=`/usr/bin/uname -p`
   506         -	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
          537  +	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
   507    538   	then
   508         -	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
   509         -	       [ ${TARGET_BINARY_INTERFACE}x = x ]
          539  +	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
          540  +	       [ "$TARGET_BINARY_INTERFACE"x = x ]
   510    541   	    then
   511         -		echo m88k-dg-dgux${UNAME_RELEASE}
          542  +		echo m88k-dg-dgux"$UNAME_RELEASE"
   512    543   	    else
   513         -		echo m88k-dg-dguxbcs${UNAME_RELEASE}
          544  +		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
   514    545   	    fi
   515    546   	else
   516         -	    echo i586-dg-dgux${UNAME_RELEASE}
          547  +	    echo i586-dg-dgux"$UNAME_RELEASE"
   517    548   	fi
   518    549   	exit ;;
   519    550       M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
   520    551   	echo m88k-dolphin-sysv3
   521    552   	exit ;;
   522    553       M88*:*:R3*:*)
   523    554   	# Delta 88k system running SVR3
................................................................................
   526    557       XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
   527    558   	echo m88k-tektronix-sysv3
   528    559   	exit ;;
   529    560       Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
   530    561   	echo m68k-tektronix-bsd
   531    562   	exit ;;
   532    563       *:IRIX*:*:*)
   533         -	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
          564  +	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
   534    565   	exit ;;
   535    566       ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
   536    567   	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
   537    568   	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
   538    569       i*86:AIX:*:*)
   539    570   	echo i386-ibm-aix
   540    571   	exit ;;
   541    572       ia64:AIX:*:*)
   542    573   	if [ -x /usr/bin/oslevel ] ; then
   543    574   		IBM_REV=`/usr/bin/oslevel`
   544    575   	else
   545         -		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
          576  +		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
   546    577   	fi
   547         -	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
          578  +	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
   548    579   	exit ;;
   549    580       *:AIX:2:3)
   550    581   	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
   551         -		eval $set_cc_for_build
   552         -		sed 's/^		//' << EOF >$dummy.c
          582  +		eval "$set_cc_for_build"
          583  +		sed 's/^		//' << EOF > "$dummy.c"
   553    584   		#include <sys/systemcfg.h>
   554    585   
   555    586   		main()
   556    587   			{
   557    588   			if (!__power_pc())
   558    589   				exit(1);
   559    590   			puts("powerpc-ibm-aix3.2.5");
   560    591   			exit(0);
   561    592   			}
   562    593   EOF
   563         -		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
          594  +		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
   564    595   		then
   565    596   			echo "$SYSTEM_NAME"
   566    597   		else
   567    598   			echo rs6000-ibm-aix3.2.5
   568    599   		fi
   569    600   	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
   570    601   		echo rs6000-ibm-aix3.2.4
   571    602   	else
   572    603   		echo rs6000-ibm-aix3.2
   573    604   	fi
   574    605   	exit ;;
   575    606       *:AIX:*:[4567])
   576    607   	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
   577         -	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
          608  +	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
   578    609   		IBM_ARCH=rs6000
   579    610   	else
   580    611   		IBM_ARCH=powerpc
   581    612   	fi
   582    613   	if [ -x /usr/bin/lslpp ] ; then
   583    614   		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
   584    615   			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
   585    616   	else
   586         -		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
          617  +		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
   587    618   	fi
   588         -	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
          619  +	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
   589    620   	exit ;;
   590    621       *:AIX:*:*)
   591    622   	echo rs6000-ibm-aix
   592    623   	exit ;;
   593         -    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
          624  +    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
   594    625   	echo romp-ibm-bsd4.4
   595    626   	exit ;;
   596    627       ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
   597         -	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
          628  +	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
   598    629   	exit ;;                             # report: romp-ibm BSD 4.3
   599    630       *:BOSX:*:*)
   600    631   	echo rs6000-bull-bosx
   601    632   	exit ;;
   602    633       DPX/2?00:B.O.S.:*:*)
   603    634   	echo m68k-bull-sysv3
   604    635   	exit ;;
................................................................................
   605    636       9000/[34]??:4.3bsd:1.*:*)
   606    637   	echo m68k-hp-bsd
   607    638   	exit ;;
   608    639       hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
   609    640   	echo m68k-hp-bsd4.4
   610    641   	exit ;;
   611    642       9000/[34678]??:HP-UX:*:*)
   612         -	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
   613         -	case "${UNAME_MACHINE}" in
   614         -	    9000/31? )            HP_ARCH=m68000 ;;
   615         -	    9000/[34]?? )         HP_ARCH=m68k ;;
          643  +	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
          644  +	case "$UNAME_MACHINE" in
          645  +	    9000/31?)            HP_ARCH=m68000 ;;
          646  +	    9000/[34]??)         HP_ARCH=m68k ;;
   616    647   	    9000/[678][0-9][0-9])
   617    648   		if [ -x /usr/bin/getconf ]; then
   618    649   		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
   619    650   		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
   620         -		    case "${sc_cpu_version}" in
   621         -		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
   622         -		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
          651  +		    case "$sc_cpu_version" in
          652  +		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
          653  +		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
   623    654   		      532)                      # CPU_PA_RISC2_0
   624         -			case "${sc_kernel_bits}" in
   625         -			  32) HP_ARCH="hppa2.0n" ;;
   626         -			  64) HP_ARCH="hppa2.0w" ;;
   627         -			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
          655  +			case "$sc_kernel_bits" in
          656  +			  32) HP_ARCH=hppa2.0n ;;
          657  +			  64) HP_ARCH=hppa2.0w ;;
          658  +			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
   628    659   			esac ;;
   629    660   		    esac
   630    661   		fi
   631         -		if [ "${HP_ARCH}" = "" ]; then
   632         -		    eval $set_cc_for_build
   633         -		    sed 's/^		//' << EOF >$dummy.c
          662  +		if [ "$HP_ARCH" = "" ]; then
          663  +		    eval "$set_cc_for_build"
          664  +		    sed 's/^		//' << EOF > "$dummy.c"
   634    665   
   635    666   		#define _HPUX_SOURCE
   636    667   		#include <stdlib.h>
   637    668   		#include <unistd.h>
   638    669   
   639    670   		int main ()
   640    671   		{
................................................................................
   659    690   			    puts ("hppa2.0"); break;
   660    691   		#endif
   661    692   			default: puts ("hppa1.0"); break;
   662    693   			}
   663    694   		    exit (0);
   664    695   		}
   665    696   EOF
   666         -		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
          697  +		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
   667    698   		    test -z "$HP_ARCH" && HP_ARCH=hppa
   668    699   		fi ;;
   669    700   	esac
   670         -	if [ ${HP_ARCH} = "hppa2.0w" ]
          701  +	if [ "$HP_ARCH" = hppa2.0w ]
   671    702   	then
   672         -	    eval $set_cc_for_build
          703  +	    eval "$set_cc_for_build"
   673    704   
   674    705   	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
   675    706   	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
   676    707   	    # generating 64-bit code.  GNU and HP use different nomenclature:
   677    708   	    #
   678    709   	    # $ CC_FOR_BUILD=cc ./config.guess
   679    710   	    # => hppa2.0w-hp-hpux11.23
   680    711   	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
   681    712   	    # => hppa64-hp-hpux11.23
   682    713   
   683         -	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
          714  +	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
   684    715   		grep -q __LP64__
   685    716   	    then
   686         -		HP_ARCH="hppa2.0w"
          717  +		HP_ARCH=hppa2.0w
   687    718   	    else
   688         -		HP_ARCH="hppa64"
          719  +		HP_ARCH=hppa64
   689    720   	    fi
   690    721   	fi
   691         -	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
          722  +	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
   692    723   	exit ;;
   693    724       ia64:HP-UX:*:*)
   694         -	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
   695         -	echo ia64-hp-hpux${HPUX_REV}
          725  +	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
          726  +	echo ia64-hp-hpux"$HPUX_REV"
   696    727   	exit ;;
   697    728       3050*:HI-UX:*:*)
   698         -	eval $set_cc_for_build
   699         -	sed 's/^	//' << EOF >$dummy.c
          729  +	eval "$set_cc_for_build"
          730  +	sed 's/^	//' << EOF > "$dummy.c"
   700    731   	#include <unistd.h>
   701    732   	int
   702    733   	main ()
   703    734   	{
   704    735   	  long cpu = sysconf (_SC_CPU_VERSION);
   705    736   	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
   706    737   	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
................................................................................
   717    748   	    }
   718    749   	  else if (CPU_IS_HP_MC68K (cpu))
   719    750   	    puts ("m68k-hitachi-hiuxwe2");
   720    751   	  else puts ("unknown-hitachi-hiuxwe2");
   721    752   	  exit (0);
   722    753   	}
   723    754   EOF
   724         -	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
          755  +	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
   725    756   		{ echo "$SYSTEM_NAME"; exit; }
   726    757   	echo unknown-hitachi-hiuxwe2
   727    758   	exit ;;
   728         -    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
          759  +    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
   729    760   	echo hppa1.1-hp-bsd
   730    761   	exit ;;
   731    762       9000/8??:4.3bsd:*:*)
   732    763   	echo hppa1.0-hp-bsd
   733    764   	exit ;;
   734    765       *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
   735    766   	echo hppa1.0-hp-mpeix
   736    767   	exit ;;
   737         -    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
          768  +    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
   738    769   	echo hppa1.1-hp-osf
   739    770   	exit ;;
   740    771       hp8??:OSF1:*:*)
   741    772   	echo hppa1.0-hp-osf
   742    773   	exit ;;
   743    774       i*86:OSF1:*:*)
   744    775   	if [ -x /usr/sbin/sysversion ] ; then
   745         -	    echo ${UNAME_MACHINE}-unknown-osf1mk
          776  +	    echo "$UNAME_MACHINE"-unknown-osf1mk
   746    777   	else
   747         -	    echo ${UNAME_MACHINE}-unknown-osf1
          778  +	    echo "$UNAME_MACHINE"-unknown-osf1
   748    779   	fi
   749    780   	exit ;;
   750    781       parisc*:Lites*:*:*)
   751    782   	echo hppa1.1-hp-lites
   752    783   	exit ;;
   753    784       C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
   754    785   	echo c1-convex-bsd
................................................................................
   765    796       C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
   766    797   	echo c38-convex-bsd
   767    798   	exit ;;
   768    799       C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
   769    800   	echo c4-convex-bsd
   770    801   	exit ;;
   771    802       CRAY*Y-MP:*:*:*)
   772         -	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          803  +	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
   773    804   	exit ;;
   774    805       CRAY*[A-Z]90:*:*:*)
   775         -	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
          806  +	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
   776    807   	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
   777    808   	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
   778    809   	      -e 's/\.[^.]*$/.X/'
   779    810   	exit ;;
   780    811       CRAY*TS:*:*:*)
   781         -	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          812  +	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
   782    813   	exit ;;
   783    814       CRAY*T3E:*:*:*)
   784         -	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          815  +	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
   785    816   	exit ;;
   786    817       CRAY*SV1:*:*:*)
   787         -	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          818  +	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
   788    819   	exit ;;
   789    820       *:UNICOS/mp:*:*)
   790         -	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          821  +	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
   791    822   	exit ;;
   792    823       F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
   793         -	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   794         -	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   795         -	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
          824  +	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
          825  +	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
          826  +	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
   796    827   	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   797    828   	exit ;;
   798    829       5000:UNIX_System_V:4.*:*)
   799         -	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   800         -	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
          830  +	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
          831  +	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
   801    832   	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   802    833   	exit ;;
   803    834       i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
   804         -	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
          835  +	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
   805    836   	exit ;;
   806    837       sparc*:BSD/OS:*:*)
   807         -	echo sparc-unknown-bsdi${UNAME_RELEASE}
          838  +	echo sparc-unknown-bsdi"$UNAME_RELEASE"
   808    839   	exit ;;
   809    840       *:BSD/OS:*:*)
   810         -	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
          841  +	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
   811    842   	exit ;;
   812    843       *:FreeBSD:*:*)
   813    844   	UNAME_PROCESSOR=`/usr/bin/uname -p`
   814         -	case ${UNAME_PROCESSOR} in
          845  +	case "$UNAME_PROCESSOR" in
   815    846   	    amd64)
   816         -		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   817         -	    *)
   818         -		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          847  +		UNAME_PROCESSOR=x86_64 ;;
          848  +	    i386)
          849  +		UNAME_PROCESSOR=i586 ;;
   819    850   	esac
          851  +	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
   820    852   	exit ;;
   821    853       i*:CYGWIN*:*)
   822         -	echo ${UNAME_MACHINE}-pc-cygwin
          854  +	echo "$UNAME_MACHINE"-pc-cygwin
   823    855   	exit ;;
   824    856       *:MINGW64*:*)
   825         -	echo ${UNAME_MACHINE}-pc-mingw64
          857  +	echo "$UNAME_MACHINE"-pc-mingw64
   826    858   	exit ;;
   827    859       *:MINGW*:*)
   828         -	echo ${UNAME_MACHINE}-pc-mingw32
          860  +	echo "$UNAME_MACHINE"-pc-mingw32
   829    861   	exit ;;
   830    862       *:MSYS*:*)
   831         -	echo ${UNAME_MACHINE}-pc-msys
   832         -	exit ;;
   833         -    i*:windows32*:*)
   834         -	# uname -m includes "-pc" on this system.
   835         -	echo ${UNAME_MACHINE}-mingw32
          863  +	echo "$UNAME_MACHINE"-pc-msys
   836    864   	exit ;;
   837    865       i*:PW*:*)
   838         -	echo ${UNAME_MACHINE}-pc-pw32
          866  +	echo "$UNAME_MACHINE"-pc-pw32
   839    867   	exit ;;
   840    868       *:Interix*:*)
   841         -	case ${UNAME_MACHINE} in
          869  +	case "$UNAME_MACHINE" in
   842    870   	    x86)
   843         -		echo i586-pc-interix${UNAME_RELEASE}
          871  +		echo i586-pc-interix"$UNAME_RELEASE"
   844    872   		exit ;;
   845    873   	    authenticamd | genuineintel | EM64T)
   846         -		echo x86_64-unknown-interix${UNAME_RELEASE}
          874  +		echo x86_64-unknown-interix"$UNAME_RELEASE"
   847    875   		exit ;;
   848    876   	    IA64)
   849         -		echo ia64-unknown-interix${UNAME_RELEASE}
          877  +		echo ia64-unknown-interix"$UNAME_RELEASE"
   850    878   		exit ;;
   851    879   	esac ;;
   852         -    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
   853         -	echo i${UNAME_MACHINE}-pc-mks
   854         -	exit ;;
   855         -    8664:Windows_NT:*)
   856         -	echo x86_64-pc-mks
   857         -	exit ;;
   858         -    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   859         -	# How do we know it's Interix rather than the generic POSIX subsystem?
   860         -	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
   861         -	# UNAME_MACHINE based on the output of uname instead of i386?
   862         -	echo i586-pc-interix
   863         -	exit ;;
   864    880       i*:UWIN*:*)
   865         -	echo ${UNAME_MACHINE}-pc-uwin
          881  +	echo "$UNAME_MACHINE"-pc-uwin
   866    882   	exit ;;
   867    883       amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
   868    884   	echo x86_64-unknown-cygwin
   869    885   	exit ;;
   870         -    p*:CYGWIN*:*)
   871         -	echo powerpcle-unknown-cygwin
   872         -	exit ;;
   873    886       prep*:SunOS:5.*:*)
   874         -	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          887  +	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
   875    888   	exit ;;
   876    889       *:GNU:*:*)
   877    890   	# the GNU system
   878         -	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
          891  +	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
   879    892   	exit ;;
   880    893       *:GNU/*:*:*)
   881    894   	# other systems with GNU libc and userland
   882         -	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
          895  +	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
   883    896   	exit ;;
   884    897       i*86:Minix:*:*)
   885         -	echo ${UNAME_MACHINE}-pc-minix
          898  +	echo "$UNAME_MACHINE"-pc-minix
   886    899   	exit ;;
   887    900       aarch64:Linux:*:*)
   888         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          901  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   889    902   	exit ;;
   890    903       aarch64_be:Linux:*:*)
   891    904   	UNAME_MACHINE=aarch64_be
   892         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          905  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   893    906   	exit ;;
   894    907       alpha:Linux:*:*)
   895    908   	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   896    909   	  EV5)   UNAME_MACHINE=alphaev5 ;;
   897    910   	  EV56)  UNAME_MACHINE=alphaev56 ;;
   898    911   	  PCA56) UNAME_MACHINE=alphapca56 ;;
   899    912   	  PCA57) UNAME_MACHINE=alphapca56 ;;
   900    913   	  EV6)   UNAME_MACHINE=alphaev6 ;;
   901    914   	  EV67)  UNAME_MACHINE=alphaev67 ;;
   902    915   	  EV68*) UNAME_MACHINE=alphaev68 ;;
   903    916   	esac
   904    917   	objdump --private-headers /bin/sh | grep -q ld.so.1
   905         -	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
   906         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          918  +	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
          919  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   907    920   	exit ;;
   908    921       arc:Linux:*:* | arceb:Linux:*:*)
   909         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          922  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   910    923   	exit ;;
   911    924       arm*:Linux:*:*)
   912         -	eval $set_cc_for_build
          925  +	eval "$set_cc_for_build"
   913    926   	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
   914    927   	    | grep -q __ARM_EABI__
   915    928   	then
   916         -	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          929  +	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   917    930   	else
   918    931   	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
   919    932   		| grep -q __ARM_PCS_VFP
   920    933   	    then
   921         -		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
          934  +		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
   922    935   	    else
   923         -		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
          936  +		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
   924    937   	    fi
   925    938   	fi
   926    939   	exit ;;
   927    940       avr32*:Linux:*:*)
   928         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          941  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   929    942   	exit ;;
   930    943       cris:Linux:*:*)
   931         -	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
          944  +	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
   932    945   	exit ;;
   933    946       crisv32:Linux:*:*)
   934         -	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
          947  +	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
          948  +	exit ;;
          949  +    e2k:Linux:*:*)
          950  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   935    951   	exit ;;
   936    952       frv:Linux:*:*)
   937         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          953  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   938    954   	exit ;;
   939    955       hexagon:Linux:*:*)
   940         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          956  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   941    957   	exit ;;
   942    958       i*86:Linux:*:*)
   943         -	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
          959  +	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
   944    960   	exit ;;
   945    961       ia64:Linux:*:*)
   946         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          962  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
          963  +	exit ;;
          964  +    k1om:Linux:*:*)
          965  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   947    966   	exit ;;
   948    967       m32r*:Linux:*:*)
   949         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          968  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   950    969   	exit ;;
   951    970       m68*:Linux:*:*)
   952         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          971  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   953    972   	exit ;;
   954    973       mips:Linux:*:* | mips64:Linux:*:*)
   955         -	eval $set_cc_for_build
   956         -	sed 's/^	//' << EOF >$dummy.c
          974  +	eval "$set_cc_for_build"
          975  +	sed 's/^	//' << EOF > "$dummy.c"
   957    976   	#undef CPU
   958    977   	#undef ${UNAME_MACHINE}
   959    978   	#undef ${UNAME_MACHINE}el
   960    979   	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   961    980   	CPU=${UNAME_MACHINE}el
   962    981   	#else
   963    982   	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   964    983   	CPU=${UNAME_MACHINE}
   965    984   	#else
   966    985   	CPU=
   967    986   	#endif
   968    987   	#endif
   969    988   EOF
   970         -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
   971         -	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
          989  +	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
          990  +	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
   972    991   	;;
          992  +    mips64el:Linux:*:*)
          993  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
          994  +	exit ;;
   973    995       openrisc*:Linux:*:*)
   974         -	echo or1k-unknown-linux-${LIBC}
          996  +	echo or1k-unknown-linux-"$LIBC"
   975    997   	exit ;;
   976    998       or32:Linux:*:* | or1k*:Linux:*:*)
   977         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
          999  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   978   1000   	exit ;;
   979   1001       padre:Linux:*:*)
   980         -	echo sparc-unknown-linux-${LIBC}
         1002  +	echo sparc-unknown-linux-"$LIBC"
   981   1003   	exit ;;
   982   1004       parisc64:Linux:*:* | hppa64:Linux:*:*)
   983         -	echo hppa64-unknown-linux-${LIBC}
         1005  +	echo hppa64-unknown-linux-"$LIBC"
   984   1006   	exit ;;
   985   1007       parisc:Linux:*:* | hppa:Linux:*:*)
   986   1008   	# Look for CPU level
   987   1009   	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   988         -	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
   989         -	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
   990         -	  *)    echo hppa-unknown-linux-${LIBC} ;;
         1010  +	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
         1011  +	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
         1012  +	  *)    echo hppa-unknown-linux-"$LIBC" ;;
   991   1013   	esac
   992   1014   	exit ;;
   993   1015       ppc64:Linux:*:*)
   994         -	echo powerpc64-unknown-linux-${LIBC}
         1016  +	echo powerpc64-unknown-linux-"$LIBC"
   995   1017   	exit ;;
   996   1018       ppc:Linux:*:*)
   997         -	echo powerpc-unknown-linux-${LIBC}
         1019  +	echo powerpc-unknown-linux-"$LIBC"
   998   1020   	exit ;;
   999   1021       ppc64le:Linux:*:*)
  1000         -	echo powerpc64le-unknown-linux-${LIBC}
         1022  +	echo powerpc64le-unknown-linux-"$LIBC"
  1001   1023   	exit ;;
  1002   1024       ppcle:Linux:*:*)
  1003         -	echo powerpcle-unknown-linux-${LIBC}
         1025  +	echo powerpcle-unknown-linux-"$LIBC"
         1026  +	exit ;;
         1027  +    riscv32:Linux:*:* | riscv64:Linux:*:*)
         1028  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  1004   1029   	exit ;;
  1005   1030       s390:Linux:*:* | s390x:Linux:*:*)
  1006         -	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
         1031  +	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
  1007   1032   	exit ;;
  1008   1033       sh64*:Linux:*:*)
  1009         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
         1034  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  1010   1035   	exit ;;
  1011   1036       sh*:Linux:*:*)
  1012         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
         1037  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  1013   1038   	exit ;;
  1014   1039       sparc:Linux:*:* | sparc64:Linux:*:*)
  1015         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
         1040  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  1016   1041   	exit ;;
  1017   1042       tile*:Linux:*:*)
  1018         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
         1043  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  1019   1044   	exit ;;
  1020   1045       vax:Linux:*:*)
  1021         -	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
         1046  +	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
  1022   1047   	exit ;;
  1023   1048       x86_64:Linux:*:*)
  1024         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
         1049  +	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
  1025   1050   	exit ;;
  1026   1051       xtensa*:Linux:*:*)
  1027         -	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
         1052  +	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  1028   1053   	exit ;;
  1029   1054       i*86:DYNIX/ptx:4*:*)
  1030   1055   	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  1031   1056   	# earlier versions are messed up and put the nodename in both
  1032   1057   	# sysname and nodename.
  1033   1058   	echo i386-sequent-sysv4
  1034   1059   	exit ;;
  1035   1060       i*86:UNIX_SV:4.2MP:2.*)
  1036   1061   	# Unixware is an offshoot of SVR4, but it has its own version
  1037   1062   	# number series starting with 2...
  1038   1063   	# I am not positive that other SVR4 systems won't match this,
  1039   1064   	# I just have to hope.  -- rms.
  1040   1065   	# Use sysv4.2uw... so that sysv4* matches it.
  1041         -	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
         1066  +	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
  1042   1067   	exit ;;
  1043   1068       i*86:OS/2:*:*)
  1044   1069   	# If we were able to find `uname', then EMX Unix compatibility
  1045   1070   	# is probably installed.
  1046         -	echo ${UNAME_MACHINE}-pc-os2-emx
         1071  +	echo "$UNAME_MACHINE"-pc-os2-emx
  1047   1072   	exit ;;
  1048   1073       i*86:XTS-300:*:STOP)
  1049         -	echo ${UNAME_MACHINE}-unknown-stop
         1074  +	echo "$UNAME_MACHINE"-unknown-stop
  1050   1075   	exit ;;
  1051   1076       i*86:atheos:*:*)
  1052         -	echo ${UNAME_MACHINE}-unknown-atheos
         1077  +	echo "$UNAME_MACHINE"-unknown-atheos
  1053   1078   	exit ;;
  1054   1079       i*86:syllable:*:*)
  1055         -	echo ${UNAME_MACHINE}-pc-syllable
         1080  +	echo "$UNAME_MACHINE"-pc-syllable
  1056   1081   	exit ;;
  1057   1082       i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
  1058         -	echo i386-unknown-lynxos${UNAME_RELEASE}
         1083  +	echo i386-unknown-lynxos"$UNAME_RELEASE"
  1059   1084   	exit ;;
  1060   1085       i*86:*DOS:*:*)
  1061         -	echo ${UNAME_MACHINE}-pc-msdosdjgpp
         1086  +	echo "$UNAME_MACHINE"-pc-msdosdjgpp
  1062   1087   	exit ;;
  1063         -    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  1064         -	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
         1088  +    i*86:*:4.*:*)
         1089  +	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
  1065   1090   	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  1066         -		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
         1091  +		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
  1067   1092   	else
  1068         -		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
         1093  +		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
  1069   1094   	fi
  1070   1095   	exit ;;
  1071   1096       i*86:*:5:[678]*)
  1072   1097   	# UnixWare 7.x, OpenUNIX and OpenServer 6.
  1073   1098   	case `/bin/uname -X | grep "^Machine"` in
  1074   1099   	    *486*)	     UNAME_MACHINE=i486 ;;
  1075   1100   	    *Pentium)	     UNAME_MACHINE=i586 ;;
  1076   1101   	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1077   1102   	esac
  1078         -	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
         1103  +	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
  1079   1104   	exit ;;
  1080   1105       i*86:*:3.2:*)
  1081   1106   	if test -f /usr/options/cb.name; then
  1082   1107   		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  1083         -		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
         1108  +		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
  1084   1109   	elif /bin/uname -X 2>/dev/null >/dev/null ; then
  1085   1110   		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  1086   1111   		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  1087   1112   		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  1088   1113   			&& UNAME_MACHINE=i586
  1089   1114   		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  1090   1115   			&& UNAME_MACHINE=i686
  1091   1116   		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  1092   1117   			&& UNAME_MACHINE=i686
  1093         -		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
         1118  +		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
  1094   1119   	else
  1095         -		echo ${UNAME_MACHINE}-pc-sysv32
         1120  +		echo "$UNAME_MACHINE"-pc-sysv32
  1096   1121   	fi
  1097   1122   	exit ;;
  1098   1123       pc:*:*:*)
  1099   1124   	# Left here for compatibility:
  1100   1125   	# uname -m prints for DJGPP always 'pc', but it prints nothing about
  1101   1126   	# the processor, so we play safe by assuming i586.
  1102   1127   	# Note: whatever this is, it MUST be the same as what config.sub
  1103         -	# prints for the "djgpp" host, or else GDB configury will decide that
         1128  +	# prints for the "djgpp" host, or else GDB configure will decide that
  1104   1129   	# this is a cross-build.
  1105   1130   	echo i586-pc-msdosdjgpp
  1106   1131   	exit ;;
  1107   1132       Intel:Mach:3*:*)
  1108   1133   	echo i386-pc-mach3
  1109   1134   	exit ;;
  1110   1135       paragon:*:*:*)
  1111   1136   	echo i860-intel-osf1
  1112   1137   	exit ;;
  1113   1138       i860:*:4.*:*) # i860-SVR4
  1114   1139   	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  1115         -	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
         1140  +	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
  1116   1141   	else # Add other i860-SVR4 vendors below as they are discovered.
  1117         -	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
         1142  +	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
  1118   1143   	fi
  1119   1144   	exit ;;
  1120   1145       mini*:CTIX:SYS*5:*)
  1121   1146   	# "miniframe"
  1122   1147   	echo m68010-convergent-sysv
  1123   1148   	exit ;;
  1124   1149       mc68k:UNIX:SYSTEM5:3.51m)
................................................................................
  1130   1155       M68*:*:R3V[5678]*:*)
  1131   1156   	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
  1132   1157       3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
  1133   1158   	OS_REL=''
  1134   1159   	test -r /etc/.relid \
  1135   1160   	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1136   1161   	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1137         -	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
         1162  +	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1138   1163   	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1139         -	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
         1164  +	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1140   1165       3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1141   1166   	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1142   1167   	  && { echo i486-ncr-sysv4; exit; } ;;
  1143   1168       NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1144   1169   	OS_REL='.3'
  1145   1170   	test -r /etc/.relid \
  1146   1171   	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1147   1172   	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1148         -	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
         1173  +	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1149   1174   	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1150         -	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
         1175  +	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
  1151   1176   	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
  1152         -	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
         1177  +	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1153   1178       m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1154         -	echo m68k-unknown-lynxos${UNAME_RELEASE}
         1179  +	echo m68k-unknown-lynxos"$UNAME_RELEASE"
  1155   1180   	exit ;;
  1156   1181       mc68030:UNIX_System_V:4.*:*)
  1157   1182   	echo m68k-atari-sysv4
  1158   1183   	exit ;;
  1159   1184       TSUNAMI:LynxOS:2.*:*)
  1160         -	echo sparc-unknown-lynxos${UNAME_RELEASE}
         1185  +	echo sparc-unknown-lynxos"$UNAME_RELEASE"
  1161   1186   	exit ;;
  1162   1187       rs6000:LynxOS:2.*:*)
  1163         -	echo rs6000-unknown-lynxos${UNAME_RELEASE}
         1188  +	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
  1164   1189   	exit ;;
  1165   1190       PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
  1166         -	echo powerpc-unknown-lynxos${UNAME_RELEASE}
         1191  +	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
  1167   1192   	exit ;;
  1168   1193       SM[BE]S:UNIX_SV:*:*)
  1169         -	echo mips-dde-sysv${UNAME_RELEASE}
         1194  +	echo mips-dde-sysv"$UNAME_RELEASE"
  1170   1195   	exit ;;
  1171   1196       RM*:ReliantUNIX-*:*:*)
  1172   1197   	echo mips-sni-sysv4
  1173   1198   	exit ;;
  1174   1199       RM*:SINIX-*:*:*)
  1175   1200   	echo mips-sni-sysv4
  1176   1201   	exit ;;
  1177   1202       *:SINIX-*:*:*)
  1178   1203   	if uname -p 2>/dev/null >/dev/null ; then
  1179   1204   		UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1180         -		echo ${UNAME_MACHINE}-sni-sysv4
         1205  +		echo "$UNAME_MACHINE"-sni-sysv4
  1181   1206   	else
  1182   1207   		echo ns32k-sni-sysv
  1183   1208   	fi
  1184   1209   	exit ;;
  1185   1210       PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1186   1211   			# says <Richard.M.Bartel@ccMail.Census.GOV>
  1187   1212   	echo i586-unisys-sysv4
................................................................................
  1193   1218   	exit ;;
  1194   1219       *:*:*:FTX*)
  1195   1220   	# From seanf@swdc.stratus.com.
  1196   1221   	echo i860-stratus-sysv4
  1197   1222   	exit ;;
  1198   1223       i*86:VOS:*:*)
  1199   1224   	# From Paul.Green@stratus.com.
  1200         -	echo ${UNAME_MACHINE}-stratus-vos
         1225  +	echo "$UNAME_MACHINE"-stratus-vos
  1201   1226   	exit ;;
  1202   1227       *:VOS:*:*)
  1203   1228   	# From Paul.Green@stratus.com.
  1204   1229   	echo hppa1.1-stratus-vos
  1205   1230   	exit ;;
  1206   1231       mc68*:A/UX:*:*)
  1207         -	echo m68k-apple-aux${UNAME_RELEASE}
         1232  +	echo m68k-apple-aux"$UNAME_RELEASE"
  1208   1233   	exit ;;
  1209   1234       news*:NEWS-OS:6*:*)
  1210   1235   	echo mips-sony-newsos6
  1211   1236   	exit ;;
  1212   1237       R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1213   1238   	if [ -d /usr/nec ]; then
  1214         -		echo mips-nec-sysv${UNAME_RELEASE}
         1239  +		echo mips-nec-sysv"$UNAME_RELEASE"
  1215   1240   	else
  1216         -		echo mips-unknown-sysv${UNAME_RELEASE}
         1241  +		echo mips-unknown-sysv"$UNAME_RELEASE"
  1217   1242   	fi
  1218   1243   	exit ;;
  1219   1244       BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
  1220   1245   	echo powerpc-be-beos
  1221   1246   	exit ;;
  1222   1247       BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
  1223   1248   	echo powerpc-apple-beos
................................................................................
  1228   1253       BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
  1229   1254   	echo i586-pc-haiku
  1230   1255   	exit ;;
  1231   1256       x86_64:Haiku:*:*)
  1232   1257   	echo x86_64-unknown-haiku
  1233   1258   	exit ;;
  1234   1259       SX-4:SUPER-UX:*:*)
  1235         -	echo sx4-nec-superux${UNAME_RELEASE}
         1260  +	echo sx4-nec-superux"$UNAME_RELEASE"
  1236   1261   	exit ;;
  1237   1262       SX-5:SUPER-UX:*:*)
  1238         -	echo sx5-nec-superux${UNAME_RELEASE}
         1263  +	echo sx5-nec-superux"$UNAME_RELEASE"
  1239   1264   	exit ;;
  1240   1265       SX-6:SUPER-UX:*:*)
  1241         -	echo sx6-nec-superux${UNAME_RELEASE}
         1266  +	echo sx6-nec-superux"$UNAME_RELEASE"
  1242   1267   	exit ;;
  1243   1268       SX-7:SUPER-UX:*:*)
  1244         -	echo sx7-nec-superux${UNAME_RELEASE}
         1269  +	echo sx7-nec-superux"$UNAME_RELEASE"
  1245   1270   	exit ;;
  1246   1271       SX-8:SUPER-UX:*:*)
  1247         -	echo sx8-nec-superux${UNAME_RELEASE}
         1272  +	echo sx8-nec-superux"$UNAME_RELEASE"
  1248   1273   	exit ;;
  1249   1274       SX-8R:SUPER-UX:*:*)
  1250         -	echo sx8r-nec-superux${UNAME_RELEASE}
         1275  +	echo sx8r-nec-superux"$UNAME_RELEASE"
         1276  +	exit ;;
         1277  +    SX-ACE:SUPER-UX:*:*)
         1278  +	echo sxace-nec-superux"$UNAME_RELEASE"
  1251   1279   	exit ;;
  1252   1280       Power*:Rhapsody:*:*)
  1253         -	echo powerpc-apple-rhapsody${UNAME_RELEASE}
         1281  +	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
  1254   1282   	exit ;;
  1255   1283       *:Rhapsody:*:*)
  1256         -	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
         1284  +	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
  1257   1285   	exit ;;
  1258   1286       *:Darwin:*:*)
  1259   1287   	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
  1260         -	eval $set_cc_for_build
         1288  +	eval "$set_cc_for_build"
  1261   1289   	if test "$UNAME_PROCESSOR" = unknown ; then
  1262   1290   	    UNAME_PROCESSOR=powerpc
  1263   1291   	fi
  1264         -	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
  1265         -	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
         1292  +	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
         1293  +	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
  1266   1294   		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1267         -		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
  1268         -		    grep IS_64BIT_ARCH >/dev/null
         1295  +		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
         1296  +		       grep IS_64BIT_ARCH >/dev/null
  1269   1297   		then
  1270   1298   		    case $UNAME_PROCESSOR in
  1271   1299   			i386) UNAME_PROCESSOR=x86_64 ;;
  1272   1300   			powerpc) UNAME_PROCESSOR=powerpc64 ;;
  1273   1301   		    esac
         1302  +		fi
         1303  +		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
         1304  +		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
         1305  +		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
         1306  +		       grep IS_PPC >/dev/null
         1307  +		then
         1308  +		    UNAME_PROCESSOR=powerpc
  1274   1309   		fi
  1275   1310   	    fi
  1276   1311   	elif test "$UNAME_PROCESSOR" = i386 ; then
  1277   1312   	    # Avoid executing cc on OS X 10.9, as it ships with a stub
  1278   1313   	    # that puts up a graphical alert prompting to install
  1279   1314   	    # developer tools.  Any system running Mac OS X 10.7 or
  1280   1315   	    # later (Darwin 11 and later) is required to have a 64-bit
  1281   1316   	    # processor. This is not true of the ARM version of Darwin
  1282   1317   	    # that Apple uses in portable devices.
  1283   1318   	    UNAME_PROCESSOR=x86_64
  1284   1319   	fi
  1285         -	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
         1320  +	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
  1286   1321   	exit ;;
  1287   1322       *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1288   1323   	UNAME_PROCESSOR=`uname -p`
  1289         -	if test "$UNAME_PROCESSOR" = "x86"; then
         1324  +	if test "$UNAME_PROCESSOR" = x86; then
  1290   1325   		UNAME_PROCESSOR=i386
  1291   1326   		UNAME_MACHINE=pc
  1292   1327   	fi
  1293         -	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
         1328  +	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
  1294   1329   	exit ;;
  1295   1330       *:QNX:*:4*)
  1296   1331   	echo i386-pc-qnx
  1297   1332   	exit ;;
  1298         -    NEO-?:NONSTOP_KERNEL:*:*)
  1299         -	echo neo-tandem-nsk${UNAME_RELEASE}
         1333  +    NEO-*:NONSTOP_KERNEL:*:*)
         1334  +	echo neo-tandem-nsk"$UNAME_RELEASE"
  1300   1335   	exit ;;
  1301   1336       NSE-*:NONSTOP_KERNEL:*:*)
  1302         -	echo nse-tandem-nsk${UNAME_RELEASE}
         1337  +	echo nse-tandem-nsk"$UNAME_RELEASE"
  1303   1338   	exit ;;
  1304         -    NSR-?:NONSTOP_KERNEL:*:*)
  1305         -	echo nsr-tandem-nsk${UNAME_RELEASE}
         1339  +    NSR-*:NONSTOP_KERNEL:*:*)
         1340  +	echo nsr-tandem-nsk"$UNAME_RELEASE"
         1341  +	exit ;;
         1342  +    NSV-*:NONSTOP_KERNEL:*:*)
         1343  +	echo nsv-tandem-nsk"$UNAME_RELEASE"
         1344  +	exit ;;
         1345  +    NSX-*:NONSTOP_KERNEL:*:*)
         1346  +	echo nsx-tandem-nsk"$UNAME_RELEASE"
  1306   1347   	exit ;;
  1307   1348       *:NonStop-UX:*:*)
  1308   1349   	echo mips-compaq-nonstopux
  1309   1350   	exit ;;
  1310   1351       BS2000:POSIX*:*:*)
  1311   1352   	echo bs2000-siemens-sysv
  1312   1353   	exit ;;
  1313   1354       DS/*:UNIX_System_V:*:*)
  1314         -	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
         1355  +	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
  1315   1356   	exit ;;
  1316   1357       *:Plan9:*:*)
  1317   1358   	# "uname -m" is not consistent, so use $cputype instead. 386
  1318   1359   	# is converted to i386 for consistency with other x86
  1319   1360   	# operating systems.
  1320         -	if test "$cputype" = "386"; then
         1361  +	if test "$cputype" = 386; then
  1321   1362   	    UNAME_MACHINE=i386
  1322   1363   	else
  1323   1364   	    UNAME_MACHINE="$cputype"
  1324   1365   	fi
  1325         -	echo ${UNAME_MACHINE}-unknown-plan9
         1366  +	echo "$UNAME_MACHINE"-unknown-plan9
  1326   1367   	exit ;;
  1327   1368       *:TOPS-10:*:*)
  1328   1369   	echo pdp10-unknown-tops10
  1329   1370   	exit ;;
  1330   1371       *:TENEX:*:*)
  1331   1372   	echo pdp10-unknown-tenex
  1332   1373   	exit ;;
................................................................................
  1339   1380       *:TOPS-20:*:*)
  1340   1381   	echo pdp10-unknown-tops20
  1341   1382   	exit ;;
  1342   1383       *:ITS:*:*)
  1343   1384   	echo pdp10-unknown-its
  1344   1385   	exit ;;
  1345   1386       SEI:*:*:SEIUX)
  1346         -	echo mips-sei-seiux${UNAME_RELEASE}
         1387  +	echo mips-sei-seiux"$UNAME_RELEASE"
  1347   1388   	exit ;;
  1348   1389       *:DragonFly:*:*)
  1349         -	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
         1390  +	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
  1350   1391   	exit ;;
  1351   1392       *:*VMS:*:*)
  1352   1393   	UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1353         -	case "${UNAME_MACHINE}" in
         1394  +	case "$UNAME_MACHINE" in
  1354   1395   	    A*) echo alpha-dec-vms ; exit ;;
  1355   1396   	    I*) echo ia64-dec-vms ; exit ;;
  1356   1397   	    V*) echo vax-dec-vms ; exit ;;
  1357   1398   	esac ;;
  1358   1399       *:XENIX:*:SysV)
  1359   1400   	echo i386-pc-xenix
  1360   1401   	exit ;;
  1361   1402       i*86:skyos:*:*)
  1362         -	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
         1403  +	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
  1363   1404   	exit ;;
  1364   1405       i*86:rdos:*:*)
  1365         -	echo ${UNAME_MACHINE}-pc-rdos
         1406  +	echo "$UNAME_MACHINE"-pc-rdos
  1366   1407   	exit ;;
  1367   1408       i*86:AROS:*:*)
  1368         -	echo ${UNAME_MACHINE}-pc-aros
         1409  +	echo "$UNAME_MACHINE"-pc-aros
  1369   1410   	exit ;;
  1370   1411       x86_64:VMkernel:*:*)
  1371         -	echo ${UNAME_MACHINE}-unknown-esx
         1412  +	echo "$UNAME_MACHINE"-unknown-esx
         1413  +	exit ;;
         1414  +    amd64:Isilon\ OneFS:*:*)
         1415  +	echo x86_64-unknown-onefs
  1372   1416   	exit ;;
  1373   1417   esac
         1418  +
         1419  +echo "$0: unable to guess system type" >&2
         1420  +
         1421  +case "$UNAME_MACHINE:$UNAME_SYSTEM" in
         1422  +    mips:Linux | mips64:Linux)
         1423  +	# If we got here on MIPS GNU/Linux, output extra information.
         1424  +	cat >&2 <<EOF
         1425  +
         1426  +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
         1427  +the system type. Please install a C compiler and try again.
         1428  +EOF
         1429  +	;;
         1430  +esac
  1374   1431   
  1375   1432   cat >&2 <<EOF
  1376         -$0: unable to guess system type
  1377   1433   
  1378         -This script, last modified $timestamp, has failed to recognize
  1379         -the operating system you are using. It is advised that you
  1380         -download the most up to date version of the config scripts from
         1434  +This script (version $timestamp), has failed to recognize the
         1435  +operating system you are using. If your script is old, overwrite *all*
         1436  +copies of config.guess and config.sub with the latest versions from:
  1381   1437   
  1382         -  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
         1438  +  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
  1383   1439   and
  1384         -  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
         1440  +  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
  1385   1441   
  1386         -If the version you run ($0) is already up to date, please
  1387         -send the following data and any information you think might be
  1388         -pertinent to <config-patches@gnu.org> in order to provide the needed
  1389         -information to handle your system.
         1442  +If $0 has already been updated, send the following data and any
         1443  +information you think might be pertinent to config-patches@gnu.org to
         1444  +provide the necessary information to handle your system.
  1390   1445   
  1391   1446   config.guess timestamp = $timestamp
  1392   1447   
  1393   1448   uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1394   1449   uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1395   1450   uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1396   1451   uname -v = `(uname -v) 2>/dev/null || echo unknown`
................................................................................
  1401   1456   hostinfo               = `(hostinfo) 2>/dev/null`
  1402   1457   /bin/universe          = `(/bin/universe) 2>/dev/null`
  1403   1458   /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
  1404   1459   /bin/arch              = `(/bin/arch) 2>/dev/null`
  1405   1460   /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
  1406   1461   /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1407   1462   
  1408         -UNAME_MACHINE = ${UNAME_MACHINE}
  1409         -UNAME_RELEASE = ${UNAME_RELEASE}
  1410         -UNAME_SYSTEM  = ${UNAME_SYSTEM}
  1411         -UNAME_VERSION = ${UNAME_VERSION}
         1463  +UNAME_MACHINE = "$UNAME_MACHINE"
         1464  +UNAME_RELEASE = "$UNAME_RELEASE"
         1465  +UNAME_SYSTEM  = "$UNAME_SYSTEM"
         1466  +UNAME_VERSION = "$UNAME_VERSION"
  1412   1467   EOF
  1413   1468   
  1414   1469   exit 1
  1415   1470   
  1416   1471   # Local variables:
  1417         -# eval: (add-hook 'write-file-hooks 'time-stamp)
         1472  +# eval: (add-hook 'before-save-hook 'time-stamp)
  1418   1473   # time-stamp-start: "timestamp='"
  1419   1474   # time-stamp-format: "%:y-%02m-%02d"
  1420   1475   # time-stamp-end: "'"
  1421   1476   # End:

Changes to autosetup/autosetup-config.sub.

     1      1   #! /bin/sh
     2      2   # Configuration validation subroutine script.
     3         -#   Copyright 1992-2014 Free Software Foundation, Inc.
            3  +#   Copyright 1992-2018 Free Software Foundation, Inc.
     4      4   
     5         -timestamp='2014-12-03'
            5  +timestamp='2018-03-08'
     6      6   
     7      7   # This file is free software; you can redistribute it and/or modify it
     8      8   # under the terms of the GNU General Public License as published by
     9      9   # the Free Software Foundation; either version 3 of the License, or
    10     10   # (at your option) any later version.
    11     11   #
    12     12   # This program is distributed in the hope that it will be useful, but
    13     13   # WITHOUT ANY WARRANTY; without even the implied warranty of
    14     14   # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    15     15   # General Public License for more details.
    16     16   #
    17     17   # You should have received a copy of the GNU General Public License
    18         -# along with this program; if not, see <http://www.gnu.org/licenses/>.
           18  +# along with this program; if not, see <https://www.gnu.org/licenses/>.
    19     19   #
    20     20   # As a special exception to the GNU General Public License, if you
    21     21   # distribute this file as part of a program that contains a
    22     22   # configuration script generated by Autoconf, you may include it under
    23     23   # the same distribution terms that you use for the rest of that
    24     24   # program.  This Exception is an additional permission under section 7
    25     25   # of the GNU General Public License, version 3 ("GPLv3").
................................................................................
    29     29   #
    30     30   # Configuration subroutine to validate and canonicalize a configuration type.
    31     31   # Supply the specified configuration type as an argument.
    32     32   # If it is invalid, we print an error message on stderr and exit with code 1.
    33     33   # Otherwise, we print the canonical config type on stdout and succeed.
    34     34   
    35     35   # You can get the latest version of this script from:
    36         -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
           36  +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
    37     37   
    38     38   # This file is supposed to be the same for all GNU packages
    39     39   # and recognize all the CPU types, system types and aliases
    40     40   # that are meaningful with *any* GNU software.
    41     41   # Each package is responsible for reporting which valid configurations
    42     42   # it does not support.  The user should be able to distinguish
    43     43   # a failure to support a valid configuration from a meaningless
................................................................................
    49     49   # or in some cases, the newer four-part form:
    50     50   #	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
    51     51   # It is wrong to echo any other type of specification.
    52     52   
    53     53   me=`echo "$0" | sed -e 's,.*/,,'`
    54     54   
    55     55   usage="\
    56         -Usage: $0 [OPTION] CPU-MFR-OPSYS
    57         -       $0 [OPTION] ALIAS
           56  +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
    58     57   
    59     58   Canonicalize a configuration name.
    60     59   
    61         -Operation modes:
           60  +Options:
    62     61     -h, --help         print this help, then exit
    63     62     -t, --time-stamp   print date of last modification, then exit
    64     63     -v, --version      print version number, then exit
    65     64   
    66     65   Report bugs and patches to <config-patches@gnu.org>."
    67     66   
    68     67   version="\
    69     68   GNU config.sub ($timestamp)
    70     69   
    71         -Copyright 1992-2014 Free Software Foundation, Inc.
           70  +Copyright 1992-2018 Free Software Foundation, Inc.
    72     71   
    73     72   This is free software; see the source for copying conditions.  There is NO
    74     73   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    75     74   
    76     75   help="
    77     76   Try \`$me --help' for more information."
    78     77   
................................................................................
    91     90          break ;;
    92     91       -* )
    93     92          echo "$me: invalid option $1$help"
    94     93          exit 1 ;;
    95     94   
    96     95       *local*)
    97     96          # First pass through any local machine types.
    98         -       echo $1
           97  +       echo "$1"
    99     98          exit ;;
   100     99   
   101    100       * )
   102    101          break ;;
   103    102     esac
   104    103   done
   105    104   
................................................................................
   109    108    1) ;;
   110    109    *) echo "$me: too many arguments$help" >&2
   111    110       exit 1;;
   112    111   esac
   113    112   
   114    113   # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
   115    114   # Here we must recognize all the valid KERNEL-OS combinations.
   116         -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
          115  +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
   117    116   case $maybe_os in
   118    117     nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   119    118     linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   120         -  knetbsd*-gnu* | netbsd*-gnu* | \
   121         -  kopensolaris*-gnu* | \
          119  +  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
          120  +  kopensolaris*-gnu* | cloudabi*-eabi* | \
   122    121     storm-chaos* | os2-emx* | rtmk-nova*)
   123    122       os=-$maybe_os
   124         -    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
          123  +    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
   125    124       ;;
   126    125     android-linux)
   127    126       os=-linux-android
   128         -    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
          127  +    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
   129    128       ;;
   130    129     *)
   131         -    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
   132         -    if [ $basic_machine != $1 ]
   133         -    then os=`echo $1 | sed 's/.*-/-/'`
          130  +    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
          131  +    if [ "$basic_machine" != "$1" ]
          132  +    then os=`echo "$1" | sed 's/.*-/-/'`
   134    133       else os=; fi
   135    134       ;;
   136    135   esac
   137    136   
   138    137   ### Let's recognize common machines as not being operating systems so
   139    138   ### that things like config.sub decstation-3100 work.  We also
   140    139   ### recognize some manufacturers as not being operating systems, so we
................................................................................
   175    174   		basic_machine=$1
   176    175   		;;
   177    176   	-hiux*)
   178    177   		os=-hiuxwe2
   179    178   		;;
   180    179   	-sco6)
   181    180   		os=-sco5v6
   182         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          181  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   183    182   		;;
   184    183   	-sco5)
   185    184   		os=-sco3.2v5
   186         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          185  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   187    186   		;;
   188    187   	-sco4)
   189    188   		os=-sco3.2v4
   190         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          189  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   191    190   		;;
   192    191   	-sco3.2.[4-9]*)
   193    192   		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
   194         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          193  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   195    194   		;;
   196    195   	-sco3.2v[4-9]*)
   197    196   		# Don't forget version if it is 3.2v4 or newer.
   198         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          197  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   199    198   		;;
   200    199   	-sco5v6*)
   201    200   		# Don't forget version if it is 3.2v4 or newer.
   202         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          201  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   203    202   		;;
   204    203   	-sco*)
   205    204   		os=-sco3.2v2
   206         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          205  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   207    206   		;;
   208    207   	-udk*)
   209         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          208  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   210    209   		;;
   211    210   	-isc)
   212    211   		os=-isc2.2
   213         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          212  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   214    213   		;;
   215    214   	-clix*)
   216    215   		basic_machine=clipper-intergraph
   217    216   		;;
   218    217   	-isc*)
   219         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          218  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
   220    219   		;;
   221    220   	-lynx*178)
   222    221   		os=-lynxos178
   223    222   		;;
   224    223   	-lynx*5)
   225    224   		os=-lynxos5
   226    225   		;;
   227    226   	-lynx*)
   228    227   		os=-lynxos
   229    228   		;;
   230    229   	-ptx*)
   231         -		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
   232         -		;;
   233         -	-windowsnt*)
   234         -		os=`echo $os | sed -e 's/windowsnt/winnt/'`
          230  +		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
   235    231   		;;
   236    232   	-psos*)
   237    233   		os=-psos
   238    234   		;;
   239    235   	-mint | -mint[0-9]*)
   240    236   		basic_machine=m68k-atari
   241    237   		os=-mint
................................................................................
   251    247   	| aarch64 | aarch64_be \
   252    248   	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
   253    249   	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
   254    250   	| am33_2.0 \
   255    251   	| arc | arceb \
   256    252   	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
   257    253   	| avr | avr32 \
          254  +	| ba \
   258    255   	| be32 | be64 \
   259    256   	| bfin \
   260    257   	| c4x | c8051 | clipper \
   261    258   	| d10v | d30v | dlx | dsp16xx \
   262         -	| epiphany \
   263         -	| fido | fr30 | frv \
          259  +	| e2k | epiphany \
          260  +	| fido | fr30 | frv | ft32 \
   264    261   	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
   265    262   	| hexagon \
   266         -	| i370 | i860 | i960 | ia64 \
          263  +	| i370 | i860 | i960 | ia16 | ia64 \
   267    264   	| ip2k | iq2000 \
   268    265   	| k1om \
   269    266   	| le32 | le64 \
   270    267   	| lm32 \
   271    268   	| m32c | m32r | m32rle | m68000 | m68k | m88k \
   272    269   	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
   273    270   	| mips | mipsbe | mipseb | mipsel | mipsle \
................................................................................
   295    292   	| moxie \
   296    293   	| mt \
   297    294   	| msp430 \
   298    295   	| nds32 | nds32le | nds32be \
   299    296   	| nios | nios2 | nios2eb | nios2el \
   300    297   	| ns16k | ns32k \
   301    298   	| open8 | or1k | or1knd | or32 \
   302         -	| pdp10 | pdp11 | pj | pjl \
          299  +	| pdp10 | pj | pjl \
   303    300   	| powerpc | powerpc64 | powerpc64le | powerpcle \
          301  +	| pru \
   304    302   	| pyramid \
   305    303   	| riscv32 | riscv64 \
   306    304   	| rl78 | rx \
   307    305   	| score \
   308         -	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
          306  +	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
   309    307   	| sh64 | sh64le \
   310    308   	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
   311    309   	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
   312    310   	| spu \
   313    311   	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
   314    312   	| ubicom32 \
   315    313   	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
   316    314   	| visium \
   317         -	| we32k \
          315  +	| wasm32 \
   318    316   	| x86 | xc16x | xstormy16 | xtensa \
   319    317   	| z8k | z80)
   320    318   		basic_machine=$basic_machine-unknown
   321    319   		;;
   322    320   	c54x)
   323    321   		basic_machine=tic54x-unknown
   324    322   		;;
................................................................................
   331    329   	leon|leon[3-9])
   332    330   		basic_machine=sparc-$basic_machine
   333    331   		;;
   334    332   	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
   335    333   		basic_machine=$basic_machine-unknown
   336    334   		os=-none
   337    335   		;;
   338         -	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
          336  +	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
   339    337   		;;
   340    338   	ms1)
   341    339   		basic_machine=mt-unknown
   342    340   		;;
   343    341   
   344    342   	strongarm | thumb | xscale)
   345    343   		basic_machine=arm-unknown
................................................................................
   360    358   	# because (1) that's what they normally are, and
   361    359   	# (2) the word "unknown" tends to confuse beginning users.
   362    360   	i*86 | x86_64)
   363    361   	  basic_machine=$basic_machine-pc
   364    362   	  ;;
   365    363   	# Object if more than one company name word.
   366    364   	*-*-*)
   367         -		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
          365  +		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
   368    366   		exit 1
   369    367   		;;
   370    368   	# Recognize the basic CPU types with company name.
   371    369   	580-* \
   372    370   	| a29k-* \
   373    371   	| aarch64-* | aarch64_be-* \
   374    372   	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
   375    373   	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
   376    374   	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
   377    375   	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
   378    376   	| avr-* | avr32-* \
          377  +	| ba-* \
   379    378   	| be32-* | be64-* \
   380    379   	| bfin-* | bs2000-* \
   381    380   	| c[123]* | c30-* | [cjt]90-* | c4x-* \
   382    381   	| c8051-* | clipper-* | craynv-* | cydra-* \
   383    382   	| d10v-* | d30v-* | dlx-* \
   384         -	| elxsi-* \
          383  +	| e2k-* | elxsi-* \
   385    384   	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
   386    385   	| h8300-* | h8500-* \
   387    386   	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
   388    387   	| hexagon-* \
   389         -	| i*86-* | i860-* | i960-* | ia64-* \
          388  +	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
   390    389   	| ip2k-* | iq2000-* \
   391    390   	| k1om-* \
   392    391   	| le32-* | le64-* \
   393    392   	| lm32-* \
   394    393   	| m32c-* | m32r-* | m32rle-* \
   395    394   	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
   396    395   	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
................................................................................
   423    422   	| nios-* | nios2-* | nios2eb-* | nios2el-* \
   424    423   	| none-* | np1-* | ns16k-* | ns32k-* \
   425    424   	| open8-* \
   426    425   	| or1k*-* \
   427    426   	| orion-* \
   428    427   	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
   429    428   	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
          429  +	| pru-* \
   430    430   	| pyramid-* \
          431  +	| riscv32-* | riscv64-* \
   431    432   	| rl78-* | romp-* | rs6000-* | rx-* \
   432    433   	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
   433    434   	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
   434    435   	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
   435    436   	| sparclite-* \
   436         -	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
          437  +	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
   437    438   	| tahoe-* \
   438    439   	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
   439    440   	| tile*-* \
   440    441   	| tron-* \
   441    442   	| ubicom32-* \
   442    443   	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
   443    444   	| vax-* \
   444    445   	| visium-* \
          446  +	| wasm32-* \
   445    447   	| we32k-* \
   446    448   	| x86-* | x86_64-* | xc16x-* | xps100-* \
   447    449   	| xstormy16-* | xtensa*-* \
   448    450   	| ymp-* \
   449    451   	| z8k-* | z80-*)
   450    452   		;;
   451    453   	# Recognize the basic CPU types without company name, with glob match.
   452    454   	xtensa*)
   453    455   		basic_machine=$basic_machine-unknown
   454    456   		;;
   455    457   	# Recognize the various machine names and aliases which stand
   456    458   	# for a CPU type and a company and sometimes even an OS.
   457    459   	386bsd)
   458         -		basic_machine=i386-unknown
          460  +		basic_machine=i386-pc
   459    461   		os=-bsd
   460    462   		;;
   461    463   	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
   462    464   		basic_machine=m68000-att
   463    465   		;;
   464    466   	3b*)
   465    467   		basic_machine=we32k-att
................................................................................
   485    487   		basic_machine=a29k-none
   486    488   		os=-bsd
   487    489   		;;
   488    490   	amd64)
   489    491   		basic_machine=x86_64-pc
   490    492   		;;
   491    493   	amd64-*)
   492         -		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
          494  +		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   493    495   		;;
   494    496   	amdahl)
   495    497   		basic_machine=580-amdahl
   496    498   		os=-sysv
   497    499   		;;
   498    500   	amiga | amiga-*)
   499    501   		basic_machine=m68k-unknown
................................................................................
   514    516   		basic_machine=m68k-apollo
   515    517   		os=-bsd
   516    518   		;;
   517    519   	aros)
   518    520   		basic_machine=i386-pc
   519    521   		os=-aros
   520    522   		;;
          523  +	asmjs)
          524  +		basic_machine=asmjs-unknown
          525  +		;;
   521    526   	aux)
   522    527   		basic_machine=m68k-apple
   523    528   		os=-aux
   524    529   		;;
   525    530   	balance)
   526    531   		basic_machine=ns32k-sequent
   527    532   		os=-dynix
   528    533   		;;
   529    534   	blackfin)
   530    535   		basic_machine=bfin-unknown
   531    536   		os=-linux
   532    537   		;;
   533    538   	blackfin-*)
   534         -		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
          539  +		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   535    540   		os=-linux
   536    541   		;;
   537    542   	bluegene*)
   538    543   		basic_machine=powerpc-ibm
   539    544   		os=-cnk
   540    545   		;;
   541    546   	c54x-*)
   542         -		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
          547  +		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   543    548   		;;
   544    549   	c55x-*)
   545         -		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
          550  +		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   546    551   		;;
   547    552   	c6x-*)
   548         -		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
          553  +		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   549    554   		;;
   550    555   	c90)
   551    556   		basic_machine=c90-cray
   552    557   		os=-unicos
   553    558   		;;
   554    559   	cegcc)
   555    560   		basic_machine=arm-unknown
................................................................................
   630    635   		basic_machine=i586-pc
   631    636   		os=-msdosdjgpp
   632    637   		;;
   633    638   	dpx20 | dpx20-*)
   634    639   		basic_machine=rs6000-bull
   635    640   		os=-bosx
   636    641   		;;
   637         -	dpx2* | dpx2*-bull)
          642  +	dpx2*)
   638    643   		basic_machine=m68k-bull
   639    644   		os=-sysv3
   640    645   		;;
          646  +	e500v[12])
          647  +		basic_machine=powerpc-unknown
          648  +		os=$os"spe"
          649  +		;;
          650  +	e500v[12]-*)
          651  +		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
          652  +		os=$os"spe"
          653  +		;;
   641    654   	ebmon29k)
   642    655   		basic_machine=a29k-amd
   643    656   		os=-ebmon
   644    657   		;;
   645    658   	elxsi)
   646    659   		basic_machine=elxsi-elxsi
   647    660   		os=-bsd
................................................................................
   723    736   		;;
   724    737   	hp9k8[0-9][13679] | hp8[0-9][13679])
   725    738   		basic_machine=hppa1.1-hp
   726    739   		;;
   727    740   	hp9k8[0-9][0-9] | hp8[0-9][0-9])
   728    741   		basic_machine=hppa1.0-hp
   729    742   		;;
   730         -	hppa-next)
   731         -		os=-nextstep3
   732         -		;;
   733    743   	hppaosf)
   734    744   		basic_machine=hppa1.1-hp
   735    745   		os=-osf
   736    746   		;;
   737    747   	hppro)
   738    748   		basic_machine=hppa1.1-hp
   739    749   		os=-proelf
   740    750   		;;
   741    751   	i370-ibm* | ibm*)
   742    752   		basic_machine=i370-ibm
   743    753   		;;
   744    754   	i*86v32)
   745         -		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          755  +		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
   746    756   		os=-sysv32
   747    757   		;;
   748    758   	i*86v4*)
   749         -		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          759  +		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
   750    760   		os=-sysv4
   751    761   		;;
   752    762   	i*86v)
   753         -		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          763  +		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
   754    764   		os=-sysv
   755    765   		;;
   756    766   	i*86sol2)
   757         -		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          767  +		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
   758    768   		os=-solaris2
   759    769   		;;
   760    770   	i386mach)
   761    771   		basic_machine=i386-mach
   762    772   		os=-mach
   763    773   		;;
   764         -	i386-vsta | vsta)
          774  +	vsta)
   765    775   		basic_machine=i386-unknown
   766    776   		os=-vsta
   767    777   		;;
   768    778   	iris | iris4d)
   769    779   		basic_machine=mips-sgi
   770    780   		case $os in
   771    781   		    -irix*)
................................................................................
   776    786   		esac
   777    787   		;;
   778    788   	isi68 | isi)
   779    789   		basic_machine=m68k-isi
   780    790   		os=-sysv
   781    791   		;;
   782    792   	leon-*|leon[3-9]-*)
   783         -		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
          793  +		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
   784    794   		;;
   785    795   	m68knommu)
   786    796   		basic_machine=m68k-unknown
   787    797   		os=-linux
   788    798   		;;
   789    799   	m68knommu-*)
   790         -		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
          800  +		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   791    801   		os=-linux
   792    802   		;;
   793         -	m88k-omron*)
   794         -		basic_machine=m88k-omron
   795         -		;;
   796    803   	magnum | m3230)
   797    804   		basic_machine=mips-mips
   798    805   		os=-sysv
   799    806   		;;
   800    807   	merlin)
   801    808   		basic_machine=ns32k-utek
   802    809   		os=-sysv
................................................................................
   820    827   		basic_machine=m68000-convergent
   821    828   		;;
   822    829   	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
   823    830   		basic_machine=m68k-atari
   824    831   		os=-mint
   825    832   		;;
   826    833   	mips3*-*)
   827         -		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
          834  +		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
   828    835   		;;
   829    836   	mips3*)
   830         -		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
          837  +		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
   831    838   		;;
   832    839   	monitor)
   833    840   		basic_machine=m68k-rom68k
   834    841   		os=-coff
   835    842   		;;
   836    843   	morphos)
   837    844   		basic_machine=powerpc-unknown
................................................................................
   842    849   		os=-moxiebox
   843    850   		;;
   844    851   	msdos)
   845    852   		basic_machine=i386-pc
   846    853   		os=-msdos
   847    854   		;;
   848    855   	ms1-*)
   849         -		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
          856  +		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
   850    857   		;;
   851    858   	msys)
   852    859   		basic_machine=i686-pc
   853    860   		os=-msys
   854    861   		;;
   855    862   	mvs)
   856    863   		basic_machine=i370-ibm
................................................................................
   884    891   		basic_machine=mips-sony
   885    892   		os=-newsos
   886    893   		;;
   887    894   	necv70)
   888    895   		basic_machine=v70-nec
   889    896   		os=-sysv
   890    897   		;;
   891         -	next | m*-next )
          898  +	next | m*-next)
   892    899   		basic_machine=m68k-next
   893    900   		case $os in
   894    901   		    -nextstep* )
   895    902   			;;
   896    903   		    -ns2*)
   897    904   		      os=-nextstep2
   898    905   			;;
................................................................................
   929    936   		;;
   930    937   	nse-tandem)
   931    938   		basic_machine=nse-tandem
   932    939   		;;
   933    940   	nsr-tandem)
   934    941   		basic_machine=nsr-tandem
   935    942   		;;
          943  +	nsv-tandem)
          944  +		basic_machine=nsv-tandem
          945  +		;;
          946  +	nsx-tandem)
          947  +		basic_machine=nsx-tandem
          948  +		;;
   936    949   	op50n-* | op60c-*)
   937    950   		basic_machine=hppa1.1-oki
   938    951   		os=-proelf
   939    952   		;;
   940    953   	openrisc | openrisc-*)
   941    954   		basic_machine=or32-unknown
   942    955   		;;
................................................................................
   961    974   		os=-osf
   962    975   		;;
   963    976   	parisc)
   964    977   		basic_machine=hppa-unknown
   965    978   		os=-linux
   966    979   		;;
   967    980   	parisc-*)
   968         -		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
          981  +		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   969    982   		os=-linux
   970    983   		;;
   971    984   	pbd)
   972    985   		basic_machine=sparc-tti
   973    986   		;;
   974    987   	pbb)
   975    988   		basic_machine=m68k-tti
................................................................................
   977    990   	pc532 | pc532-*)
   978    991   		basic_machine=ns32k-pc532
   979    992   		;;
   980    993   	pc98)
   981    994   		basic_machine=i386-pc
   982    995   		;;
   983    996   	pc98-*)
   984         -		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
          997  +		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
   985    998   		;;
   986    999   	pentium | p5 | k5 | k6 | nexgen | viac3)
   987   1000   		basic_machine=i586-pc
   988   1001   		;;
   989   1002   	pentiumpro | p6 | 6x86 | athlon | athlon_*)
   990   1003   		basic_machine=i686-pc
   991   1004   		;;
................................................................................
   992   1005   	pentiumii | pentium2 | pentiumiii | pentium3)
   993   1006   		basic_machine=i686-pc
   994   1007   		;;
   995   1008   	pentium4)
   996   1009   		basic_machine=i786-pc
   997   1010   		;;
   998   1011   	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
   999         -		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
         1012  +		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1000   1013   		;;
  1001   1014   	pentiumpro-* | p6-* | 6x86-* | athlon-*)
  1002         -		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
         1015  +		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1003   1016   		;;
  1004   1017   	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
  1005         -		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
         1018  +		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1006   1019   		;;
  1007   1020   	pentium4-*)
  1008         -		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
         1021  +		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1009   1022   		;;
  1010   1023   	pn)
  1011   1024   		basic_machine=pn-gould
  1012   1025   		;;
  1013   1026   	power)	basic_machine=power-ibm
  1014   1027   		;;
  1015   1028   	ppc | ppcbe)	basic_machine=powerpc-unknown
  1016   1029   		;;
  1017   1030   	ppc-* | ppcbe-*)
  1018         -		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
         1031  +		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1019   1032   		;;
  1020         -	ppcle | powerpclittle | ppc-le | powerpc-little)
         1033  +	ppcle | powerpclittle)
  1021   1034   		basic_machine=powerpcle-unknown
  1022   1035   		;;
  1023   1036   	ppcle-* | powerpclittle-*)
  1024         -		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
         1037  +		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1025   1038   		;;
  1026   1039   	ppc64)	basic_machine=powerpc64-unknown
  1027   1040   		;;
  1028         -	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
         1041  +	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1029   1042   		;;
  1030         -	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
         1043  +	ppc64le | powerpc64little)
  1031   1044   		basic_machine=powerpc64le-unknown
  1032   1045   		;;
  1033   1046   	ppc64le-* | powerpc64little-*)
  1034         -		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
         1047  +		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1035   1048   		;;
  1036   1049   	ps2)
  1037   1050   		basic_machine=i386-ibm
  1038   1051   		;;
  1039   1052   	pw32)
  1040   1053   		basic_machine=i586-unknown
  1041   1054   		os=-pw32
................................................................................
  1081   1094   	sei)
  1082   1095   		basic_machine=mips-sei
  1083   1096   		os=-seiux
  1084   1097   		;;
  1085   1098   	sequent)
  1086   1099   		basic_machine=i386-sequent
  1087   1100   		;;
  1088         -	sh)
  1089         -		basic_machine=sh-hitachi
  1090         -		os=-hms
  1091         -		;;
  1092   1101   	sh5el)
  1093   1102   		basic_machine=sh5le-unknown
  1094   1103   		;;
  1095         -	sh64)
  1096         -		basic_machine=sh64-unknown
  1097         -		;;
  1098         -	sparclite-wrs | simso-wrs)
         1104  +	simso-wrs)
  1099   1105   		basic_machine=sparclite-wrs
  1100   1106   		os=-vxworks
  1101   1107   		;;
  1102   1108   	sps7)
  1103   1109   		basic_machine=m68k-bull
  1104   1110   		os=-sysv2
  1105   1111   		;;
................................................................................
  1110   1116   		basic_machine=m68k-tandem
  1111   1117   		;;
  1112   1118   	stratus)
  1113   1119   		basic_machine=i860-stratus
  1114   1120   		os=-sysv4
  1115   1121   		;;
  1116   1122   	strongarm-* | thumb-*)
  1117         -		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
         1123  +		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  1118   1124   		;;
  1119   1125   	sun2)
  1120   1126   		basic_machine=m68000-sun
  1121   1127   		;;
  1122   1128   	sun2os3)
  1123   1129   		basic_machine=m68000-sun
  1124   1130   		os=-sunos3
................................................................................
  1232   1238   		basic_machine=w65-wdc
  1233   1239   		os=-none
  1234   1240   		;;
  1235   1241   	w89k-*)
  1236   1242   		basic_machine=hppa1.1-winbond
  1237   1243   		os=-proelf
  1238   1244   		;;
         1245  +	x64)
         1246  +		basic_machine=x86_64-pc
         1247  +		;;
  1239   1248   	xbox)
  1240   1249   		basic_machine=i686-pc
  1241   1250   		os=-mingw32
  1242   1251   		;;
  1243   1252   	xps | xps100)
  1244   1253   		basic_machine=xps100-honeywell
  1245   1254   		;;
  1246   1255   	xscale-* | xscalee[bl]-*)
  1247         -		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
         1256  +		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
  1248   1257   		;;
  1249   1258   	ymp)
  1250   1259   		basic_machine=ymp-cray
  1251   1260   		os=-unicos
  1252   1261   		;;
  1253         -	z8k-*-coff)
  1254         -		basic_machine=z8k-unknown
  1255         -		os=-sim
  1256         -		;;
  1257         -	z80-*-coff)
  1258         -		basic_machine=z80-unknown
  1259         -		os=-sim
  1260         -		;;
  1261   1262   	none)
  1262   1263   		basic_machine=none-none
  1263   1264   		os=-none
  1264   1265   		;;
  1265   1266   
  1266   1267   # Here we handle the default manufacturer of certain CPU types.  It is in
  1267   1268   # some cases the only manufacturer, in others, it is the most popular.
................................................................................
  1282   1283   		;;
  1283   1284   	rs6000)
  1284   1285   		basic_machine=rs6000-ibm
  1285   1286   		;;
  1286   1287   	vax)
  1287   1288   		basic_machine=vax-dec
  1288   1289   		;;
  1289         -	pdp10)
  1290         -		# there are many clones, so DEC is not a safe bet
  1291         -		basic_machine=pdp10-unknown
  1292         -		;;
  1293   1290   	pdp11)
  1294   1291   		basic_machine=pdp11-dec
  1295   1292   		;;
  1296   1293   	we32k)
  1297   1294   		basic_machine=we32k-att
  1298   1295   		;;
  1299   1296   	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
  1300   1297   		basic_machine=sh-unknown
  1301   1298   		;;
  1302         -	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
  1303         -		basic_machine=sparc-sun
  1304         -		;;
  1305   1299   	cydra)
  1306   1300   		basic_machine=cydra-cydrome
  1307   1301   		;;
  1308   1302   	orion)
  1309   1303   		basic_machine=orion-highlevel
  1310   1304   		;;
  1311   1305   	orion105)
................................................................................
  1317   1311   	pmac | pmac-mpw)
  1318   1312   		basic_machine=powerpc-apple
  1319   1313   		;;
  1320   1314   	*-unknown)
  1321   1315   		# Make sure to match an already-canonicalized machine name.
  1322   1316   		;;
  1323   1317   	*)
  1324         -		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
         1318  +		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
  1325   1319   		exit 1
  1326   1320   		;;
  1327   1321   esac
  1328   1322   
  1329   1323   # Here we canonicalize certain aliases for manufacturers.
  1330   1324   case $basic_machine in
  1331   1325   	*-digital*)
  1332         -		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
         1326  +		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
  1333   1327   		;;
  1334   1328   	*-commodore*)
  1335         -		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
         1329  +		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
  1336   1330   		;;
  1337   1331   	*)
  1338   1332   		;;
  1339   1333   esac
  1340   1334   
  1341   1335   # Decode manufacturer-specific aliases for certain operating systems.
  1342   1336   
  1343   1337   if [ x"$os" != x"" ]
  1344   1338   then
  1345   1339   case $os in
  1346         -	# First match some system type aliases
  1347         -	# that might get confused with valid system types.
         1340  +	# First match some system type aliases that might get confused
         1341  +	# with valid system types.
  1348   1342   	# -solaris* is a basic system type, with this one exception.
  1349   1343   	-auroraux)
  1350   1344   		os=-auroraux
  1351   1345   		;;
  1352   1346   	-solaris1 | -solaris1.*)
  1353   1347   		os=`echo $os | sed -e 's|solaris1|sunos4|'`
  1354   1348   		;;
  1355   1349   	-solaris)
  1356   1350   		os=-solaris2
  1357   1351   		;;
  1358         -	-svr4*)
  1359         -		os=-sysv4
  1360         -		;;
  1361   1352   	-unixware*)
  1362   1353   		os=-sysv4.2uw
  1363   1354   		;;
  1364   1355   	-gnu/linux*)
  1365   1356   		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  1366   1357   		;;
  1367         -	# First accept the basic system types.
         1358  +	# es1800 is here to avoid being matched by es* (a different OS)
         1359  +	-es1800*)
         1360  +		os=-ose
         1361  +		;;
         1362  +	# Now accept the basic system types.
  1368   1363   	# The portable systems comes first.
  1369         -	# Each alternative MUST END IN A *, to match a version number.
         1364  +	# Each alternative MUST end in a * to match a version number.
  1370   1365   	# -sysv* is not here because it comes later, after sysvr4.
  1371   1366   	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  1372   1367   	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
  1373   1368   	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
  1374   1369   	      | -sym* | -kopensolaris* | -plan9* \
  1375   1370   	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  1376         -	      | -aos* | -aros* \
         1371  +	      | -aos* | -aros* | -cloudabi* | -sortix* \
  1377   1372   	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  1378   1373   	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  1379         -	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
  1380         -	      | -bitrig* | -openbsd* | -solidbsd* \
         1374  +	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
         1375  +	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
  1381   1376   	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
  1382   1377   	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  1383   1378   	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  1384         -	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  1385         -	      | -chorusos* | -chorusrdb* | -cegcc* \
         1379  +	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
         1380  +	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
  1386   1381   	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  1387         -	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
         1382  +	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
  1388   1383   	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
  1389   1384   	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
  1390         -	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
         1385  +	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
  1391   1386   	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  1392   1387   	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
  1393   1388   	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
  1394         -	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
         1389  +	      | -morphos* | -superux* | -rtmk* | -windiss* \
  1395   1390   	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
  1396         -	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
         1391  +	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
         1392  +	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
         1393  +	      | -midnightbsd*)
  1397   1394   	# Remember, each alternative MUST END IN *, to match a version number.
  1398   1395   		;;
  1399   1396   	-qnx*)
  1400   1397   		case $basic_machine in
  1401   1398   		    x86-* | i*86-*)
  1402   1399   			;;
  1403   1400   		    *)
................................................................................
  1406   1403   		esac
  1407   1404   		;;
  1408   1405   	-nto-qnx*)
  1409   1406   		;;
  1410   1407   	-nto*)
  1411   1408   		os=`echo $os | sed -e 's|nto|nto-qnx|'`
  1412   1409   		;;
  1413         -	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
  1414         -	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
         1410  +	-sim | -xray | -os68k* | -v88r* \
         1411  +	      | -windows* | -osx | -abug | -netware* | -os9* \
  1415   1412   	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
  1416   1413   		;;
  1417   1414   	-mac*)
  1418         -		os=`echo $os | sed -e 's|mac|macos|'`
         1415  +		os=`echo "$os" | sed -e 's|mac|macos|'`
  1419   1416   		;;
  1420   1417   	-linux-dietlibc)
  1421   1418   		os=-linux-dietlibc
  1422   1419   		;;
  1423   1420   	-linux*)
  1424   1421   		os=`echo $os | sed -e 's|linux|linux-gnu|'`
  1425   1422   		;;
  1426   1423   	-sunos5*)
  1427         -		os=`echo $os | sed -e 's|sunos5|solaris2|'`
         1424  +		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
  1428   1425   		;;
  1429   1426   	-sunos6*)
  1430         -		os=`echo $os | sed -e 's|sunos6|solaris3|'`
         1427  +		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
  1431   1428   		;;
  1432   1429   	-opened*)
  1433   1430   		os=-openedition
  1434   1431   		;;
  1435   1432   	-os400*)
  1436   1433   		os=-os400
  1437   1434   		;;
  1438   1435   	-wince*)
  1439   1436   		os=-wince
  1440   1437   		;;
  1441         -	-osfrose*)
  1442         -		os=-osfrose
  1443         -		;;
  1444         -	-osf*)
  1445         -		os=-osf
  1446         -		;;
  1447   1438   	-utek*)
  1448   1439   		os=-bsd
  1449   1440   		;;
  1450   1441   	-dynix*)
  1451   1442   		os=-bsd
  1452   1443   		;;
  1453   1444   	-acis*)
................................................................................
  1464   1455   		;;
  1465   1456   	-ctix* | -uts*)
  1466   1457   		os=-sysv
  1467   1458   		;;
  1468   1459   	-nova*)
  1469   1460   		os=-rtmk-nova
  1470   1461   		;;
  1471         -	-ns2 )
         1462  +	-ns2)
  1472   1463   		os=-nextstep2
  1473   1464   		;;
  1474   1465   	-nsk*)
  1475   1466   		os=-nsk
  1476   1467   		;;
  1477   1468   	# Preserve the version number of sinix5.
  1478   1469   	-sinix5.*)
................................................................................
  1486   1477   		;;
  1487   1478   	-triton*)
  1488   1479   		os=-sysv3
  1489   1480   		;;
  1490   1481   	-oss*)
  1491   1482   		os=-sysv3
  1492   1483   		;;
  1493         -	-svr4)
         1484  +	-svr4*)
  1494   1485   		os=-sysv4
  1495   1486   		;;
  1496   1487   	-svr3)
  1497   1488   		os=-sysv3
  1498   1489   		;;
  1499   1490   	-sysvr4)
  1500   1491   		os=-sysv4
................................................................................
  1501   1492   		;;
  1502   1493   	# This must come after -sysvr4.
  1503   1494   	-sysv*)
  1504   1495   		;;
  1505   1496   	-ose*)
  1506   1497   		os=-ose
  1507   1498   		;;
  1508         -	-es1800*)
  1509         -		os=-ose
  1510         -		;;
  1511         -	-xenix)
  1512         -		os=-xenix
  1513         -		;;
  1514   1499   	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  1515   1500   		os=-mint
  1516   1501   		;;
  1517         -	-aros*)
  1518         -		os=-aros
  1519         -		;;
  1520   1502   	-zvmoe)
  1521   1503   		os=-zvmoe
  1522   1504   		;;
  1523   1505   	-dicos*)
  1524   1506   		os=-dicos
         1507  +		;;
         1508  +	-pikeos*)
         1509  +		# Until real need of OS specific support for
         1510  +		# particular features comes up, bare metal
         1511  +		# configurations are quite functional.
         1512  +		case $basic_machine in
         1513  +		    arm*)
         1514  +			os=-eabi
         1515  +			;;
         1516  +		    *)
         1517  +			os=-elf
         1518  +			;;
         1519  +		esac
  1525   1520   		;;
  1526   1521   	-nacl*)
         1522  +		;;
         1523  +	-ios)
  1527   1524   		;;
  1528   1525   	-none)
  1529   1526   		;;
  1530   1527   	*)
  1531   1528   		# Get rid of the `-' at the beginning of $os.
  1532   1529   		os=`echo $os | sed 's/[^-]*-//'`
  1533         -		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
         1530  +		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
  1534   1531   		exit 1
  1535   1532   		;;
  1536   1533   esac
  1537   1534   else
  1538   1535   
  1539   1536   # Here we handle the default operating systems that come with various machines.
  1540   1537   # The value should be what the vendor currently ships out the door with their
................................................................................
  1616   1613   		;;
  1617   1614   	*-tti)	# must be before sparc entry or we get the wrong os.
  1618   1615   		os=-sysv3
  1619   1616   		;;
  1620   1617   	sparc-* | *-sun)
  1621   1618   		os=-sunos4.1.1
  1622   1619   		;;
         1620  +	pru-*)
         1621  +		os=-elf
         1622  +		;;
  1623   1623   	*-be)
  1624   1624   		os=-beos
  1625   1625   		;;
  1626         -	*-haiku)
  1627         -		os=-haiku
  1628         -		;;
  1629   1626   	*-ibm)
  1630   1627   		os=-aix
  1631   1628   		;;
  1632   1629   	*-knuth)
  1633   1630   		os=-mmixware
  1634   1631   		;;
  1635   1632   	*-wec)
................................................................................
  1661   1658   		;;
  1662   1659   	m68k-ccur)
  1663   1660   		os=-rtu
  1664   1661   		;;
  1665   1662   	m88k-omron*)
  1666   1663   		os=-luna
  1667   1664   		;;
  1668         -	*-next )
         1665  +	*-next)
  1669   1666   		os=-nextstep
  1670   1667   		;;
  1671   1668   	*-sequent)
  1672   1669   		os=-ptx
  1673   1670   		;;
  1674   1671   	*-crds)
  1675   1672   		os=-unos
................................................................................
  1676   1673   		;;
  1677   1674   	*-ns)
  1678   1675   		os=-genix
  1679   1676   		;;
  1680   1677   	i370-*)
  1681   1678   		os=-mvs
  1682   1679   		;;
  1683         -	*-next)
  1684         -		os=-nextstep3
  1685         -		;;
  1686   1680   	*-gould)
  1687   1681   		os=-sysv
  1688   1682   		;;
  1689   1683   	*-highlevel)
  1690   1684   		os=-bsd
  1691   1685   		;;
  1692   1686   	*-encore)
................................................................................
  1788   1782   			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  1789   1783   				vendor=atari
  1790   1784   				;;
  1791   1785   			-vos*)
  1792   1786   				vendor=stratus
  1793   1787   				;;
  1794   1788   		esac
  1795         -		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
         1789  +		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
  1796   1790   		;;
  1797   1791   esac
  1798   1792   
  1799         -echo $basic_machine$os
         1793  +echo "$basic_machine$os"
  1800   1794   exit
  1801   1795   
  1802   1796   # Local variables:
  1803         -# eval: (add-hook 'write-file-hooks 'time-stamp)
         1797  +# eval: (add-hook 'before-save-hook 'time-stamp)
  1804   1798   # time-stamp-start: "timestamp='"
  1805   1799   # time-stamp-format: "%:y-%02m-%02d"
  1806   1800   # time-stamp-end: "'"
  1807   1801   # End:

Changes to autosetup/cc-lib.tcl.

     8      8   use cc
     9      9   
    10     10   module-options {}
    11     11   
    12     12   # @cc-check-lfs
    13     13   #
    14     14   # The equivalent of the 'AC_SYS_LARGEFILE' macro.
    15         -# 
           15  +#
    16     16   # defines 'HAVE_LFS' if LFS is available,
    17     17   # and defines '_FILE_OFFSET_BITS=64' if necessary
    18     18   #
    19     19   # Returns 1 if 'LFS' is available or 0 otherwise
    20     20   #
    21     21   proc cc-check-lfs {} {
    22     22   	cc-check-includes sys/types.h
................................................................................
    34     34   	define-feature lfs $lfs
    35     35   	return $lfs
    36     36   }
    37     37   
    38     38   # @cc-check-endian
    39     39   #
    40     40   # The equivalent of the 'AC_C_BIGENDIAN' macro.
    41         -# 
           41  +#
    42     42   # defines 'HAVE_BIG_ENDIAN' if endian is known to be big,
    43     43   # or 'HAVE_LITTLE_ENDIAN' if endian is known to be little.
    44     44   #
    45     45   # Returns 1 if determined, or 0 if not.
    46     46   #
    47     47   proc cc-check-endian {} {
    48     48   	cc-check-includes sys/types.h sys/param.h

Changes to autosetup/cc-shared.tcl.

    10     10   ## SH_LDFLAGS        Flags to use linking (creating) a shared library
    11     11   ## SH_SOPREFIX       Prefix to use to set the soname when creating a shared library
    12     12   ## SH_SOEXT          Extension for shared libs
    13     13   ## SH_SOEXTVER       Format for versioned shared libs - %s = version
    14     14   ## SHOBJ_CFLAGS      Flags to use compiling sources destined for a shared object
    15     15   ## SHOBJ_LDFLAGS     Flags to use linking a shared object, undefined symbols allowed
    16     16   ## SHOBJ_LDFLAGS_R   - as above, but all symbols must be resolved
           17  +## SH_LINKRPATH      Format for setting the rpath when linking an executable, %s = path
    17     18   ## SH_LINKFLAGS      Flags to use linking an executable which will load shared objects
    18     19   ## LD_LIBRARY_PATH   Environment variable which specifies path to shared libraries
    19     20   ## STRIPLIBFLAGS     Arguments to strip a dynamic library
    20     21   
    21     22   module-options {}
    22     23   
    23     24   # Defaults: gcc on unix
    24     25   define SHOBJ_CFLAGS -fpic
    25     26   define SHOBJ_LDFLAGS -shared
    26     27   define SH_CFLAGS -fpic
    27     28   define SH_LDFLAGS -shared
    28     29   define SH_LINKFLAGS -rdynamic
           30  +define SH_LINKRPATH "-Wl,-rpath -Wl,%s"
    29     31   define SH_SOEXT .so
    30     32   define SH_SOEXTVER .so.%s
    31     33   define SH_SOPREFIX -Wl,-soname,
    32     34   define LD_LIBRARY_PATH LD_LIBRARY_PATH
    33     35   define STRIPLIBFLAGS --strip-unneeded
    34     36   
    35     37   # Note: This is a helpful reference for identifying the toolchain
................................................................................
    50     52   		define STRIPLIBFLAGS -x
    51     53   	}
    52     54   	*-*-ming* - *-*-cygwin - *-*-msys {
    53     55   		define SHOBJ_CFLAGS ""
    54     56   		define SHOBJ_LDFLAGS -shared
    55     57   		define SH_CFLAGS ""
    56     58   		define SH_LDFLAGS -shared
           59  +		define SH_LINKRPATH ""
    57     60   		define SH_LINKFLAGS ""
    58     61   		define SH_SOEXT .dll
    59     62   		define SH_SOEXTVER .dll
    60     63   		define SH_SOPREFIX ""
    61     64   		define LD_LIBRARY_PATH PATH
    62     65   	}
    63     66   	sparc* {
    64     67   		if {[msg-quiet cc-check-decls __SUNPRO_C]} {
    65     68   			msg-result "Found sun stdio compiler"
    66     69   			# sun stdio compiler
    67         -			# XXX: These haven't been fully tested. 
           70  +			# XXX: These haven't been fully tested.
    68     71   			define SHOBJ_CFLAGS -KPIC
    69     72   			define SHOBJ_LDFLAGS "-G"
    70     73   			define SH_CFLAGS -KPIC
    71     74   			define SH_LINKFLAGS -Wl,-export-dynamic
    72     75   			define SH_SOPREFIX -Wl,-h,
    73     76   		} else {
    74     77   			# sparc has a very small GOT table limit, so use -fPIC
................................................................................
    76     79   			define SHOBJ_CFLAGS -fPIC
    77     80   		}
    78     81   	}
    79     82   	*-*-solaris* {
    80     83   		if {[msg-quiet cc-check-decls __SUNPRO_C]} {
    81     84   			msg-result "Found sun stdio compiler"
    82     85   			# sun stdio compiler
    83         -			# XXX: These haven't been fully tested. 
           86  +			# XXX: These haven't been fully tested.
    84     87   			define SHOBJ_CFLAGS -KPIC
    85     88   			define SHOBJ_LDFLAGS "-G"
    86     89   			define SH_CFLAGS -KPIC
    87     90   			define SH_LINKFLAGS -Wl,-export-dynamic
    88     91   			define SH_SOPREFIX -Wl,-h,
    89     92   		}
    90     93   	}

Changes to autosetup/cc.tcl.

   209    209   # In addition, '-l$lib' is prepended to the 'LIBS' define.
   210    210   #
   211    211   # If additional libraries may be needed for linking, they should be specified
   212    212   # with '$extralibs' as '-lotherlib1 -lotherlib2'.
   213    213   # These libraries are not automatically added to 'LIBS'.
   214    214   #
   215    215   # Returns 1 if found or 0 if not.
   216         -# 
          216  +#
   217    217   proc cc-check-function-in-lib {function libs {otherlibs {}}} {
   218    218   	msg-checking "Checking libs for $function..."
   219    219   	set found 0
   220    220   	cc-with [list -libs $otherlibs] {
   221    221   		if {[cctest_function $function]} {
   222    222   			msg-result "none needed"
   223    223   			define lib_$function ""
................................................................................
   430    430   			return -code [dict get $info -code] $result
   431    431   		}
   432    432   		return $result
   433    433   	}
   434    434   }
   435    435   
   436    436   # @cctest ?settings?
   437         -# 
          437  +#
   438    438   # Low level C/C++ compiler checker. Compiles and or links a small C program
   439    439   # according to the arguments and returns 1 if OK, or 0 if not.
   440    440   #
   441    441   # Supported settings are:
   442    442   #
   443    443   ## -cflags cflags      A list of flags to pass to the compiler
   444    444   ## -includes list      A list of includes, e.g. {stdlib.h stdio.h}

Changes to autosetup/system.tcl.

    44     44   	infodir:
    45     45   	libexecdir:
    46     46   	datadir:
    47     47   	libdir:
    48     48   	sysconfdir:
    49     49   	sharedstatedir:
    50     50   	localstatedir:
           51  +	runstatedir:
    51     52   	maintainer-mode=0
    52     53   	dependency-tracking=0
    53     54   	silent-rules=0
    54     55   }]
    55     56   
    56     57   # @check-feature name { script }
    57     58   #
................................................................................
   137    138   # Reads the input file '<srcdir>/$template' and writes the output file '$outfile'
   138    139   # (unless unchanged).
   139    140   # If '$outfile' is blank/omitted, '$template' should end with '.in' which
   140    141   # is removed to create the output file name.
   141    142   #
   142    143   # Each pattern of the form '@define@' is replaced with the corresponding
   143    144   # "define", if it exists, or left unchanged if not.
   144         -# 
          145  +#
   145    146   # The special value '@srcdir@' is substituted with the relative
   146    147   # path to the source directory from the directory where the output
   147    148   # file is created, while the special value '@top_srcdir@' is substituted
   148    149   # with the relative path to the top level source directory.
   149    150   #
   150    151   # Conditional sections may be specified as follows:
   151         -## @if name == value
          152  +## @if NAME eq "value"
   152    153   ## lines
   153    154   ## @else
   154    155   ## lines
   155    156   ## @endif
   156    157   #
   157         -# Where 'name' is a defined variable name and '@else' is optional.
          158  +# Where 'NAME' is a defined variable name and '@else' is optional.
          159  +# Note that variables names *must* start with an uppercase letter.
   158    160   # If the expression does not match, all lines through '@endif' are ignored.
   159    161   #
   160    162   # The alternative forms may also be used:
   161         -## @if name
   162         -## @if name != value
          163  +## @if NAME  (true if the variable is defined, but not empty and not "0")
          164  +## @if !NAME  (opposite of the form above)
          165  +## @if <general-tcl-expression>
   163    166   #
   164         -# Where the first form is true if the variable is defined, but not empty nor 0.
          167  +# In the general Tcl expression, any words beginning with an uppercase letter
          168  +# are translated into [get-define NAME]
   165    169   #
   166         -# Currently these expressions can't be nested.
          170  +# Expressions may be nested
   167    171   #
   168    172   proc make-template {template {out {}}} {
   169    173   	set infile [file join $::autosetup(srcdir) $template]
   170    174   
   171    175   	if {![file exists $infile]} {
   172    176   		user-error "Template $template is missing"
   173    177   	}
................................................................................
   191    195   	define srcdir [relative-path [file join $::autosetup(srcdir) $outdir] $outdir]
   192    196   	define top_srcdir [relative-path $::autosetup(srcdir) $outdir]
   193    197   
   194    198   	set mapping {}
   195    199   	foreach {n v} [array get ::define] {
   196    200   		lappend mapping @$n@ $v
   197    201   	}
          202  +
          203  +	# A stack of true/false conditions, one for each nested conditional
          204  +	# starting with "true"
          205  +	set condstack {1}
   198    206   	set result {}
          207  +	set linenum 0
   199    208   	foreach line [split [readfile $infile] \n] {
   200         -		if {[info exists cond]} {
   201         -			set l [string trimright $line]
   202         -			if {$l eq "@endif"} {
   203         -				unset cond
   204         -				continue
          209  +		incr linenum
          210  +		if {[regexp {^@(if|else|endif)\s*(.*)} $line -> condtype condargs]} {
          211  +			if {$condtype eq "if"} {
          212  +				if {[llength $condargs] == 1} {
          213  +					# ABC => [get-define ABC] ni {0 ""}
          214  +					# !ABC => [get-define ABC] in {0 ""}
          215  +					lassign $condargs condvar
          216  +					if {[regexp {^!(.*)} $condvar -> condvar]} {
          217  +						set op in
          218  +					} else {
          219  +						set op ni
          220  +					}
          221  +					set condexpr "\[[list get-define $condvar]\] $op {0 {}}"
          222  +				} else {
          223  +					# Translate alphanumeric ABC into [get-define ABC] and leave the
          224  +					# rest of the expression untouched
          225  +					regsub -all {([A-Z][[:alnum:]_]*)} $condargs {[get-define \1]} condexpr
          226  +				}
          227  +				if {[catch [list expr $condexpr] condval]} {
          228  +					dputs $condval
          229  +					autosetup-error "$infile:$linenum: Invalid expression: $line"
          230  +				}
          231  +				dputs "@$condtype: $condexpr => $condval"
   205    232   			}
   206         -			if {$l eq "@else"} {
   207         -				set cond [expr {!$cond}]
   208         -				continue
          233  +			if {$condtype ne "if" && [llength $condstack] <= 1} {
          234  +				autosetup-error "$infile:$linenum: Error: @$condtype missing @if"
   209    235   			}
   210         -			if {$cond} {
   211         -				lappend result $line
          236  +			switch -exact $condtype {
          237  +				if {
          238  +					# push condval
          239  +					lappend condstack $condval
          240  +				}
          241  +				else {
          242  +					# Toggle the last entry
          243  +					set condval [lpop condstack]
          244  +					set condval [expr {!$condval}]
          245  +					lappend condstack $condval
          246  +				}
          247  +				endif {
          248  +					if {[llength $condstack] == 0} {
          249  +						user-notice "$infile:$linenum: Error: @endif missing @if"
          250  +					}
          251  +					lpop condstack
          252  +				}
   212    253   			}
   213    254   			continue
   214    255   		}
   215         -		if {[regexp {^@if\s+(\w+)(.*)} $line -> name expression]} {
   216         -			lassign $expression equal value
   217         -			set varval [get-define $name ""]
   218         -			if {$equal eq ""} {
   219         -				set cond [expr {$varval ni {"" 0}}]
   220         -			} else {
   221         -				set cond [expr {$varval eq $value}]
   222         -				if {$equal ne "=="} {
   223         -					set cond [expr {!$cond}]
   224         -				}
   225         -			}
          256  +		# Only output this line if the stack contains all "true"
          257  +		if {"0" in $condstack} {
   226    258   			continue
   227    259   		}
   228    260   		lappend result $line
   229    261   	}
   230    262   	write-if-changed $out [string map $mapping [join $result \n]] {
   231    263   		msg-result "Created [relative-path $out] from [relative-path $template]"
   232    264   	}
................................................................................
   297    329   	opt-str sysconfdir sysconfdir $prefix/etc
   298    330   } else {
   299    331   	opt-str sysconfdir sysconfdir /etc
   300    332   }
   301    333   define sysconfdir $sysconfdir
   302    334   
   303    335   define localstatedir [opt-str localstatedir o /var]
          336  +define runstatedir [opt-str runstatedir o /run]
   304    337   
   305    338   define SHELL [get-env SHELL [find-an-executable sh bash ksh]]
   306    339   
   307    340   # These could be used to generate Makefiles following some automake conventions
   308    341   define AM_SILENT_RULES [opt-bool silent-rules]
   309    342   define AM_MAINTAINER_MODE [opt-bool maintainer-mode]
   310    343   define AM_DEPENDENCY_TRACKING [opt-bool dependency-tracking]

Deleted tests/Makefile.

     1         -jimsh ?= ../jimsh
     2         -tclsh ?= tclsh
     3         -
     4         -test:
     5         -	@LD_LIBRARY_PATH=..:$(LD_LIBRARY_PATH) $(jimsh) runall.tcl
     6         -
     7         -tcl:
     8         -	@rc=0; for i in *.test; do LD_LIBRARY_PATH=..:$(LD_LIBRARY_PATH) $(tclsh) -encoding utf-8 $$i || rc=$?; done; exit $$rc
     9         -
    10         -clean:
    11         -	rm -f gorp.file2 gorp.file sleepx test1 exec.tmp1

Added tests/Makefile.in.

            1  +jimsh ?= ../jimsh
            2  +tclsh ?= tclsh
            3  +
            4  +DEF_LD_PATH := @LD_LIBRARY_PATH@="@builddir@:$(@LD_LIBRARY_PATH@)"
            5  +
            6  +test:
            7  +	@$(DEF_LD_PATH) $(jimsh) runall.tcl
            8  +
            9  +tcl:
           10  +	@rc=0; for i in *.test; do $(tclsh) -encoding utf-8 $$i || rc=$?; done; exit $$rc
           11  +
           12  +clean:
           13  +	rm -f gorp.file2 gorp.file sleepx test1 exec.tmp1