Changeset 270b3aa in OpenModelica


Ignore:
Timestamp:
2021-06-09T20:37:38+02:00 (3 years ago)
Author:
Martin Sjölund <martin+github@…>
Branches:
Added-citation-metadata, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
1a21771
Parents:
a432828
git-author:
Martin Sjölund <martin@…> (06/09/21 19:26:01)
git-committer:
Martin Sjölund <martin+github@…> (06/09/21 20:37:38)
Message:

Update config.guess and config.sub

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/3rdParty

    • Property commit changed from 13cccd4fa169c8df0fae13628917e1c6479a9e18 to a0d0cec5c208d26e2d9b1e581bf66232315800cf
  • common/config.guess

    rb66fa07 r270b3aa  
    11#! /bin/sh
    22# Attempt to guess a canonical system name.
    3 #   Copyright 1992-2015 Free Software Foundation, Inc.
    4 
    5 timestamp='2015-03-04'
     3#   Copyright 1992-2021 Free Software Foundation, Inc.
     4
     5timestamp='2021-05-24'
    66
    77# This file is free software; you can redistribute it and/or modify it
     
    1616#
    1717# 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/>.
    1919#
    2020# As a special exception to the GNU General Public License, if you
     
    2828#
    2929# 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/cgit/config.git/plain/config.guess
    3131#
    3232# Please send patches to <config-patches@gnu.org>.
    3333
    3434
    35 me=`echo "$0" | sed -e 's,.*/,,'`
     35me=$(echo "$0" | sed -e 's,.*/,,')
    3636
    3737usage="\
     
    4040Output the configuration name of the system \`$me' is run on.
    4141
    42 Operation modes:
     42Options:
    4343  -h, --help         print this help, then exit
    4444  -t, --time-stamp   print date of last modification, then exit
     
    5151
    5252Originally written by Per Bothner.
    53 Copyright 1992-2015 Free Software Foundation, Inc.
     53Copyright 1992-2021 Free Software Foundation, Inc.
    5454
    5555This is free software; see the source for copying conditions.  There is NO
     
    8585fi
    8686
    87 trap 'exit 1' 1 2 15
    88 
    8987# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
    9088# compiler to aid in system detection is discouraged as it requires
     
    9795# Portable tmp directory creation inspired by the Autoconf team.
    9896
    99 set_cc_for_build='
    100 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
    101 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
    102 : ${TMPDIR=/tmp} ;
    103  { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
    104  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
    105  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
    106  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
    107 dummy=$tmp/dummy ;
    108 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
    109 case $CC_FOR_BUILD,$HOST_CC,$CC in
    110  ,,)    echo "int x;" > $dummy.c ;
    111   for c in cc gcc c89 c99 ; do
    112     if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
    113        CC_FOR_BUILD="$c"; break ;
    114     fi ;
    115   done ;
    116   if test x"$CC_FOR_BUILD" = x ; then
    117     CC_FOR_BUILD=no_compiler_found ;
    118   fi
    119   ;;
    120  ,,*)   CC_FOR_BUILD=$CC ;;
    121  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    122 esac ; set_cc_for_build= ;'
     97tmp=
     98# shellcheck disable=SC2172
     99trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
     100
     101set_cc_for_build() {
     102    # prevent multiple calls if $tmp is already set
     103    test "$tmp" && return 0
     104    : "${TMPDIR=/tmp}"
     105    # shellcheck disable=SC2039
     106    { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
     107  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
     108  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
     109  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
     110    dummy=$tmp/dummy
     111    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
     112  ,,)    echo "int x;" > "$dummy.c"
     113         for driver in cc gcc c89 c99 ; do
     114       if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
     115           CC_FOR_BUILD="$driver"
     116           break
     117       fi
     118         done
     119         if test x"$CC_FOR_BUILD" = x ; then
     120       CC_FOR_BUILD=no_compiler_found
     121         fi
     122         ;;
     123  ,,*)   CC_FOR_BUILD=$CC ;;
     124  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
     125    esac
     126}
    123127
    124128# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
    125129# (ghazi@noc.rutgers.edu 1994-08-24)
    126 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
     130if test -f /.attbin/uname ; then
    127131  PATH=$PATH:/.attbin ; export PATH
    128132fi
    129133
    130 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
    131 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    132 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
    133 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    134 
    135 case "${UNAME_SYSTEM}" in
     134UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
     135UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
     136UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
     137UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
     138
     139case $UNAME_SYSTEM in
    136140Linux|GNU|GNU/*)
    137   # If the system lacks a compiler, then just pick glibc.
    138   # We could probably try harder.
    139   LIBC=gnu
    140 
    141   eval $set_cc_for_build
    142   cat <<-EOF > $dummy.c
     141  LIBC=unknown
     142
     143  set_cc_for_build
     144  cat <<-EOF > "$dummy.c"
    143145  #include <features.h>
    144146  #if defined(__UCLIBC__)
     
    146148  #elif defined(__dietlibc__)
    147149  LIBC=dietlibc
     150  #elif defined(__GLIBC__)
     151  LIBC=gnu
    148152  #else
    149   LIBC=gnu
     153  #include <stdarg.h>
     154  /* First heuristic to detect musl libc.  */
     155  #ifdef __DEFINED_va_list
     156  LIBC=musl
     157  #endif
    150158  #endif
    151159  EOF
    152   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
     160  eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
     161
     162  # Second heuristic to detect musl libc.
     163  if [ "$LIBC" = unknown ] &&
     164     command -v ldd >/dev/null &&
     165     ldd --version 2>&1 | grep -q ^musl; then
     166    LIBC=musl
     167  fi
     168
     169  # If the system lacks a compiler, then just pick glibc.
     170  # We could probably try harder.
     171  if [ "$LIBC" = unknown ]; then
     172    LIBC=gnu
     173  fi
    153174  ;;
    154175esac
     
    156177# Note: order is significant - the case branches are not exclusive.
    157178
    158 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     179case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
    159180    *:NetBSD:*:*)
    160181  # NetBSD (nbsd) targets should (where applicable) match one or
     
    168189  # Note: NetBSD doesn't particularly care about the vendor
    169190  # portion of the name.  We always set it to "unknown".
    170   sysctl="sysctl -n hw.machine_arch"
    171   UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
    172       /sbin/$sysctl 2>/dev/null || \
    173       /usr/sbin/$sysctl 2>/dev/null || \
    174       echo unknown)`
    175   case "${UNAME_MACHINE_ARCH}" in
     191  UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
     192      /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
     193      /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
     194      echo unknown))
     195  case $UNAME_MACHINE_ARCH in
     196      aarch64eb) machine=aarch64_be-unknown ;;
    176197      armeb) machine=armeb-unknown ;;
    177198      arm*) machine=arm-unknown ;;
     
    180201      sh5el) machine=sh5le-unknown ;;
    181202      earmv*)
    182     arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
    183     endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
    184     machine=${arch}${endian}-unknown
     203    arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
     204    endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
     205    machine="${arch}${endian}"-unknown
    185206    ;;
    186       *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
     207      *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
    187208  esac
    188209  # The Operating System including object format, if it has switched
    189   # to ELF recently, or will in the future.
    190   case "${UNAME_MACHINE_ARCH}" in
    191       arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
    192     eval $set_cc_for_build
     210  # to ELF recently (or will in the future) and ABI.
     211  case $UNAME_MACHINE_ARCH in
     212      earm*)
     213    os=netbsdelf
     214    ;;
     215      arm*|i386|m68k|ns32k|sh3*|sparc|vax)
     216    set_cc_for_build
    193217    if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
    194218      | grep -q __ELF__
     
    206230  esac
    207231  # Determine ABI tags.
    208   case "${UNAME_MACHINE_ARCH}" in
     232  case $UNAME_MACHINE_ARCH in
    209233      earm*)
    210234    expr='s/^earmv[0-9]/-eabi/;s/eb$//'
    211     abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
     235    abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
    212236    ;;
    213237  esac
     
    217241  # kernel version information, so it can be replaced with a
    218242  # suitable tag, in the style of linux-gnu.
    219   case "${UNAME_VERSION}" in
     243  case $UNAME_VERSION in
    220244      Debian*)
    221245    release='-gnu'
    222246    ;;
    223247      *)
    224     release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
     248    release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
    225249    ;;
    226250  esac
     
    228252  # contains redundant information, the shorter form:
    229253  # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    230   echo "${machine}-${os}${release}${abi}"
     254  echo "$machine-${os}${release}${abi-}"
    231255  exit ;;
    232256    *:Bitrig:*:*)
    233   UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
    234   echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
     257  UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
     258  echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
    235259  exit ;;
    236260    *:OpenBSD:*:*)
    237   UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
    238   echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
     261  UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
     262  echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
     263  exit ;;
     264    *:SecBSD:*:*)
     265  UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//')
     266  echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE"
     267  exit ;;
     268    *:LibertyBSD:*:*)
     269  UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
     270  echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
     271  exit ;;
     272    *:MidnightBSD:*:*)
     273  echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
    239274  exit ;;
    240275    *:ekkoBSD:*:*)
    241   echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
     276  echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
    242277  exit ;;
    243278    *:SolidBSD:*:*)
    244   echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
     279  echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
     280  exit ;;
     281    *:OS108:*:*)
     282  echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
    245283  exit ;;
    246284    macppc:MirBSD:*:*)
    247   echo powerpc-unknown-mirbsd${UNAME_RELEASE}
     285  echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
    248286  exit ;;
    249287    *:MirBSD:*:*)
    250   echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
     288  echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
     289  exit ;;
     290    *:Sortix:*:*)
     291  echo "$UNAME_MACHINE"-unknown-sortix
     292  exit ;;
     293    *:Twizzler:*:*)
     294  echo "$UNAME_MACHINE"-unknown-twizzler
     295  exit ;;
     296    *:Redox:*:*)
     297  echo "$UNAME_MACHINE"-unknown-redox
     298  exit ;;
     299    mips:OSF1:*.*)
     300  echo mips-dec-osf1
    251301  exit ;;
    252302    alpha:OSF1:*:*)
     303  # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
     304  trap '' 0
    253305  case $UNAME_RELEASE in
    254306  *4.0)
    255     UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
     307    UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
    256308    ;;
    257309  *5.*)
    258     UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     310    UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
    259311    ;;
    260312  esac
     
    263315  # covers most systems running today.  This code pipes the CPU
    264316  # types through head -n 1, so we only detect the type of CPU 0.
    265   ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
    266   case "$ALPHA_CPU_TYPE" in
     317  ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1)
     318  case $ALPHA_CPU_TYPE in
    267319      "EV4 (21064)")
    268     UNAME_MACHINE="alpha" ;;
     320    UNAME_MACHINE=alpha ;;
    269321      "EV4.5 (21064)")
    270     UNAME_MACHINE="alpha" ;;
     322    UNAME_MACHINE=alpha ;;
    271323      "LCA4 (21066/21068)")
    272     UNAME_MACHINE="alpha" ;;
     324    UNAME_MACHINE=alpha ;;
    273325      "EV5 (21164)")
    274     UNAME_MACHINE="alphaev5" ;;
     326    UNAME_MACHINE=alphaev5 ;;
    275327      "EV5.6 (21164A)")
    276     UNAME_MACHINE="alphaev56" ;;
     328    UNAME_MACHINE=alphaev56 ;;
    277329      "EV5.6 (21164PC)")
    278     UNAME_MACHINE="alphapca56" ;;
     330    UNAME_MACHINE=alphapca56 ;;
    279331      "EV5.7 (21164PC)")
    280     UNAME_MACHINE="alphapca57" ;;
     332    UNAME_MACHINE=alphapca57 ;;
    281333      "EV6 (21264)")
    282     UNAME_MACHINE="alphaev6" ;;
     334    UNAME_MACHINE=alphaev6 ;;
    283335      "EV6.7 (21264A)")
    284     UNAME_MACHINE="alphaev67" ;;
     336    UNAME_MACHINE=alphaev67 ;;
    285337      "EV6.8CB (21264C)")
    286     UNAME_MACHINE="alphaev68" ;;
     338    UNAME_MACHINE=alphaev68 ;;
    287339      "EV6.8AL (21264B)")
    288     UNAME_MACHINE="alphaev68" ;;
     340    UNAME_MACHINE=alphaev68 ;;
    289341      "EV6.8CX (21264D)")
    290     UNAME_MACHINE="alphaev68" ;;
     342    UNAME_MACHINE=alphaev68 ;;
    291343      "EV6.9A (21264/EV69A)")
    292     UNAME_MACHINE="alphaev69" ;;
     344    UNAME_MACHINE=alphaev69 ;;
    293345      "EV7 (21364)")
    294     UNAME_MACHINE="alphaev7" ;;
     346    UNAME_MACHINE=alphaev7 ;;
    295347      "EV7.9 (21364A)")
    296     UNAME_MACHINE="alphaev79" ;;
     348    UNAME_MACHINE=alphaev79 ;;
    297349  esac
    298350  # A Pn.n version is a patched version.
     
    301353  # A Xn.n version is an unreleased experimental baselevel.
    302354  # 1.2 uses "1.2" for uname -r.
    303   echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    304   # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
    305   exitcode=$?
    306   trap '' 0
    307   exit $exitcode ;;
    308     Alpha\ *:Windows_NT*:*)
    309   # How do we know it's Interix rather than the generic POSIX subsystem?
    310   # Should we change UNAME_MACHINE based on the output of uname instead
    311   # of the specific Alpha model?
    312   echo alpha-pc-interix
    313   exit ;;
    314     21064:Windows_NT:50:3)
    315   echo alpha-dec-winnt3.5
     355  echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
    316356  exit ;;
    317357    Amiga*:UNIX_System_V:4.0:*)
     
    319359  exit ;;
    320360    *:[Aa]miga[Oo][Ss]:*:*)
    321   echo ${UNAME_MACHINE}-unknown-amigaos
     361  echo "$UNAME_MACHINE"-unknown-amigaos
    322362  exit ;;
    323363    *:[Mm]orph[Oo][Ss]:*:*)
    324   echo ${UNAME_MACHINE}-unknown-morphos
     364  echo "$UNAME_MACHINE"-unknown-morphos
    325365  exit ;;
    326366    *:OS/390:*:*)
     
    334374  exit ;;
    335375    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    336   echo arm-acorn-riscix${UNAME_RELEASE}
     376  echo arm-acorn-riscix"$UNAME_RELEASE"
    337377  exit ;;
    338378    arm*:riscos:*:*|arm*:RISCOS:*:*)
     
    344384    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    345385  # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
    346   if test "`(/bin/universe) 2>/dev/null`" = att ; then
     386  if test "$( (/bin/universe) 2>/dev/null)" = att ; then
    347387    echo pyramid-pyramid-sysv3
    348388  else
     
    357397  exit ;;
    358398    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
    359   case `/usr/bin/uname -p` in
     399  case $(/usr/bin/uname -p) in
    360400      sparc) echo sparc-icl-nx7; exit ;;
    361401  esac ;;
    362402    s390x:SunOS:*:*)
    363   echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     403  echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
    364404  exit ;;
    365405    sun4H:SunOS:5.*:*)
    366   echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     406  echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
    367407  exit ;;
    368408    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    369   echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     409  echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
    370410  exit ;;
    371411    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
    372   echo i386-pc-auroraux${UNAME_RELEASE}
     412  echo i386-pc-auroraux"$UNAME_RELEASE"
    373413  exit ;;
    374414    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
    375   eval $set_cc_for_build
    376   SUN_ARCH="i386"
     415  set_cc_for_build
     416  SUN_ARCH=i386
    377417  # If there is a compiler, see if it is configured for 64-bit objects.
    378418  # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
    379419  # This test works for both compilers.
    380   if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     420  if test "$CC_FOR_BUILD" != no_compiler_found; then
    381421      if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
    382     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     422    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
    383423    grep IS_64BIT_ARCH >/dev/null
    384424      then
    385     SUN_ARCH="x86_64"
     425    SUN_ARCH=x86_64
    386426      fi
    387427  fi
    388   echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     428  echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
    389429  exit ;;
    390430    sun4*:SunOS:6*:*)
     
    392432  # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
    393433  # it's likely to be more like Solaris than SunOS4.
    394   echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     434  echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
    395435  exit ;;
    396436    sun4*:SunOS:*:*)
    397   case "`/usr/bin/arch -k`" in
     437  case $(/usr/bin/arch -k) in
    398438      Series*|S4*)
    399     UNAME_RELEASE=`uname -v`
     439    UNAME_RELEASE=$(uname -v)
    400440    ;;
    401441  esac
    402442  # Japanese Language versions have a version number like `4.1.3-JL'.
    403   echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
     443  echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
    404444  exit ;;
    405445    sun3*:SunOS:*:*)
    406   echo m68k-sun-sunos${UNAME_RELEASE}
     446  echo m68k-sun-sunos"$UNAME_RELEASE"
    407447  exit ;;
    408448    sun*:*:4.2BSD:*)
    409   UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    410   test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
    411   case "`/bin/arch`" in
     449  UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
     450  test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
     451  case $(/bin/arch) in
    412452      sun3)
    413     echo m68k-sun-sunos${UNAME_RELEASE}
     453    echo m68k-sun-sunos"$UNAME_RELEASE"
    414454    ;;
    415455      sun4)
    416     echo sparc-sun-sunos${UNAME_RELEASE}
     456    echo sparc-sun-sunos"$UNAME_RELEASE"
    417457    ;;
    418458  esac
    419459  exit ;;
    420460    aushp:SunOS:*:*)
    421   echo sparc-auspex-sunos${UNAME_RELEASE}
     461  echo sparc-auspex-sunos"$UNAME_RELEASE"
    422462  exit ;;
    423463    # The situation for MiNT is a little confusing.  The machine name
     
    430470    # be no problem.
    431471    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    432   echo m68k-atari-mint${UNAME_RELEASE}
     472  echo m68k-atari-mint"$UNAME_RELEASE"
    433473  exit ;;
    434474    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    435   echo m68k-atari-mint${UNAME_RELEASE}
     475  echo m68k-atari-mint"$UNAME_RELEASE"
    436476  exit ;;
    437477    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    438   echo m68k-atari-mint${UNAME_RELEASE}
     478  echo m68k-atari-mint"$UNAME_RELEASE"
    439479  exit ;;
    440480    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    441   echo m68k-milan-mint${UNAME_RELEASE}
     481  echo m68k-milan-mint"$UNAME_RELEASE"
    442482  exit ;;
    443483    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    444   echo m68k-hades-mint${UNAME_RELEASE}
     484  echo m68k-hades-mint"$UNAME_RELEASE"
    445485  exit ;;
    446486    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    447   echo m68k-unknown-mint${UNAME_RELEASE}
     487  echo m68k-unknown-mint"$UNAME_RELEASE"
    448488  exit ;;
    449489    m68k:machten:*:*)
    450   echo m68k-apple-machten${UNAME_RELEASE}
     490  echo m68k-apple-machten"$UNAME_RELEASE"
    451491  exit ;;
    452492    powerpc:machten:*:*)
    453   echo powerpc-apple-machten${UNAME_RELEASE}
     493  echo powerpc-apple-machten"$UNAME_RELEASE"
    454494  exit ;;
    455495    RISC*:Mach:*:*)
     
    457497  exit ;;
    458498    RISC*:ULTRIX:*:*)
    459   echo mips-dec-ultrix${UNAME_RELEASE}
     499  echo mips-dec-ultrix"$UNAME_RELEASE"
    460500  exit ;;
    461501    VAX*:ULTRIX*:*:*)
    462   echo vax-dec-ultrix${UNAME_RELEASE}
     502  echo vax-dec-ultrix"$UNAME_RELEASE"
    463503  exit ;;
    464504    2020:CLIX:*:* | 2430:CLIX:*:*)
    465   echo clipper-intergraph-clix${UNAME_RELEASE}
     505  echo clipper-intergraph-clix"$UNAME_RELEASE"
    466506  exit ;;
    467507    mips:*:*:UMIPS | mips:*:*:RISCos)
    468   eval $set_cc_for_build
    469   sed 's/^  //' << EOF >$dummy.c
     508  set_cc_for_build
     509  sed 's/^  //' << EOF > "$dummy.c"
    470510#ifdef __cplusplus
    471511#include <stdio.h>  /* for printf() prototype */
     
    476516  #if defined (host_mips) && defined (MIPSEB)
    477517  #if defined (SYSTYPE_SYSV)
    478     printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
     518    printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
    479519  #endif
    480520  #if defined (SYSTYPE_SVR4)
    481     printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
     521    printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
    482522  #endif
    483523  #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
    484     printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
     524    printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
    485525  #endif
    486526  #endif
     
    488528  }
    489529EOF
    490   $CC_FOR_BUILD -o $dummy $dummy.c &&
    491     dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
    492     SYSTEM_NAME=`$dummy $dummyarg` &&
     530  $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
     531    dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
     532    SYSTEM_NAME=$("$dummy" "$dummyarg") &&
    493533      { echo "$SYSTEM_NAME"; exit; }
    494   echo mips-mips-riscos${UNAME_RELEASE}
     534  echo mips-mips-riscos"$UNAME_RELEASE"
    495535  exit ;;
    496536    Motorola:PowerMAX_OS:*:*)
     
    517557    AViiON:dgux:*:*)
    518558  # DG/UX returns AViiON for all architectures
    519   UNAME_PROCESSOR=`/usr/bin/uname -p`
    520   if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
     559  UNAME_PROCESSOR=$(/usr/bin/uname -p)
     560  if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
    521561  then
    522       if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
    523          [ ${TARGET_BINARY_INTERFACE}x = x ]
     562      if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
     563         test "$TARGET_BINARY_INTERFACE"x = x
    524564      then
    525     echo m88k-dg-dgux${UNAME_RELEASE}
     565    echo m88k-dg-dgux"$UNAME_RELEASE"
    526566      else
    527     echo m88k-dg-dguxbcs${UNAME_RELEASE}
     567    echo m88k-dg-dguxbcs"$UNAME_RELEASE"
    528568      fi
    529569  else
    530       echo i586-dg-dgux${UNAME_RELEASE}
     570      echo i586-dg-dgux"$UNAME_RELEASE"
    531571  fi
    532572  exit ;;
     
    545585  exit ;;
    546586    *:IRIX*:*:*)
    547   echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
     587  echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
    548588  exit ;;
    549589    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    550590  echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
    551   exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     591  exit ;;               # Note that: echo "'$(uname -s)'" gives 'AIX '
    552592    i*86:AIX:*:*)
    553593  echo i386-ibm-aix
    554594  exit ;;
    555595    ia64:AIX:*:*)
    556   if [ -x /usr/bin/oslevel ] ; then
    557     IBM_REV=`/usr/bin/oslevel`
     596  if test -x /usr/bin/oslevel ; then
     597    IBM_REV=$(/usr/bin/oslevel)
    558598  else
    559     IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    560   fi
    561   echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
     599    IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
     600  fi
     601  echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
    562602  exit ;;
    563603    *:AIX:2:3)
    564604  if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
    565     eval $set_cc_for_build
    566     sed 's/^    //' << EOF >$dummy.c
     605    set_cc_for_build
     606    sed 's/^    //' << EOF > "$dummy.c"
    567607    #include <sys/systemcfg.h>
    568608
     
    575615      }
    576616EOF
    577     if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
     617    if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
    578618    then
    579619      echo "$SYSTEM_NAME"
     
    588628  exit ;;
    589629    *:AIX:*:[4567])
    590   IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    591   if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
     630  IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
     631  if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
    592632    IBM_ARCH=rs6000
    593633  else
    594634    IBM_ARCH=powerpc
    595635  fi
    596   if [ -x /usr/bin/lslpp ] ; then
    597     IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
    598          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
     636  if test -x /usr/bin/lslpp ; then
     637    IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
     638         awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
    599639  else
    600     IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
    601   fi
    602   echo ${IBM_ARCH}-ibm-aix${IBM_REV}
     640    IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
     641  fi
     642  echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
    603643  exit ;;
    604644    *:AIX:*:*)
    605645  echo rs6000-ibm-aix
    606646  exit ;;
    607     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
     647    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
    608648  echo romp-ibm-bsd4.4
    609649  exit ;;
    610650    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    611   echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
     651  echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
    612652  exit ;;                             # report: romp-ibm BSD 4.3
    613653    *:BOSX:*:*)
     
    624664  exit ;;
    625665    9000/[34678]??:HP-UX:*:*)
    626   HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    627   case "${UNAME_MACHINE}" in
    628       9000/31? )            HP_ARCH=m68000 ;;
    629       9000/[34]?? )         HP_ARCH=m68k ;;
     666  HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
     667  case $UNAME_MACHINE in
     668      9000/31?)            HP_ARCH=m68000 ;;
     669      9000/[34]??)         HP_ARCH=m68k ;;
    630670      9000/[678][0-9][0-9])
    631     if [ -x /usr/bin/getconf ]; then
    632         sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    633         sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    634         case "${sc_cpu_version}" in
    635           523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
    636           528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
     671    if test -x /usr/bin/getconf; then
     672        sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
     673        sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
     674        case $sc_cpu_version in
     675          523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
     676          528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
    637677          532)                      # CPU_PA_RISC2_0
    638       case "${sc_kernel_bits}" in
    639         32) HP_ARCH="hppa2.0n" ;;
    640         64) HP_ARCH="hppa2.0w" ;;
    641         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
     678      case $sc_kernel_bits in
     679        32) HP_ARCH=hppa2.0n ;;
     680        64) HP_ARCH=hppa2.0w ;;
     681        '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
    642682      esac ;;
    643683        esac
    644684    fi
    645     if [ "${HP_ARCH}" = "" ]; then
    646         eval $set_cc_for_build
    647         sed 's/^    //' << EOF >$dummy.c
     685    if test "$HP_ARCH" = ""; then
     686        set_cc_for_build
     687        sed 's/^    //' << EOF > "$dummy.c"
    648688
    649689    #define _HPUX_SOURCE
     
    678718    }
    679719EOF
    680         (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
     720        (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
    681721        test -z "$HP_ARCH" && HP_ARCH=hppa
    682722    fi ;;
    683723  esac
    684   if [ ${HP_ARCH} = "hppa2.0w" ]
     724  if test "$HP_ARCH" = hppa2.0w
    685725  then
    686       eval $set_cc_for_build
     726      set_cc_for_build
    687727
    688728      # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
     
    695735      # => hppa64-hp-hpux11.23
    696736
    697       if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
     737      if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
    698738    grep -q __LP64__
    699739      then
    700     HP_ARCH="hppa2.0w"
     740    HP_ARCH=hppa2.0w
    701741      else
    702     HP_ARCH="hppa64"
     742    HP_ARCH=hppa64
    703743      fi
    704744  fi
    705   echo ${HP_ARCH}-hp-hpux${HPUX_REV}
     745  echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
    706746  exit ;;
    707747    ia64:HP-UX:*:*)
    708   HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    709   echo ia64-hp-hpux${HPUX_REV}
     748  HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
     749  echo ia64-hp-hpux"$HPUX_REV"
    710750  exit ;;
    711751    3050*:HI-UX:*:*)
    712   eval $set_cc_for_build
    713   sed 's/^  //' << EOF >$dummy.c
     752  set_cc_for_build
     753  sed 's/^  //' << EOF > "$dummy.c"
    714754  #include <unistd.h>
    715755  int
     
    736776  }
    737777EOF
    738   $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
     778  $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
    739779    { echo "$SYSTEM_NAME"; exit; }
    740780  echo unknown-hitachi-hiuxwe2
    741781  exit ;;
    742     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
     782    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
    743783  echo hppa1.1-hp-bsd
    744784  exit ;;
     
    749789  echo hppa1.0-hp-mpeix
    750790  exit ;;
    751     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
     791    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
    752792  echo hppa1.1-hp-osf
    753793  exit ;;
     
    756796  exit ;;
    757797    i*86:OSF1:*:*)
    758   if [ -x /usr/sbin/sysversion ] ; then
    759       echo ${UNAME_MACHINE}-unknown-osf1mk
     798  if test -x /usr/sbin/sysversion ; then
     799      echo "$UNAME_MACHINE"-unknown-osf1mk
    760800  else
    761       echo ${UNAME_MACHINE}-unknown-osf1
     801      echo "$UNAME_MACHINE"-unknown-osf1
    762802  fi
    763803  exit ;;
     
    784824  exit ;;
    785825    CRAY*Y-MP:*:*:*)
    786   echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     826  echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    787827  exit ;;
    788828    CRAY*[A-Z]90:*:*:*)
    789   echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
     829  echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
    790830  | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
    791831        -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
     
    793833  exit ;;
    794834    CRAY*TS:*:*:*)
    795   echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     835  echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    796836  exit ;;
    797837    CRAY*T3E:*:*:*)
    798   echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     838  echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    799839  exit ;;
    800840    CRAY*SV1:*:*:*)
    801   echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     841  echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    802842  exit ;;
    803843    *:UNICOS/mp:*:*)
    804   echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     844  echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    805845  exit ;;
    806846    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    807   FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    808   FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    809   FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
     847  FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
     848  FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
     849  FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
    810850  echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    811851  exit ;;
    812852    5000:UNIX_System_V:4.*:*)
    813   FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    814   FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     853  FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
     854  FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
    815855  echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    816856  exit ;;
    817857    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    818   echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
     858  echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
    819859  exit ;;
    820860    sparc*:BSD/OS:*:*)
    821   echo sparc-unknown-bsdi${UNAME_RELEASE}
     861  echo sparc-unknown-bsdi"$UNAME_RELEASE"
    822862  exit ;;
    823863    *:BSD/OS:*:*)
    824   echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
     864  echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
     865  exit ;;
     866    arm:FreeBSD:*:*)
     867  UNAME_PROCESSOR=$(uname -p)
     868  set_cc_for_build
     869  if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
     870      | grep -q __ARM_PCS_VFP
     871  then
     872      echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
     873  else
     874      echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
     875  fi
    825876  exit ;;
    826877    *:FreeBSD:*:*)
    827   UNAME_PROCESSOR=`/usr/bin/uname -p`
    828   case ${UNAME_PROCESSOR} in
     878  UNAME_PROCESSOR=$(/usr/bin/uname -p)
     879  case $UNAME_PROCESSOR in
    829880      amd64)
    830     echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
    831       *)
    832     echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     881    UNAME_PROCESSOR=x86_64 ;;
     882      i386)
     883    UNAME_PROCESSOR=i586 ;;
    833884  esac
     885  echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
    834886  exit ;;
    835887    i*:CYGWIN*:*)
    836   echo ${UNAME_MACHINE}-pc-cygwin
     888  echo "$UNAME_MACHINE"-pc-cygwin
    837889  exit ;;
    838890    *:MINGW64*:*)
    839   echo ${UNAME_MACHINE}-pc-mingw64
     891  echo "$UNAME_MACHINE"-pc-mingw64
    840892  exit ;;
    841893    *:MINGW*:*)
    842   echo ${UNAME_MACHINE}-pc-mingw32
     894  echo "$UNAME_MACHINE"-pc-mingw32
    843895  exit ;;
    844896    *:MSYS*:*)
    845   echo ${UNAME_MACHINE}-pc-msys
    846   exit ;;
    847     i*:windows32*:*)
    848   # uname -m includes "-pc" on this system.
    849   echo ${UNAME_MACHINE}-mingw32
     897  echo "$UNAME_MACHINE"-pc-msys
    850898  exit ;;
    851899    i*:PW*:*)
    852   echo ${UNAME_MACHINE}-pc-pw32
     900  echo "$UNAME_MACHINE"-pc-pw32
    853901  exit ;;
    854902    *:Interix*:*)
    855   case ${UNAME_MACHINE} in
     903  case $UNAME_MACHINE in
    856904      x86)
    857     echo i586-pc-interix${UNAME_RELEASE}
     905    echo i586-pc-interix"$UNAME_RELEASE"
    858906    exit ;;
    859907      authenticamd | genuineintel | EM64T)
    860     echo x86_64-unknown-interix${UNAME_RELEASE}
     908    echo x86_64-unknown-interix"$UNAME_RELEASE"
    861909    exit ;;
    862910      IA64)
    863     echo ia64-unknown-interix${UNAME_RELEASE}
     911    echo ia64-unknown-interix"$UNAME_RELEASE"
    864912    exit ;;
    865913  esac ;;
    866     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    867   echo i${UNAME_MACHINE}-pc-mks
    868   exit ;;
    869     8664:Windows_NT:*)
    870   echo x86_64-pc-mks
    871   exit ;;
    872     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    873   # How do we know it's Interix rather than the generic POSIX subsystem?
    874   # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
    875   # UNAME_MACHINE based on the output of uname instead of i386?
    876   echo i586-pc-interix
    877   exit ;;
    878914    i*:UWIN*:*)
    879   echo ${UNAME_MACHINE}-pc-uwin
     915  echo "$UNAME_MACHINE"-pc-uwin
    880916  exit ;;
    881917    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
    882   echo x86_64-unknown-cygwin
    883   exit ;;
    884     p*:CYGWIN*:*)
    885   echo powerpcle-unknown-cygwin
     918  echo x86_64-pc-cygwin
    886919  exit ;;
    887920    prep*:SunOS:5.*:*)
    888   echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     921  echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
    889922  exit ;;
    890923    *:GNU:*:*)
    891924  # the GNU system
    892   echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     925  echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
    893926  exit ;;
    894927    *:GNU/*:*:*)
    895928  # other systems with GNU libc and userland
    896   echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
    897   exit ;;
    898     i*86:Minix:*:*)
    899   echo ${UNAME_MACHINE}-pc-minix
     929  echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
     930  exit ;;
     931    *:Minix:*:*)
     932  echo "$UNAME_MACHINE"-unknown-minix
    900933  exit ;;
    901934    aarch64:Linux:*:*)
    902   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     935  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    903936  exit ;;
    904937    aarch64_be:Linux:*:*)
    905938  UNAME_MACHINE=aarch64_be
    906   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     939  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    907940  exit ;;
    908941    alpha:Linux:*:*)
    909   case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
     942  case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
    910943    EV5)   UNAME_MACHINE=alphaev5 ;;
    911944    EV56)  UNAME_MACHINE=alphaev56 ;;
     
    917950  esac
    918951  objdump --private-headers /bin/sh | grep -q ld.so.1
    919   if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
    920   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    921   exit ;;
    922     arc:Linux:*:* | arceb:Linux:*:*)
    923   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     952  if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
     953  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     954  exit ;;
     955    arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*)
     956  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    924957  exit ;;
    925958    arm*:Linux:*:*)
    926   eval $set_cc_for_build
     959  set_cc_for_build
    927960  if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
    928961      | grep -q __ARM_EABI__
    929962  then
    930       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     963      echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    931964  else
    932965      if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
    933966    | grep -q __ARM_PCS_VFP
    934967      then
    935     echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
     968    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
    936969      else
    937     echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
     970    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
    938971      fi
    939972  fi
    940973  exit ;;
    941974    avr32*:Linux:*:*)
    942   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     975  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    943976  exit ;;
    944977    cris:Linux:*:*)
    945   echo ${UNAME_MACHINE}-axis-linux-${LIBC}
     978  echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
    946979  exit ;;
    947980    crisv32:Linux:*:*)
    948   echo ${UNAME_MACHINE}-axis-linux-${LIBC}
     981  echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
    949982  exit ;;
    950983    e2k:Linux:*:*)
    951   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     984  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    952985  exit ;;
    953986    frv:Linux:*:*)
    954   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     987  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    955988  exit ;;
    956989    hexagon:Linux:*:*)
    957   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     990  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    958991  exit ;;
    959992    i*86:Linux:*:*)
    960   echo ${UNAME_MACHINE}-pc-linux-${LIBC}
     993  echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
    961994  exit ;;
    962995    ia64:Linux:*:*)
    963   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     996  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     997  exit ;;
     998    k1om:Linux:*:*)
     999  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     1000  exit ;;
     1001    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
     1002  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    9641003  exit ;;
    9651004    m32r*:Linux:*:*)
    966   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1005  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    9671006  exit ;;
    9681007    m68*:Linux:*:*)
    969   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1008  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    9701009  exit ;;
    9711010    mips:Linux:*:* | mips64:Linux:*:*)
    972   eval $set_cc_for_build
    973   sed 's/^  //' << EOF >$dummy.c
     1011  set_cc_for_build
     1012  IS_GLIBC=0
     1013  test x"${LIBC}" = xgnu && IS_GLIBC=1
     1014  sed 's/^  //' << EOF > "$dummy.c"
    9741015  #undef CPU
    975   #undef ${UNAME_MACHINE}
    976   #undef ${UNAME_MACHINE}el
     1016  #undef mips
     1017  #undef mipsel
     1018  #undef mips64
     1019  #undef mips64el
     1020  #if ${IS_GLIBC} && defined(_ABI64)
     1021  LIBCABI=gnuabi64
     1022  #else
     1023  #if ${IS_GLIBC} && defined(_ABIN32)
     1024  LIBCABI=gnuabin32
     1025  #else
     1026  LIBCABI=${LIBC}
     1027  #endif
     1028  #endif
     1029
     1030  #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
     1031  CPU=mipsisa64r6
     1032  #else
     1033  #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
     1034  CPU=mipsisa32r6
     1035  #else
     1036  #if defined(__mips64)
     1037  CPU=mips64
     1038  #else
     1039  CPU=mips
     1040  #endif
     1041  #endif
     1042  #endif
     1043
    9771044  #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
    978   CPU=${UNAME_MACHINE}el
     1045  MIPS_ENDIAN=el
    9791046  #else
    9801047  #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
    981   CPU=${UNAME_MACHINE}
     1048  MIPS_ENDIAN=
    9821049  #else
    983   CPU=
     1050  MIPS_ENDIAN=
    9841051  #endif
    9851052  #endif
    9861053EOF
    987   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
    988   test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
     1054  eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
     1055  test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
    9891056  ;;
     1057    mips64el:Linux:*:*)
     1058  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     1059  exit ;;
    9901060    openrisc*:Linux:*:*)
    991   echo or1k-unknown-linux-${LIBC}
     1061  echo or1k-unknown-linux-"$LIBC"
    9921062  exit ;;
    9931063    or32:Linux:*:* | or1k*:Linux:*:*)
    994   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1064  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    9951065  exit ;;
    9961066    padre:Linux:*:*)
    997   echo sparc-unknown-linux-${LIBC}
     1067  echo sparc-unknown-linux-"$LIBC"
    9981068  exit ;;
    9991069    parisc64:Linux:*:* | hppa64:Linux:*:*)
    1000   echo hppa64-unknown-linux-${LIBC}
     1070  echo hppa64-unknown-linux-"$LIBC"
    10011071  exit ;;
    10021072    parisc:Linux:*:* | hppa:Linux:*:*)
    10031073  # Look for CPU level
    1004   case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    1005     PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
    1006     PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
    1007     *)    echo hppa-unknown-linux-${LIBC} ;;
     1074  case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
     1075    PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
     1076    PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
     1077    *)    echo hppa-unknown-linux-"$LIBC" ;;
    10081078  esac
    10091079  exit ;;
    10101080    ppc64:Linux:*:*)
    1011   echo powerpc64-unknown-linux-${LIBC}
     1081  echo powerpc64-unknown-linux-"$LIBC"
    10121082  exit ;;
    10131083    ppc:Linux:*:*)
    1014   echo powerpc-unknown-linux-${LIBC}
     1084  echo powerpc-unknown-linux-"$LIBC"
    10151085  exit ;;
    10161086    ppc64le:Linux:*:*)
    1017   echo powerpc64le-unknown-linux-${LIBC}
     1087  echo powerpc64le-unknown-linux-"$LIBC"
    10181088  exit ;;
    10191089    ppcle:Linux:*:*)
    1020   echo powerpcle-unknown-linux-${LIBC}
     1090  echo powerpcle-unknown-linux-"$LIBC"
     1091  exit ;;
     1092    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
     1093  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10211094  exit ;;
    10221095    s390:Linux:*:* | s390x:Linux:*:*)
    1023   echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
     1096  echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
    10241097  exit ;;
    10251098    sh64*:Linux:*:*)
    1026   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1099  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10271100  exit ;;
    10281101    sh*:Linux:*:*)
    1029   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1102  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10301103  exit ;;
    10311104    sparc:Linux:*:* | sparc64:Linux:*:*)
    1032   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1105  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10331106  exit ;;
    10341107    tile*:Linux:*:*)
    1035   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1108  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10361109  exit ;;
    10371110    vax:Linux:*:*)
    1038   echo ${UNAME_MACHINE}-dec-linux-${LIBC}
     1111  echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
    10391112  exit ;;
    10401113    x86_64:Linux:*:*)
    1041   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1114  set_cc_for_build
     1115  LIBCABI=$LIBC
     1116  if test "$CC_FOR_BUILD" != no_compiler_found; then
     1117      if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
     1118    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
     1119    grep IS_X32 >/dev/null
     1120      then
     1121    LIBCABI="$LIBC"x32
     1122      fi
     1123  fi
     1124  echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
    10421125  exit ;;
    10431126    xtensa*:Linux:*:*)
    1044   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     1127  echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    10451128  exit ;;
    10461129    i*86:DYNIX/ptx:4*:*)
     
    10561139  # I just have to hope.  -- rms.
    10571140  # Use sysv4.2uw... so that sysv4* matches it.
    1058   echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
     1141  echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
    10591142  exit ;;
    10601143    i*86:OS/2:*:*)
    10611144  # If we were able to find `uname', then EMX Unix compatibility
    10621145  # is probably installed.
    1063   echo ${UNAME_MACHINE}-pc-os2-emx
     1146  echo "$UNAME_MACHINE"-pc-os2-emx
    10641147  exit ;;
    10651148    i*86:XTS-300:*:STOP)
    1066   echo ${UNAME_MACHINE}-unknown-stop
     1149  echo "$UNAME_MACHINE"-unknown-stop
    10671150  exit ;;
    10681151    i*86:atheos:*:*)
    1069   echo ${UNAME_MACHINE}-unknown-atheos
     1152  echo "$UNAME_MACHINE"-unknown-atheos
    10701153  exit ;;
    10711154    i*86:syllable:*:*)
    1072   echo ${UNAME_MACHINE}-pc-syllable
     1155  echo "$UNAME_MACHINE"-pc-syllable
    10731156  exit ;;
    10741157    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
    1075   echo i386-unknown-lynxos${UNAME_RELEASE}
     1158  echo i386-unknown-lynxos"$UNAME_RELEASE"
    10761159  exit ;;
    10771160    i*86:*DOS:*:*)
    1078   echo ${UNAME_MACHINE}-pc-msdosdjgpp
    1079   exit ;;
    1080     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
    1081   UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
     1161  echo "$UNAME_MACHINE"-pc-msdosdjgpp
     1162  exit ;;
     1163    i*86:*:4.*:*)
     1164  UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
    10821165  if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
    1083     echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
     1166    echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
    10841167  else
    1085     echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
     1168    echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
    10861169  fi
    10871170  exit ;;
    10881171    i*86:*:5:[678]*)
    10891172  # UnixWare 7.x, OpenUNIX and OpenServer 6.
    1090   case `/bin/uname -X | grep "^Machine"` in
     1173  case $(/bin/uname -X | grep "^Machine") in
    10911174      *486*)       UNAME_MACHINE=i486 ;;
    10921175      *Pentium)      UNAME_MACHINE=i586 ;;
    10931176      *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
    10941177  esac
    1095   echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
     1178  echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
    10961179  exit ;;
    10971180    i*86:*:3.2:*)
    10981181  if test -f /usr/options/cb.name; then
    1099     UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
    1100     echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
     1182    UNAME_REL=$(sed -n 's/.*Version //p' </usr/options/cb.name)
     1183    echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
    11011184  elif /bin/uname -X 2>/dev/null >/dev/null ; then
    1102     UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
     1185    UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
    11031186    (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
    11041187    (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
     
    11081191    (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
    11091192      && UNAME_MACHINE=i686
    1110     echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
     1193    echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
    11111194  else
    1112     echo ${UNAME_MACHINE}-pc-sysv32
     1195    echo "$UNAME_MACHINE"-pc-sysv32
    11131196  fi
    11141197  exit ;;
     
    11181201  # the processor, so we play safe by assuming i586.
    11191202  # Note: whatever this is, it MUST be the same as what config.sub
    1120   # prints for the "djgpp" host, or else GDB configury will decide that
     1203  # prints for the "djgpp" host, or else GDB configure will decide that
    11211204  # this is a cross-build.
    11221205  echo i586-pc-msdosdjgpp
     
    11301213    i860:*:4.*:*) # i860-SVR4
    11311214  if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
    1132     echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
     1215    echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
    11331216  else # Add other i860-SVR4 vendors below as they are discovered.
    1134     echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
     1217    echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
    11351218  fi
    11361219  exit ;;
     
    11501233  OS_REL=''
    11511234  test -r /etc/.relid \
    1152   && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
     1235  && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
    11531236  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1154     && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1237    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
    11551238  /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1156     && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1239    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
    11571240    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    11581241  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     
    11611244  OS_REL='.3'
    11621245  test -r /etc/.relid \
    1163       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
     1246      && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
    11641247  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1165       && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1248      && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
    11661249  /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1167       && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
     1250      && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
    11681251  /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
    1169       && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1252      && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
    11701253    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    1171   echo m68k-unknown-lynxos${UNAME_RELEASE}
     1254  echo m68k-unknown-lynxos"$UNAME_RELEASE"
    11721255  exit ;;
    11731256    mc68030:UNIX_System_V:4.*:*)
     
    11751258  exit ;;
    11761259    TSUNAMI:LynxOS:2.*:*)
    1177   echo sparc-unknown-lynxos${UNAME_RELEASE}
     1260  echo sparc-unknown-lynxos"$UNAME_RELEASE"
    11781261  exit ;;
    11791262    rs6000:LynxOS:2.*:*)
    1180   echo rs6000-unknown-lynxos${UNAME_RELEASE}
     1263  echo rs6000-unknown-lynxos"$UNAME_RELEASE"
    11811264  exit ;;
    11821265    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
    1183   echo powerpc-unknown-lynxos${UNAME_RELEASE}
     1266  echo powerpc-unknown-lynxos"$UNAME_RELEASE"
    11841267  exit ;;
    11851268    SM[BE]S:UNIX_SV:*:*)
    1186   echo mips-dde-sysv${UNAME_RELEASE}
     1269  echo mips-dde-sysv"$UNAME_RELEASE"
    11871270  exit ;;
    11881271    RM*:ReliantUNIX-*:*:*)
     
    11941277    *:SINIX-*:*:*)
    11951278  if uname -p 2>/dev/null >/dev/null ; then
    1196     UNAME_MACHINE=`(uname -p) 2>/dev/null`
    1197     echo ${UNAME_MACHINE}-sni-sysv4
     1279    UNAME_MACHINE=$( (uname -p) 2>/dev/null)
     1280    echo "$UNAME_MACHINE"-sni-sysv4
    11981281  else
    11991282    echo ns32k-sni-sysv
     
    12151298    i*86:VOS:*:*)
    12161299  # From Paul.Green@stratus.com.
    1217   echo ${UNAME_MACHINE}-stratus-vos
     1300  echo "$UNAME_MACHINE"-stratus-vos
    12181301  exit ;;
    12191302    *:VOS:*:*)
     
    12221305  exit ;;
    12231306    mc68*:A/UX:*:*)
    1224   echo m68k-apple-aux${UNAME_RELEASE}
     1307  echo m68k-apple-aux"$UNAME_RELEASE"
    12251308  exit ;;
    12261309    news*:NEWS-OS:6*:*)
     
    12281311  exit ;;
    12291312    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    1230   if [ -d /usr/nec ]; then
    1231     echo mips-nec-sysv${UNAME_RELEASE}
     1313  if test -d /usr/nec; then
     1314    echo mips-nec-sysv"$UNAME_RELEASE"
    12321315  else
    1233     echo mips-unknown-sysv${UNAME_RELEASE}
     1316    echo mips-unknown-sysv"$UNAME_RELEASE"
    12341317  fi
    12351318  exit ;;
     
    12501333  exit ;;
    12511334    SX-4:SUPER-UX:*:*)
    1252   echo sx4-nec-superux${UNAME_RELEASE}
     1335  echo sx4-nec-superux"$UNAME_RELEASE"
    12531336  exit ;;
    12541337    SX-5:SUPER-UX:*:*)
    1255   echo sx5-nec-superux${UNAME_RELEASE}
     1338  echo sx5-nec-superux"$UNAME_RELEASE"
    12561339  exit ;;
    12571340    SX-6:SUPER-UX:*:*)
    1258   echo sx6-nec-superux${UNAME_RELEASE}
     1341  echo sx6-nec-superux"$UNAME_RELEASE"
    12591342  exit ;;
    12601343    SX-7:SUPER-UX:*:*)
    1261   echo sx7-nec-superux${UNAME_RELEASE}
     1344  echo sx7-nec-superux"$UNAME_RELEASE"
    12621345  exit ;;
    12631346    SX-8:SUPER-UX:*:*)
    1264   echo sx8-nec-superux${UNAME_RELEASE}
     1347  echo sx8-nec-superux"$UNAME_RELEASE"
    12651348  exit ;;
    12661349    SX-8R:SUPER-UX:*:*)
    1267   echo sx8r-nec-superux${UNAME_RELEASE}
     1350  echo sx8r-nec-superux"$UNAME_RELEASE"
     1351  exit ;;
     1352    SX-ACE:SUPER-UX:*:*)
     1353  echo sxace-nec-superux"$UNAME_RELEASE"
    12681354  exit ;;
    12691355    Power*:Rhapsody:*:*)
    1270   echo powerpc-apple-rhapsody${UNAME_RELEASE}
     1356  echo powerpc-apple-rhapsody"$UNAME_RELEASE"
    12711357  exit ;;
    12721358    *:Rhapsody:*:*)
    1273   echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
     1359  echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
     1360  exit ;;
     1361    arm64:Darwin:*:*)
     1362  echo aarch64-apple-darwin"$UNAME_RELEASE"
    12741363  exit ;;
    12751364    *:Darwin:*:*)
    1276   UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    1277   eval $set_cc_for_build
    1278   if test "$UNAME_PROCESSOR" = unknown ; then
    1279       UNAME_PROCESSOR=powerpc
    1280   fi
    1281   if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
    1282       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
    1283     if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    1284         (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    1285         grep IS_64BIT_ARCH >/dev/null
    1286     then
    1287         case $UNAME_PROCESSOR in
    1288       i386) UNAME_PROCESSOR=x86_64 ;;
    1289       powerpc) UNAME_PROCESSOR=powerpc64 ;;
    1290         esac
    1291     fi
     1365  UNAME_PROCESSOR=$(uname -p)
     1366  case $UNAME_PROCESSOR in
     1367      unknown) UNAME_PROCESSOR=powerpc ;;
     1368  esac
     1369  if command -v xcode-select > /dev/null 2> /dev/null && \
     1370    ! xcode-select --print-path > /dev/null 2> /dev/null ; then
     1371      # Avoid executing cc if there is no toolchain installed as
     1372      # cc will be a stub that puts up a graphical alert
     1373      # prompting the user to install developer tools.
     1374      CC_FOR_BUILD=no_compiler_found
     1375  else
     1376      set_cc_for_build
     1377  fi
     1378  if test "$CC_FOR_BUILD" != no_compiler_found; then
     1379      if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
     1380       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
     1381       grep IS_64BIT_ARCH >/dev/null
     1382      then
     1383    case $UNAME_PROCESSOR in
     1384        i386) UNAME_PROCESSOR=x86_64 ;;
     1385        powerpc) UNAME_PROCESSOR=powerpc64 ;;
     1386    esac
     1387      fi
     1388      # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
     1389      if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
     1390       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
     1391       grep IS_PPC >/dev/null
     1392      then
     1393    UNAME_PROCESSOR=powerpc
    12921394      fi
    12931395  elif test "$UNAME_PROCESSOR" = i386 ; then
    1294       # Avoid executing cc on OS X 10.9, as it ships with a stub
    1295       # that puts up a graphical alert prompting to install
    1296       # developer tools.  Any system running Mac OS X 10.7 or
    1297       # later (Darwin 11 and later) is required to have a 64-bit
    1298       # processor. This is not true of the ARM version of Darwin
    1299       # that Apple uses in portable devices.
    1300       UNAME_PROCESSOR=x86_64
    1301   fi
    1302   echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     1396      # uname -m returns i386 or x86_64
     1397      UNAME_PROCESSOR=$UNAME_MACHINE
     1398  fi
     1399  echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
    13031400  exit ;;
    13041401    *:procnto*:*:* | *:QNX:[0123456789]*:*)
    1305   UNAME_PROCESSOR=`uname -p`
    1306   if test "$UNAME_PROCESSOR" = "x86"; then
     1402  UNAME_PROCESSOR=$(uname -p)
     1403  if test "$UNAME_PROCESSOR" = x86; then
    13071404    UNAME_PROCESSOR=i386
    13081405    UNAME_MACHINE=pc
    13091406  fi
    1310   echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
     1407  echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
    13111408  exit ;;
    13121409    *:QNX:*:4*)
    13131410  echo i386-pc-qnx
    13141411  exit ;;
    1315     NEO-?:NONSTOP_KERNEL:*:*)
    1316   echo neo-tandem-nsk${UNAME_RELEASE}
     1412    NEO-*:NONSTOP_KERNEL:*:*)
     1413  echo neo-tandem-nsk"$UNAME_RELEASE"
    13171414  exit ;;
    13181415    NSE-*:NONSTOP_KERNEL:*:*)
    1319   echo nse-tandem-nsk${UNAME_RELEASE}
    1320   exit ;;
    1321     NSR-?:NONSTOP_KERNEL:*:*)
    1322   echo nsr-tandem-nsk${UNAME_RELEASE}
     1416  echo nse-tandem-nsk"$UNAME_RELEASE"
     1417  exit ;;
     1418    NSR-*:NONSTOP_KERNEL:*:*)
     1419  echo nsr-tandem-nsk"$UNAME_RELEASE"
     1420  exit ;;
     1421    NSV-*:NONSTOP_KERNEL:*:*)
     1422  echo nsv-tandem-nsk"$UNAME_RELEASE"
     1423  exit ;;
     1424    NSX-*:NONSTOP_KERNEL:*:*)
     1425  echo nsx-tandem-nsk"$UNAME_RELEASE"
    13231426  exit ;;
    13241427    *:NonStop-UX:*:*)
     
    13291432  exit ;;
    13301433    DS/*:UNIX_System_V:*:*)
    1331   echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
     1434  echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
    13321435  exit ;;
    13331436    *:Plan9:*:*)
     
    13351438  # is converted to i386 for consistency with other x86
    13361439  # operating systems.
    1337   if test "$cputype" = "386"; then
     1440  if test "${cputype-}" = 386; then
    13381441      UNAME_MACHINE=i386
    1339   else
     1442  elif test "x${cputype-}" != x; then
    13401443      UNAME_MACHINE="$cputype"
    13411444  fi
    1342   echo ${UNAME_MACHINE}-unknown-plan9
     1445  echo "$UNAME_MACHINE"-unknown-plan9
    13431446  exit ;;
    13441447    *:TOPS-10:*:*)
     
    13611464  exit ;;
    13621465    SEI:*:*:SEIUX)
    1363   echo mips-sei-seiux${UNAME_RELEASE}
     1466  echo mips-sei-seiux"$UNAME_RELEASE"
    13641467  exit ;;
    13651468    *:DragonFly:*:*)
    1366   echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     1469  echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
    13671470  exit ;;
    13681471    *:*VMS:*:*)
    1369   UNAME_MACHINE=`(uname -p) 2>/dev/null`
    1370   case "${UNAME_MACHINE}" in
     1472  UNAME_MACHINE=$( (uname -p) 2>/dev/null)
     1473  case $UNAME_MACHINE in
    13711474      A*) echo alpha-dec-vms ; exit ;;
    13721475      I*) echo ia64-dec-vms ; exit ;;
     
    13771480  exit ;;
    13781481    i*86:skyos:*:*)
    1379   echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
     1482  echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
    13801483  exit ;;
    13811484    i*86:rdos:*:*)
    1382   echo ${UNAME_MACHINE}-pc-rdos
    1383   exit ;;
    1384     i*86:AROS:*:*)
    1385   echo ${UNAME_MACHINE}-pc-aros
     1485  echo "$UNAME_MACHINE"-pc-rdos
     1486  exit ;;
     1487    *:AROS:*:*)
     1488  echo "$UNAME_MACHINE"-unknown-aros
    13861489  exit ;;
    13871490    x86_64:VMkernel:*:*)
    1388   echo ${UNAME_MACHINE}-unknown-esx
     1491  echo "$UNAME_MACHINE"-unknown-esx
     1492  exit ;;
     1493    amd64:Isilon\ OneFS:*:*)
     1494  echo x86_64-unknown-onefs
     1495  exit ;;
     1496    *:Unleashed:*:*)
     1497  echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
    13891498  exit ;;
    13901499esac
    13911500
     1501# No uname command or uname output not recognized.
     1502set_cc_for_build
     1503cat > "$dummy.c" <<EOF
     1504#ifdef _SEQUENT_
     1505#include <sys/types.h>
     1506#include <sys/utsname.h>
     1507#endif
     1508#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
     1509#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
     1510#include <signal.h>
     1511#if defined(_SIZE_T_) || defined(SIGLOST)
     1512#include <sys/utsname.h>
     1513#endif
     1514#endif
     1515#endif
     1516main ()
     1517{
     1518#if defined (sony)
     1519#if defined (MIPSEB)
     1520  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
     1521     I don't know....  */
     1522  printf ("mips-sony-bsd\n"); exit (0);
     1523#else
     1524#include <sys/param.h>
     1525  printf ("m68k-sony-newsos%s\n",
     1526#ifdef NEWSOS4
     1527  "4"
     1528#else
     1529  ""
     1530#endif
     1531  ); exit (0);
     1532#endif
     1533#endif
     1534
     1535#if defined (NeXT)
     1536#if !defined (__ARCHITECTURE__)
     1537#define __ARCHITECTURE__ "m68k"
     1538#endif
     1539  int version;
     1540  version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
     1541  if (version < 4)
     1542    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
     1543  else
     1544    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
     1545  exit (0);
     1546#endif
     1547
     1548#if defined (MULTIMAX) || defined (n16)
     1549#if defined (UMAXV)
     1550  printf ("ns32k-encore-sysv\n"); exit (0);
     1551#else
     1552#if defined (CMU)
     1553  printf ("ns32k-encore-mach\n"); exit (0);
     1554#else
     1555  printf ("ns32k-encore-bsd\n"); exit (0);
     1556#endif
     1557#endif
     1558#endif
     1559
     1560#if defined (__386BSD__)
     1561  printf ("i386-pc-bsd\n"); exit (0);
     1562#endif
     1563
     1564#if defined (sequent)
     1565#if defined (i386)
     1566  printf ("i386-sequent-dynix\n"); exit (0);
     1567#endif
     1568#if defined (ns32000)
     1569  printf ("ns32k-sequent-dynix\n"); exit (0);
     1570#endif
     1571#endif
     1572
     1573#if defined (_SEQUENT_)
     1574  struct utsname un;
     1575
     1576  uname(&un);
     1577  if (strncmp(un.version, "V2", 2) == 0) {
     1578    printf ("i386-sequent-ptx2\n"); exit (0);
     1579  }
     1580  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
     1581    printf ("i386-sequent-ptx1\n"); exit (0);
     1582  }
     1583  printf ("i386-sequent-ptx\n"); exit (0);
     1584#endif
     1585
     1586#if defined (vax)
     1587#if !defined (ultrix)
     1588#include <sys/param.h>
     1589#if defined (BSD)
     1590#if BSD == 43
     1591  printf ("vax-dec-bsd4.3\n"); exit (0);
     1592#else
     1593#if BSD == 199006
     1594  printf ("vax-dec-bsd4.3reno\n"); exit (0);
     1595#else
     1596  printf ("vax-dec-bsd\n"); exit (0);
     1597#endif
     1598#endif
     1599#else
     1600  printf ("vax-dec-bsd\n"); exit (0);
     1601#endif
     1602#else
     1603#if defined(_SIZE_T_) || defined(SIGLOST)
     1604  struct utsname un;
     1605  uname (&un);
     1606  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
     1607#else
     1608  printf ("vax-dec-ultrix\n"); exit (0);
     1609#endif
     1610#endif
     1611#endif
     1612#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
     1613#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
     1614#if defined(_SIZE_T_) || defined(SIGLOST)
     1615  struct utsname *un;
     1616  uname (&un);
     1617  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
     1618#else
     1619  printf ("mips-dec-ultrix\n"); exit (0);
     1620#endif
     1621#endif
     1622#endif
     1623
     1624#if defined (alliant) && defined (i860)
     1625  printf ("i860-alliant-bsd\n"); exit (0);
     1626#endif
     1627
     1628  exit (1);
     1629}
     1630EOF
     1631
     1632$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
     1633  { echo "$SYSTEM_NAME"; exit; }
     1634
     1635# Apollos put the system type in the environment.
     1636test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
     1637
     1638echo "$0: unable to guess system type" >&2
     1639
     1640case $UNAME_MACHINE:$UNAME_SYSTEM in
     1641    mips:Linux | mips64:Linux)
     1642  # If we got here on MIPS GNU/Linux, output extra information.
     1643  cat >&2 <<EOF
     1644
     1645NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
     1646the system type. Please install a C compiler and try again.
     1647EOF
     1648  ;;
     1649esac
     1650
    13921651cat >&2 <<EOF
    1393 $0: unable to guess system type
    1394 
    1395 This script, last modified $timestamp, has failed to recognize
    1396 the operating system you are using. It is advised that you
    1397 download the most up to date version of the config scripts from
    1398 
    1399   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     1652
     1653This script (version $timestamp), has failed to recognize the
     1654operating system you are using. If your script is old, overwrite *all*
     1655copies of config.guess and config.sub with the latest versions from:
     1656
     1657  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
    14001658and
    1401   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    1402 
    1403 If the version you run ($0) is already up to date, please
    1404 send the following data and any information you think might be
    1405 pertinent to <config-patches@gnu.org> in order to provide the needed
    1406 information to handle your system.
     1659  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
     1660EOF
     1661
     1662year=$(echo $timestamp | sed 's,-.*,,')
     1663# shellcheck disable=SC2003
     1664if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
     1665   cat >&2 <<EOF
     1666
     1667If $0 has already been updated, send the following data and any
     1668information you think might be pertinent to config-patches@gnu.org to
     1669provide the necessary information to handle your system.
    14071670
    14081671config.guess timestamp = $timestamp
    14091672
    1410 uname -m = `(uname -m) 2>/dev/null || echo unknown`
    1411 uname -r = `(uname -r) 2>/dev/null || echo unknown`
    1412 uname -s = `(uname -s) 2>/dev/null || echo unknown`
    1413 uname -v = `(uname -v) 2>/dev/null || echo unknown`
    1414 
    1415 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
    1416 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
    1417 
    1418 hostinfo               = `(hostinfo) 2>/dev/null`
    1419 /bin/universe          = `(/bin/universe) 2>/dev/null`
    1420 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
    1421 /bin/arch              = `(/bin/arch) 2>/dev/null`
    1422 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
    1423 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
    1424 
    1425 UNAME_MACHINE = ${UNAME_MACHINE}
    1426 UNAME_RELEASE = ${UNAME_RELEASE}
    1427 UNAME_SYSTEM  = ${UNAME_SYSTEM}
    1428 UNAME_VERSION = ${UNAME_VERSION}
     1673uname -m = $( (uname -m) 2>/dev/null || echo unknown)
     1674uname -r = $( (uname -r) 2>/dev/null || echo unknown)
     1675uname -s = $( (uname -s) 2>/dev/null || echo unknown)
     1676uname -v = $( (uname -v) 2>/dev/null || echo unknown)
     1677
     1678/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
     1679/bin/uname -X     = $( (/bin/uname -X) 2>/dev/null)
     1680
     1681hostinfo               = $( (hostinfo) 2>/dev/null)
     1682/bin/universe          = $( (/bin/universe) 2>/dev/null)
     1683/usr/bin/arch -k       = $( (/usr/bin/arch -k) 2>/dev/null)
     1684/bin/arch              = $( (/bin/arch) 2>/dev/null)
     1685/usr/bin/oslevel       = $( (/usr/bin/oslevel) 2>/dev/null)
     1686/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
     1687
     1688UNAME_MACHINE = "$UNAME_MACHINE"
     1689UNAME_RELEASE = "$UNAME_RELEASE"
     1690UNAME_SYSTEM  = "$UNAME_SYSTEM"
     1691UNAME_VERSION = "$UNAME_VERSION"
    14291692EOF
     1693fi
    14301694
    14311695exit 1
    14321696
    14331697# Local variables:
    1434 # eval: (add-hook 'write-file-hooks 'time-stamp)
     1698# eval: (add-hook 'before-save-hook 'time-stamp)
    14351699# time-stamp-start: "timestamp='"
    14361700# time-stamp-format: "%:y-%02m-%02d"
  • common/config.sub

    rb66fa07 r270b3aa  
    11#! /bin/sh
    22# Configuration validation subroutine script.
    3 #   Copyright 1992-2015 Free Software Foundation, Inc.
    4 
    5 timestamp='2015-03-08'
     3#   Copyright 1992-2021 Free Software Foundation, Inc.
     4
     5timestamp='2021-04-30'
    66
    77# This file is free software; you can redistribute it and/or modify it
     
    1616#
    1717# 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/>.
    1919#
    2020# As a special exception to the GNU General Public License, if you
     
    3434
    3535# 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/cgit/config.git/plain/config.sub
    3737
    3838# This file is supposed to be the same for all GNU packages
     
    5151# It is wrong to echo any other type of specification.
    5252
    53 me=`echo "$0" | sed -e 's,.*/,,'`
     53me=$(echo "$0" | sed -e 's,.*/,,')
    5454
    5555usage="\
    56 Usage: $0 [OPTION] CPU-MFR-OPSYS
    57        $0 [OPTION] ALIAS
     56Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
    5857
    5958Canonicalize a configuration name.
    6059
    61 Operation modes:
     60Options:
    6261  -h, --help         print this help, then exit
    6362  -t, --time-stamp   print date of last modification, then exit
     
    6968GNU config.sub ($timestamp)
    7069
    71 Copyright 1992-2015 Free Software Foundation, Inc.
     70Copyright 1992-2021 Free Software Foundation, Inc.
    7271
    7372This is free software; see the source for copying conditions.  There is NO
     
    9190       break ;;
    9291    -* )
    93        echo "$me: invalid option $1$help"
     92       echo "$me: invalid option $1$help" >&2
    9493       exit 1 ;;
    9594
    9695    *local*)
    9796       # First pass through any local machine types.
    98        echo $1
     97       echo "$1"
    9998       exit ;;
    10099
     
    112111esac
    113112
    114 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
    115 # Here we must recognize all the valid KERNEL-OS combinations.
    116 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    117 case $maybe_os in
    118   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
    119   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
    120   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
    121   kopensolaris*-gnu* | \
    122   storm-chaos* | os2-emx* | rtmk-nova*)
    123     os=-$maybe_os
    124     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    125     ;;
    126   android-linux)
    127     os=-linux-android
    128     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
    129     ;;
    130   *)
    131     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
    132     if [ $basic_machine != $1 ]
    133     then os=`echo $1 | sed 's/.*-/-/'`
    134     else os=; fi
    135     ;;
     113# Split fields of configuration type
     114# shellcheck disable=SC2162
     115IFS="-" read field1 field2 field3 field4 <<EOF
     116$1
     117EOF
     118
     119# Separate into logical components for further validation
     120case $1 in
     121  *-*-*-*-*)
     122    echo Invalid configuration \`"$1"\': more than four components >&2
     123    exit 1
     124    ;;
     125  *-*-*-*)
     126    basic_machine=$field1-$field2
     127    basic_os=$field3-$field4
     128    ;;
     129  *-*-*)
     130    # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
     131    # parts
     132    maybe_os=$field2-$field3
     133    case $maybe_os in
     134      nto-qnx* | linux-* | uclinux-uclibc* \
     135      | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
     136      | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
     137      | storm-chaos* | os2-emx* | rtmk-nova*)
     138        basic_machine=$field1
     139        basic_os=$maybe_os
     140        ;;
     141      android-linux)
     142        basic_machine=$field1-unknown
     143        basic_os=linux-android
     144        ;;
     145      *)
     146        basic_machine=$field1-$field2
     147        basic_os=$field3
     148        ;;
     149    esac
     150    ;;
     151  *-*)
     152    # A lone config we happen to match not fitting any pattern
     153    case $field1-$field2 in
     154      decstation-3100)
     155        basic_machine=mips-dec
     156        basic_os=
     157        ;;
     158      *-*)
     159        # Second component is usually, but not always the OS
     160        case $field2 in
     161          # Prevent following clause from handling this valid os
     162          sun*os*)
     163            basic_machine=$field1
     164            basic_os=$field2
     165            ;;
     166          # Manufacturers
     167          dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
     168          | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
     169          | unicom* | ibm* | next | hp | isi* | apollo | altos* \
     170          | convergent* | ncr* | news | 32* | 3600* | 3100* \
     171          | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
     172          | ultra | tti* | harris | dolphin | highlevel | gould \
     173          | cbm | ns | masscomp | apple | axis | knuth | cray \
     174          | microblaze* | sim | cisco \
     175          | oki | wec | wrs | winbond)
     176            basic_machine=$field1-$field2
     177            basic_os=
     178            ;;
     179          *)
     180            basic_machine=$field1
     181            basic_os=$field2
     182            ;;
     183        esac
     184      ;;
     185    esac
     186    ;;
     187  *)
     188    # Convert single-component short-hands not valid as part of
     189    # multi-component configurations.
     190    case $field1 in
     191      386bsd)
     192        basic_machine=i386-pc
     193        basic_os=bsd
     194        ;;
     195      a29khif)
     196        basic_machine=a29k-amd
     197        basic_os=udi
     198        ;;
     199      adobe68k)
     200        basic_machine=m68010-adobe
     201        basic_os=scout
     202        ;;
     203      alliant)
     204        basic_machine=fx80-alliant
     205        basic_os=
     206        ;;
     207      altos | altos3068)
     208        basic_machine=m68k-altos
     209        basic_os=
     210        ;;
     211      am29k)
     212        basic_machine=a29k-none
     213        basic_os=bsd
     214        ;;
     215      amdahl)
     216        basic_machine=580-amdahl
     217        basic_os=sysv
     218        ;;
     219      amiga)
     220        basic_machine=m68k-unknown
     221        basic_os=
     222        ;;
     223      amigaos | amigados)
     224        basic_machine=m68k-unknown
     225        basic_os=amigaos
     226        ;;
     227      amigaunix | amix)
     228        basic_machine=m68k-unknown
     229        basic_os=sysv4
     230        ;;
     231      apollo68)
     232        basic_machine=m68k-apollo
     233        basic_os=sysv
     234        ;;
     235      apollo68bsd)
     236        basic_machine=m68k-apollo
     237        basic_os=bsd
     238        ;;
     239      aros)
     240        basic_machine=i386-pc
     241        basic_os=aros
     242        ;;
     243      aux)
     244        basic_machine=m68k-apple
     245        basic_os=aux
     246        ;;
     247      balance)
     248        basic_machine=ns32k-sequent
     249        basic_os=dynix
     250        ;;
     251      blackfin)
     252        basic_machine=bfin-unknown
     253        basic_os=linux
     254        ;;
     255      cegcc)
     256        basic_machine=arm-unknown
     257        basic_os=cegcc
     258        ;;
     259      convex-c1)
     260        basic_machine=c1-convex
     261        basic_os=bsd
     262        ;;
     263      convex-c2)
     264        basic_machine=c2-convex
     265        basic_os=bsd
     266        ;;
     267      convex-c32)
     268        basic_machine=c32-convex
     269        basic_os=bsd
     270        ;;
     271      convex-c34)
     272        basic_machine=c34-convex
     273        basic_os=bsd
     274        ;;
     275      convex-c38)
     276        basic_machine=c38-convex
     277        basic_os=bsd
     278        ;;
     279      cray)
     280        basic_machine=j90-cray
     281        basic_os=unicos
     282        ;;
     283      crds | unos)
     284        basic_machine=m68k-crds
     285        basic_os=
     286        ;;
     287      da30)
     288        basic_machine=m68k-da30
     289        basic_os=
     290        ;;
     291      decstation | pmax | pmin | dec3100 | decstatn)
     292        basic_machine=mips-dec
     293        basic_os=
     294        ;;
     295      delta88)
     296        basic_machine=m88k-motorola
     297        basic_os=sysv3
     298        ;;
     299      dicos)
     300        basic_machine=i686-pc
     301        basic_os=dicos
     302        ;;
     303      djgpp)
     304        basic_machine=i586-pc
     305        basic_os=msdosdjgpp
     306        ;;
     307      ebmon29k)
     308        basic_machine=a29k-amd
     309        basic_os=ebmon
     310        ;;
     311      es1800 | OSE68k | ose68k | ose | OSE)
     312        basic_machine=m68k-ericsson
     313        basic_os=ose
     314        ;;
     315      gmicro)
     316        basic_machine=tron-gmicro
     317        basic_os=sysv
     318        ;;
     319      go32)
     320        basic_machine=i386-pc
     321        basic_os=go32
     322        ;;
     323      h8300hms)
     324        basic_machine=h8300-hitachi
     325        basic_os=hms
     326        ;;
     327      h8300xray)
     328        basic_machine=h8300-hitachi
     329        basic_os=xray
     330        ;;
     331      h8500hms)
     332        basic_machine=h8500-hitachi
     333        basic_os=hms
     334        ;;
     335      harris)
     336        basic_machine=m88k-harris
     337        basic_os=sysv3
     338        ;;
     339      hp300 | hp300hpux)
     340        basic_machine=m68k-hp
     341        basic_os=hpux
     342        ;;
     343      hp300bsd)
     344        basic_machine=m68k-hp
     345        basic_os=bsd
     346        ;;
     347      hppaosf)
     348        basic_machine=hppa1.1-hp
     349        basic_os=osf
     350        ;;
     351      hppro)
     352        basic_machine=hppa1.1-hp
     353        basic_os=proelf
     354        ;;
     355      i386mach)
     356        basic_machine=i386-mach
     357        basic_os=mach
     358        ;;
     359      isi68 | isi)
     360        basic_machine=m68k-isi
     361        basic_os=sysv
     362        ;;
     363      m68knommu)
     364        basic_machine=m68k-unknown
     365        basic_os=linux
     366        ;;
     367      magnum | m3230)
     368        basic_machine=mips-mips
     369        basic_os=sysv
     370        ;;
     371      merlin)
     372        basic_machine=ns32k-utek
     373        basic_os=sysv
     374        ;;
     375      mingw64)
     376        basic_machine=x86_64-pc
     377        basic_os=mingw64
     378        ;;
     379      mingw32)
     380        basic_machine=i686-pc
     381        basic_os=mingw32
     382        ;;
     383      mingw32ce)
     384        basic_machine=arm-unknown
     385        basic_os=mingw32ce
     386        ;;
     387      monitor)
     388        basic_machine=m68k-rom68k
     389        basic_os=coff
     390        ;;
     391      morphos)
     392        basic_machine=powerpc-unknown
     393        basic_os=morphos
     394        ;;
     395      moxiebox)
     396        basic_machine=moxie-unknown
     397        basic_os=moxiebox
     398        ;;
     399      msdos)
     400        basic_machine=i386-pc
     401        basic_os=msdos
     402        ;;
     403      msys)
     404        basic_machine=i686-pc
     405        basic_os=msys
     406        ;;
     407      mvs)
     408        basic_machine=i370-ibm
     409        basic_os=mvs
     410        ;;
     411      nacl)
     412        basic_machine=le32-unknown
     413        basic_os=nacl
     414        ;;
     415      ncr3000)
     416        basic_machine=i486-ncr
     417        basic_os=sysv4
     418        ;;
     419      netbsd386)
     420        basic_machine=i386-pc
     421        basic_os=netbsd
     422        ;;
     423      netwinder)
     424        basic_machine=armv4l-rebel
     425        basic_os=linux
     426        ;;
     427      news | news700 | news800 | news900)
     428        basic_machine=m68k-sony
     429        basic_os=newsos
     430        ;;
     431      news1000)
     432        basic_machine=m68030-sony
     433        basic_os=newsos
     434        ;;
     435      necv70)
     436        basic_machine=v70-nec
     437        basic_os=sysv
     438        ;;
     439      nh3000)
     440        basic_machine=m68k-harris
     441        basic_os=cxux
     442        ;;
     443      nh[45]000)
     444        basic_machine=m88k-harris
     445        basic_os=cxux
     446        ;;
     447      nindy960)
     448        basic_machine=i960-intel
     449        basic_os=nindy
     450        ;;
     451      mon960)
     452        basic_machine=i960-intel
     453        basic_os=mon960
     454        ;;
     455      nonstopux)
     456        basic_machine=mips-compaq
     457        basic_os=nonstopux
     458        ;;
     459      os400)
     460        basic_machine=powerpc-ibm
     461        basic_os=os400
     462        ;;
     463      OSE68000 | ose68000)
     464        basic_machine=m68000-ericsson
     465        basic_os=ose
     466        ;;
     467      os68k)
     468        basic_machine=m68k-none
     469        basic_os=os68k
     470        ;;
     471      paragon)
     472        basic_machine=i860-intel
     473        basic_os=osf
     474        ;;
     475      parisc)
     476        basic_machine=hppa-unknown
     477        basic_os=linux
     478        ;;
     479      psp)
     480        basic_machine=mipsallegrexel-sony
     481        basic_os=psp
     482        ;;
     483      pw32)
     484        basic_machine=i586-unknown
     485        basic_os=pw32
     486        ;;
     487      rdos | rdos64)
     488        basic_machine=x86_64-pc
     489        basic_os=rdos
     490        ;;
     491      rdos32)
     492        basic_machine=i386-pc
     493        basic_os=rdos
     494        ;;
     495      rom68k)
     496        basic_machine=m68k-rom68k
     497        basic_os=coff
     498        ;;
     499      sa29200)
     500        basic_machine=a29k-amd
     501        basic_os=udi
     502        ;;
     503      sei)
     504        basic_machine=mips-sei
     505        basic_os=seiux
     506        ;;
     507      sequent)
     508        basic_machine=i386-sequent
     509        basic_os=
     510        ;;
     511      sps7)
     512        basic_machine=m68k-bull
     513        basic_os=sysv2
     514        ;;
     515      st2000)
     516        basic_machine=m68k-tandem
     517        basic_os=
     518        ;;
     519      stratus)
     520        basic_machine=i860-stratus
     521        basic_os=sysv4
     522        ;;
     523      sun2)
     524        basic_machine=m68000-sun
     525        basic_os=
     526        ;;
     527      sun2os3)
     528        basic_machine=m68000-sun
     529        basic_os=sunos3
     530        ;;
     531      sun2os4)
     532        basic_machine=m68000-sun
     533        basic_os=sunos4
     534        ;;
     535      sun3)
     536        basic_machine=m68k-sun
     537        basic_os=
     538        ;;
     539      sun3os3)
     540        basic_machine=m68k-sun
     541        basic_os=sunos3
     542        ;;
     543      sun3os4)
     544        basic_machine=m68k-sun
     545        basic_os=sunos4
     546        ;;
     547      sun4)
     548        basic_machine=sparc-sun
     549        basic_os=
     550        ;;
     551      sun4os3)
     552        basic_machine=sparc-sun
     553        basic_os=sunos3
     554        ;;
     555      sun4os4)
     556        basic_machine=sparc-sun
     557        basic_os=sunos4
     558        ;;
     559      sun4sol2)
     560        basic_machine=sparc-sun
     561        basic_os=solaris2
     562        ;;
     563      sun386 | sun386i | roadrunner)
     564        basic_machine=i386-sun
     565        basic_os=
     566        ;;
     567      sv1)
     568        basic_machine=sv1-cray
     569        basic_os=unicos
     570        ;;
     571      symmetry)
     572        basic_machine=i386-sequent
     573        basic_os=dynix
     574        ;;
     575      t3e)
     576        basic_machine=alphaev5-cray
     577        basic_os=unicos
     578        ;;
     579      t90)
     580        basic_machine=t90-cray
     581        basic_os=unicos
     582        ;;
     583      toad1)
     584        basic_machine=pdp10-xkl
     585        basic_os=tops20
     586        ;;
     587      tpf)
     588        basic_machine=s390x-ibm
     589        basic_os=tpf
     590        ;;
     591      udi29k)
     592        basic_machine=a29k-amd
     593        basic_os=udi
     594        ;;
     595      ultra3)
     596        basic_machine=a29k-nyu
     597        basic_os=sym1
     598        ;;
     599      v810 | necv810)
     600        basic_machine=v810-nec
     601        basic_os=none
     602        ;;
     603      vaxv)
     604        basic_machine=vax-dec
     605        basic_os=sysv
     606        ;;
     607      vms)
     608        basic_machine=vax-dec
     609        basic_os=vms
     610        ;;
     611      vsta)
     612        basic_machine=i386-pc
     613        basic_os=vsta
     614        ;;
     615      vxworks960)
     616        basic_machine=i960-wrs
     617        basic_os=vxworks
     618        ;;
     619      vxworks68)
     620        basic_machine=m68k-wrs
     621        basic_os=vxworks
     622        ;;
     623      vxworks29k)
     624        basic_machine=a29k-wrs
     625        basic_os=vxworks
     626        ;;
     627      xbox)
     628        basic_machine=i686-pc
     629        basic_os=mingw32
     630        ;;
     631      ymp)
     632        basic_machine=ymp-cray
     633        basic_os=unicos
     634        ;;
     635      *)
     636        basic_machine=$1
     637        basic_os=
     638        ;;
     639    esac
     640    ;;
    136641esac
    137642
    138 ### Let's recognize common machines as not being operating systems so
    139 ### that things like config.sub decstation-3100 work.  We also
    140 ### recognize some manufacturers as not being operating systems, so we
    141 ### can provide default operating systems below.
    142 case $os in
    143   -sun*os*)
    144     # Prevent following clause from handling this invalid input.
    145     ;;
    146   -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
    147   -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
    148   -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
    149   -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
    150   -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    151   -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    152   -apple | -axis | -knuth | -cray | -microblaze*)
    153     os=
    154     basic_machine=$1
    155     ;;
    156   -bluegene*)
    157     os=-cnk
    158     ;;
    159   -sim | -cisco | -oki | -wec | -winbond)
    160     os=
    161     basic_machine=$1
    162     ;;
    163   -scout)
    164     ;;
    165   -wrs)
    166     os=-vxworks
    167     basic_machine=$1
    168     ;;
    169   -chorusos*)
    170     os=-chorusos
    171     basic_machine=$1
    172     ;;
    173   -chorusrdb)
    174     os=-chorusrdb
    175     basic_machine=$1
    176     ;;
    177   -hiux*)
    178     os=-hiuxwe2
    179     ;;
    180   -sco6)
    181     os=-sco5v6
    182     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    183     ;;
    184   -sco5)
    185     os=-sco3.2v5
    186     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    187     ;;
    188   -sco4)
    189     os=-sco3.2v4
    190     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    191     ;;
    192   -sco3.2.[4-9]*)
    193     os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
    194     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    195     ;;
    196   -sco3.2v[4-9]*)
    197     # Don't forget version if it is 3.2v4 or newer.
    198     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    199     ;;
    200   -sco5v6*)
    201     # Don't forget version if it is 3.2v4 or newer.
    202     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    203     ;;
    204   -sco*)
    205     os=-sco3.2v2
    206     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    207     ;;
    208   -udk*)
    209     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    210     ;;
    211   -isc)
    212     os=-isc2.2
    213     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    214     ;;
    215   -clix*)
    216     basic_machine=clipper-intergraph
    217     ;;
    218   -isc*)
    219     basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
    220     ;;
    221   -lynx*178)
    222     os=-lynxos178
    223     ;;
    224   -lynx*5)
    225     os=-lynxos5
    226     ;;
    227   -lynx*)
    228     os=-lynxos
    229     ;;
    230   -ptx*)
    231     basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
    232     ;;
    233   -windowsnt*)
    234     os=`echo $os | sed -e 's/windowsnt/winnt/'`
    235     ;;
    236   -psos*)
    237     os=-psos
    238     ;;
    239   -mint | -mint[0-9]*)
    240     basic_machine=m68k-atari
    241     os=-mint
    242     ;;
    243 esac
    244 
    245 # Decode aliases for certain CPU-COMPANY combinations.
     643# Decode 1-component or ad-hoc basic machines
    246644case $basic_machine in
    247   # Recognize the basic CPU types without company name.
    248   # Some are omitted here because they have special meanings below.
    249   1750a | 580 \
    250   | a29k \
    251   | aarch64 | aarch64_be \
    252   | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
    253   | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    254   | am33_2.0 \
    255   | arc | arceb \
    256   | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
    257   | avr | avr32 \
    258   | be32 | be64 \
    259   | bfin \
    260   | c4x | c8051 | clipper \
    261   | d10v | d30v | dlx | dsp16xx \
    262   | e2k | epiphany \
    263   | fido | fr30 | frv | ft32 \
    264   | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
    265   | hexagon \
    266   | i370 | i860 | i960 | ia64 \
    267   | ip2k | iq2000 \
    268   | k1om \
    269   | le32 | le64 \
    270   | lm32 \
    271   | m32c | m32r | m32rle | m68000 | m68k | m88k \
    272   | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
    273   | mips | mipsbe | mipseb | mipsel | mipsle \
    274   | mips16 \
    275   | mips64 | mips64el \
    276   | mips64octeon | mips64octeonel \
    277   | mips64orion | mips64orionel \
    278   | mips64r5900 | mips64r5900el \
    279   | mips64vr | mips64vrel \
    280   | mips64vr4100 | mips64vr4100el \
    281   | mips64vr4300 | mips64vr4300el \
    282   | mips64vr5000 | mips64vr5000el \
    283   | mips64vr5900 | mips64vr5900el \
    284   | mipsisa32 | mipsisa32el \
    285   | mipsisa32r2 | mipsisa32r2el \
    286   | mipsisa32r6 | mipsisa32r6el \
    287   | mipsisa64 | mipsisa64el \
    288   | mipsisa64r2 | mipsisa64r2el \
    289   | mipsisa64r6 | mipsisa64r6el \
    290   | mipsisa64sb1 | mipsisa64sb1el \
    291   | mipsisa64sr71k | mipsisa64sr71kel \
    292   | mipsr5900 | mipsr5900el \
    293   | mipstx39 | mipstx39el \
    294   | mn10200 | mn10300 \
    295   | moxie \
    296   | mt \
    297   | msp430 \
    298   | nds32 | nds32le | nds32be \
    299   | nios | nios2 | nios2eb | nios2el \
    300   | ns16k | ns32k \
    301   | open8 | or1k | or1knd | or32 \
    302   | pdp10 | pdp11 | pj | pjl \
    303   | powerpc | powerpc64 | powerpc64le | powerpcle \
    304   | pyramid \
    305   | riscv32 | riscv64 \
    306   | rl78 | rx \
    307   | score \
    308   | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
    309   | sh64 | sh64le \
    310   | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
    311   | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
    312   | spu \
    313   | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
    314   | ubicom32 \
    315   | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
    316   | visium \
    317   | we32k \
    318   | x86 | xc16x | xstormy16 | xtensa \
    319   | z8k | z80)
    320     basic_machine=$basic_machine-unknown
    321     ;;
    322   c54x)
    323     basic_machine=tic54x-unknown
    324     ;;
    325   c55x)
    326     basic_machine=tic55x-unknown
    327     ;;
    328   c6x)
    329     basic_machine=tic6x-unknown
     645  # Here we handle the default manufacturer of certain CPU types.  It is in
     646  # some cases the only manufacturer, in others, it is the most popular.
     647  w89k)
     648    cpu=hppa1.1
     649    vendor=winbond
     650    ;;
     651  op50n)
     652    cpu=hppa1.1
     653    vendor=oki
     654    ;;
     655  op60c)
     656    cpu=hppa1.1
     657    vendor=oki
     658    ;;
     659  ibm*)
     660    cpu=i370
     661    vendor=ibm
     662    ;;
     663  orion105)
     664    cpu=clipper
     665    vendor=highlevel
     666    ;;
     667  mac | mpw | mac-mpw)
     668    cpu=m68k
     669    vendor=apple
     670    ;;
     671  pmac | pmac-mpw)
     672    cpu=powerpc
     673    vendor=apple
     674    ;;
     675
     676  # Recognize the various machine names and aliases which stand
     677  # for a CPU type and a company and sometimes even an OS.
     678  3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
     679    cpu=m68000
     680    vendor=att
     681    ;;
     682  3b*)
     683    cpu=we32k
     684    vendor=att
     685    ;;
     686  bluegene*)
     687    cpu=powerpc
     688    vendor=ibm
     689    basic_os=cnk
     690    ;;
     691  decsystem10* | dec10*)
     692    cpu=pdp10
     693    vendor=dec
     694    basic_os=tops10
     695    ;;
     696  decsystem20* | dec20*)
     697    cpu=pdp10
     698    vendor=dec
     699    basic_os=tops20
     700    ;;
     701  delta | 3300 | motorola-3300 | motorola-delta \
     702        | 3300-motorola | delta-motorola)
     703    cpu=m68k
     704    vendor=motorola
     705    ;;
     706  dpx2*)
     707    cpu=m68k
     708    vendor=bull
     709    basic_os=sysv3
     710    ;;
     711  encore | umax | mmax)
     712    cpu=ns32k
     713    vendor=encore
     714    ;;
     715  elxsi)
     716    cpu=elxsi
     717    vendor=elxsi
     718    basic_os=${basic_os:-bsd}
     719    ;;
     720  fx2800)
     721    cpu=i860
     722    vendor=alliant
     723    ;;
     724  genix)
     725    cpu=ns32k
     726    vendor=ns
     727    ;;
     728  h3050r* | hiux*)
     729    cpu=hppa1.1
     730    vendor=hitachi
     731    basic_os=hiuxwe2
     732    ;;
     733  hp3k9[0-9][0-9] | hp9[0-9][0-9])
     734    cpu=hppa1.0
     735    vendor=hp
     736    ;;
     737  hp9k2[0-9][0-9] | hp9k31[0-9])
     738    cpu=m68000
     739    vendor=hp
     740    ;;
     741  hp9k3[2-9][0-9])
     742    cpu=m68k
     743    vendor=hp
     744    ;;
     745  hp9k6[0-9][0-9] | hp6[0-9][0-9])
     746    cpu=hppa1.0
     747    vendor=hp
     748    ;;
     749  hp9k7[0-79][0-9] | hp7[0-79][0-9])
     750    cpu=hppa1.1
     751    vendor=hp
     752    ;;
     753  hp9k78[0-9] | hp78[0-9])
     754    # FIXME: really hppa2.0-hp
     755    cpu=hppa1.1
     756    vendor=hp
     757    ;;
     758  hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
     759    # FIXME: really hppa2.0-hp
     760    cpu=hppa1.1
     761    vendor=hp
     762    ;;
     763  hp9k8[0-9][13679] | hp8[0-9][13679])
     764    cpu=hppa1.1
     765    vendor=hp
     766    ;;
     767  hp9k8[0-9][0-9] | hp8[0-9][0-9])
     768    cpu=hppa1.0
     769    vendor=hp
     770    ;;
     771  i*86v32)
     772    cpu=$(echo "$1" | sed -e 's/86.*/86/')
     773    vendor=pc
     774    basic_os=sysv32
     775    ;;
     776  i*86v4*)
     777    cpu=$(echo "$1" | sed -e 's/86.*/86/')
     778    vendor=pc
     779    basic_os=sysv4
     780    ;;
     781  i*86v)
     782    cpu=$(echo "$1" | sed -e 's/86.*/86/')
     783    vendor=pc
     784    basic_os=sysv
     785    ;;
     786  i*86sol2)
     787    cpu=$(echo "$1" | sed -e 's/86.*/86/')
     788    vendor=pc
     789    basic_os=solaris2
     790    ;;
     791  j90 | j90-cray)
     792    cpu=j90
     793    vendor=cray
     794    basic_os=${basic_os:-unicos}
     795    ;;
     796  iris | iris4d)
     797    cpu=mips
     798    vendor=sgi
     799    case $basic_os in
     800        irix*)
     801      ;;
     802        *)
     803      basic_os=irix4
     804      ;;
     805    esac
     806    ;;
     807  miniframe)
     808    cpu=m68000
     809    vendor=convergent
     810    ;;
     811  *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
     812    cpu=m68k
     813    vendor=atari
     814    basic_os=mint
     815    ;;
     816  news-3600 | risc-news)
     817    cpu=mips
     818    vendor=sony
     819    basic_os=newsos
     820    ;;
     821  next | m*-next)
     822    cpu=m68k
     823    vendor=next
     824    case $basic_os in
     825        openstep*)
     826            ;;
     827        nextstep*)
     828      ;;
     829        ns2*)
     830          basic_os=nextstep2
     831      ;;
     832        *)
     833          basic_os=nextstep3
     834      ;;
     835    esac
     836    ;;
     837  np1)
     838    cpu=np1
     839    vendor=gould
     840    ;;
     841  op50n-* | op60c-*)
     842    cpu=hppa1.1
     843    vendor=oki
     844    basic_os=proelf
     845    ;;
     846  pa-hitachi)
     847    cpu=hppa1.1
     848    vendor=hitachi
     849    basic_os=hiuxwe2
     850    ;;
     851  pbd)
     852    cpu=sparc
     853    vendor=tti
     854    ;;
     855  pbb)
     856    cpu=m68k
     857    vendor=tti
     858    ;;
     859  pc532)
     860    cpu=ns32k
     861    vendor=pc532
     862    ;;
     863  pn)
     864    cpu=pn
     865    vendor=gould
     866    ;;
     867  power)
     868    cpu=power
     869    vendor=ibm
     870    ;;
     871  ps2)
     872    cpu=i386
     873    vendor=ibm
     874    ;;
     875  rm[46]00)
     876    cpu=mips
     877    vendor=siemens
     878    ;;
     879  rtpc | rtpc-*)
     880    cpu=romp
     881    vendor=ibm
     882    ;;
     883  sde)
     884    cpu=mipsisa32
     885    vendor=sde
     886    basic_os=${basic_os:-elf}
     887    ;;
     888  simso-wrs)
     889    cpu=sparclite
     890    vendor=wrs
     891    basic_os=vxworks
     892    ;;
     893  tower | tower-32)
     894    cpu=m68k
     895    vendor=ncr
     896    ;;
     897  vpp*|vx|vx-*)
     898    cpu=f301
     899    vendor=fujitsu
     900    ;;
     901  w65)
     902    cpu=w65
     903    vendor=wdc
     904    ;;
     905  w89k-*)
     906    cpu=hppa1.1
     907    vendor=winbond
     908    basic_os=proelf
     909    ;;
     910  none)
     911    cpu=none
     912    vendor=none
    330913    ;;
    331914  leon|leon[3-9])
    332     basic_machine=sparc-$basic_machine
    333     ;;
    334   m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
    335     basic_machine=$basic_machine-unknown
    336     os=-none
    337     ;;
    338   m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
    339     ;;
    340   ms1)
    341     basic_machine=mt-unknown
    342     ;;
    343 
    344   strongarm | thumb | xscale)
    345     basic_machine=arm-unknown
    346     ;;
    347   xgate)
    348     basic_machine=$basic_machine-unknown
    349     os=-none
    350     ;;
    351   xscaleeb)
    352     basic_machine=armeb-unknown
    353     ;;
    354 
    355   xscaleel)
    356     basic_machine=armel-unknown
    357     ;;
    358 
     915    cpu=sparc
     916    vendor=$basic_machine
     917    ;;
     918  leon-*|leon[3-9]-*)
     919    cpu=sparc
     920    vendor=$(echo "$basic_machine" | sed 's/-.*//')
     921    ;;
     922
     923  *-*)
     924    # shellcheck disable=SC2162
     925    IFS="-" read cpu vendor <<EOF
     926$basic_machine
     927EOF
     928    ;;
    359929  # We use `pc' rather than `unknown'
    360930  # because (1) that's what they normally are, and
    361931  # (2) the word "unknown" tends to confuse beginning users.
    362932  i*86 | x86_64)
    363     basic_machine=$basic_machine-pc
    364     ;;
    365   # Object if more than one company name word.
    366   *-*-*)
    367     echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
    368     exit 1
    369     ;;
    370   # Recognize the basic CPU types with company name.
    371   580-* \
    372   | a29k-* \
    373   | aarch64-* | aarch64_be-* \
    374   | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
    375   | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
    376   | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
    377   | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    378   | avr-* | avr32-* \
    379   | be32-* | be64-* \
    380   | bfin-* | bs2000-* \
    381   | c[123]* | c30-* | [cjt]90-* | c4x-* \
    382   | c8051-* | clipper-* | craynv-* | cydra-* \
    383   | d10v-* | d30v-* | dlx-* \
    384   | e2k-* | elxsi-* \
    385   | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
    386   | h8300-* | h8500-* \
    387   | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
    388   | hexagon-* \
    389   | i*86-* | i860-* | i960-* | ia64-* \
    390   | ip2k-* | iq2000-* \
    391   | k1om-* \
    392   | le32-* | le64-* \
    393   | lm32-* \
    394   | m32c-* | m32r-* | m32rle-* \
    395   | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
    396   | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
    397   | microblaze-* | microblazeel-* \
    398   | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
    399   | mips16-* \
    400   | mips64-* | mips64el-* \
    401   | mips64octeon-* | mips64octeonel-* \
    402   | mips64orion-* | mips64orionel-* \
    403   | mips64r5900-* | mips64r5900el-* \
    404   | mips64vr-* | mips64vrel-* \
    405   | mips64vr4100-* | mips64vr4100el-* \
    406   | mips64vr4300-* | mips64vr4300el-* \
    407   | mips64vr5000-* | mips64vr5000el-* \
    408   | mips64vr5900-* | mips64vr5900el-* \
    409   | mipsisa32-* | mipsisa32el-* \
    410   | mipsisa32r2-* | mipsisa32r2el-* \
    411   | mipsisa32r6-* | mipsisa32r6el-* \
    412   | mipsisa64-* | mipsisa64el-* \
    413   | mipsisa64r2-* | mipsisa64r2el-* \
    414   | mipsisa64r6-* | mipsisa64r6el-* \
    415   | mipsisa64sb1-* | mipsisa64sb1el-* \
    416   | mipsisa64sr71k-* | mipsisa64sr71kel-* \
    417   | mipsr5900-* | mipsr5900el-* \
    418   | mipstx39-* | mipstx39el-* \
    419   | mmix-* \
    420   | mt-* \
    421   | msp430-* \
    422   | nds32-* | nds32le-* | nds32be-* \
    423   | nios-* | nios2-* | nios2eb-* | nios2el-* \
    424   | none-* | np1-* | ns16k-* | ns32k-* \
    425   | open8-* \
    426   | or1k*-* \
    427   | orion-* \
    428   | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
    429   | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
    430   | pyramid-* \
    431   | rl78-* | romp-* | rs6000-* | rx-* \
    432   | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
    433   | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    434   | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
    435   | sparclite-* \
    436   | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
    437   | tahoe-* \
    438   | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
    439   | tile*-* \
    440   | tron-* \
    441   | ubicom32-* \
    442   | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
    443   | vax-* \
    444   | visium-* \
    445   | we32k-* \
    446   | x86-* | x86_64-* | xc16x-* | xps100-* \
    447   | xstormy16-* | xtensa*-* \
    448   | ymp-* \
    449   | z8k-* | z80-*)
    450     ;;
    451   # Recognize the basic CPU types without company name, with glob match.
    452   xtensa*)
    453     basic_machine=$basic_machine-unknown
    454     ;;
    455   # Recognize the various machine names and aliases which stand
    456   # for a CPU type and a company and sometimes even an OS.
     933    cpu=$basic_machine
     934    vendor=pc
     935    ;;
     936  # These rules are duplicated from below for sake of the special case above;
     937  # i.e. things that normalized to x86 arches should also default to "pc"
     938  pc98)
     939    cpu=i386
     940    vendor=pc
     941    ;;
     942  x64 | amd64)
     943    cpu=x86_64
     944    vendor=pc
     945    ;;
     946  # Recognize the basic CPU types without company name.
     947  *)
     948    cpu=$basic_machine
     949    vendor=unknown
     950    ;;
     951esac
     952
     953unset -v basic_machine
     954
     955# Decode basic machines in the full and proper CPU-Company form.
     956case $cpu-$vendor in
     957  # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
     958  # some cases the only manufacturer, in others, it is the most popular.
     959  craynv-unknown)
     960    vendor=cray
     961    basic_os=${basic_os:-unicosmp}
     962    ;;
     963  c90-unknown | c90-cray)
     964    vendor=cray
     965    basic_os=${Basic_os:-unicos}
     966    ;;
     967  fx80-unknown)
     968    vendor=alliant
     969    ;;
     970  romp-unknown)
     971    vendor=ibm
     972    ;;
     973  mmix-unknown)
     974    vendor=knuth
     975    ;;
     976  microblaze-unknown | microblazeel-unknown)
     977    vendor=xilinx
     978    ;;
     979  rs6000-unknown)
     980    vendor=ibm
     981    ;;
     982  vax-unknown)
     983    vendor=dec
     984    ;;
     985  pdp11-unknown)
     986    vendor=dec
     987    ;;
     988  we32k-unknown)
     989    vendor=att
     990    ;;
     991  cydra-unknown)
     992    vendor=cydrome
     993    ;;
     994  i370-ibm*)
     995    vendor=ibm
     996    ;;
     997  orion-unknown)
     998    vendor=highlevel
     999    ;;
     1000  xps-unknown | xps100-unknown)
     1001    cpu=xps100
     1002    vendor=honeywell
     1003    ;;
     1004
     1005  # Here we normalize CPU types with a missing or matching vendor
     1006  dpx20-unknown | dpx20-bull)
     1007    cpu=rs6000
     1008    vendor=bull
     1009    basic_os=${basic_os:-bosx}
     1010    ;;
     1011
     1012  # Here we normalize CPU types irrespective of the vendor
     1013  amd64-*)
     1014    cpu=x86_64
     1015    ;;
     1016  blackfin-*)
     1017    cpu=bfin
     1018    basic_os=linux
     1019    ;;
     1020  c54x-*)
     1021    cpu=tic54x
     1022    ;;
     1023  c55x-*)
     1024    cpu=tic55x
     1025    ;;
     1026  c6x-*)
     1027    cpu=tic6x
     1028    ;;
     1029  e500v[12]-*)
     1030    cpu=powerpc
     1031    basic_os=${basic_os}"spe"
     1032    ;;
     1033  mips3*-*)
     1034    cpu=mips64
     1035    ;;
     1036  ms1-*)
     1037    cpu=mt
     1038    ;;
     1039  m68knommu-*)
     1040    cpu=m68k
     1041    basic_os=linux
     1042    ;;
     1043  m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
     1044    cpu=s12z
     1045    ;;
     1046  openrisc-*)
     1047    cpu=or32
     1048    ;;
     1049  parisc-*)
     1050    cpu=hppa
     1051    basic_os=linux
     1052    ;;
     1053  pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
     1054    cpu=i586
     1055    ;;
     1056  pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
     1057    cpu=i686
     1058    ;;
     1059  pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
     1060    cpu=i686
     1061    ;;
     1062  pentium4-*)
     1063    cpu=i786
     1064    ;;
     1065  pc98-*)
     1066    cpu=i386
     1067    ;;
     1068  ppc-* | ppcbe-*)
     1069    cpu=powerpc
     1070    ;;
     1071  ppcle-* | powerpclittle-*)
     1072    cpu=powerpcle
     1073    ;;
     1074  ppc64-*)
     1075    cpu=powerpc64
     1076    ;;
     1077  ppc64le-* | powerpc64little-*)
     1078    cpu=powerpc64le
     1079    ;;
     1080  sb1-*)
     1081    cpu=mipsisa64sb1
     1082    ;;
     1083  sb1el-*)
     1084    cpu=mipsisa64sb1el
     1085    ;;
     1086  sh5e[lb]-*)
     1087    cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/')
     1088    ;;
     1089  spur-*)
     1090    cpu=spur
     1091    ;;
     1092  strongarm-* | thumb-*)
     1093    cpu=arm
     1094    ;;
     1095  tx39-*)
     1096    cpu=mipstx39
     1097    ;;
     1098  tx39el-*)
     1099    cpu=mipstx39el
     1100    ;;
     1101  x64-*)
     1102    cpu=x86_64
     1103    ;;
     1104  xscale-* | xscalee[bl]-*)
     1105    cpu=$(echo "$cpu" | sed 's/^xscale/arm/')
     1106    ;;
     1107  arm64-*)
     1108    cpu=aarch64
     1109    ;;
     1110
     1111  # Recognize the canonical CPU Types that limit and/or modify the
     1112  # company names they are paired with.
     1113  cr16-*)
     1114    basic_os=${basic_os:-elf}
     1115    ;;
     1116  crisv32-* | etraxfs*-*)
     1117    cpu=crisv32
     1118    vendor=axis
     1119    ;;
     1120  cris-* | etrax*-*)
     1121    cpu=cris
     1122    vendor=axis
     1123    ;;
     1124  crx-*)
     1125    basic_os=${basic_os:-elf}
     1126    ;;
     1127  neo-tandem)
     1128    cpu=neo
     1129    vendor=tandem
     1130    ;;
     1131  nse-tandem)
     1132    cpu=nse
     1133    vendor=tandem
     1134    ;;
     1135  nsr-tandem)
     1136    cpu=nsr
     1137    vendor=tandem
     1138    ;;
     1139  nsv-tandem)
     1140    cpu=nsv
     1141    vendor=tandem
     1142    ;;
     1143  nsx-tandem)
     1144    cpu=nsx
     1145    vendor=tandem
     1146    ;;
     1147  mipsallegrexel-sony)
     1148    cpu=mipsallegrexel
     1149    vendor=sony
     1150    ;;
     1151  tile*-*)
     1152    basic_os=${basic_os:-linux-gnu}
     1153    ;;
     1154
     1155  *)
     1156    # Recognize the canonical CPU types that are allowed with any
     1157    # company name.
     1158    case $cpu in
     1159      1750a | 580 \
     1160      | a29k \
     1161      | aarch64 | aarch64_be \
     1162      | abacus \
     1163      | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
     1164      | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
     1165      | alphapca5[67] | alpha64pca5[67] \
     1166      | am33_2.0 \
     1167      | amdgcn \
     1168      | arc | arceb | arc64 \
     1169      | arm | arm[lb]e | arme[lb] | armv* \
     1170      | avr | avr32 \
     1171      | asmjs \
     1172      | ba \
     1173      | be32 | be64 \
     1174      | bfin | bpf | bs2000 \
     1175      | c[123]* | c30 | [cjt]90 | c4x \
     1176      | c8051 | clipper | craynv | csky | cydra \
     1177      | d10v | d30v | dlx | dsp16xx \
     1178      | e2k | elxsi | epiphany \
     1179      | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
     1180      | h8300 | h8500 \
     1181      | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     1182      | hexagon \
     1183      | i370 | i*86 | i860 | i960 | ia16 | ia64 \
     1184      | ip2k | iq2000 \
     1185      | k1om \
     1186      | le32 | le64 \
     1187      | lm32 \
     1188      | loongarch32 | loongarch64 | loongarchx32 \
     1189      | m32c | m32r | m32rle \
     1190      | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
     1191      | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
     1192      | m88110 | m88k | maxq | mb | mcore | mep | metag \
     1193      | microblaze | microblazeel \
     1194      | mips | mipsbe | mipseb | mipsel | mipsle \
     1195      | mips16 \
     1196      | mips64 | mips64eb | mips64el \
     1197      | mips64octeon | mips64octeonel \
     1198      | mips64orion | mips64orionel \
     1199      | mips64r5900 | mips64r5900el \
     1200      | mips64vr | mips64vrel \
     1201      | mips64vr4100 | mips64vr4100el \
     1202      | mips64vr4300 | mips64vr4300el \
     1203      | mips64vr5000 | mips64vr5000el \
     1204      | mips64vr5900 | mips64vr5900el \
     1205      | mipsisa32 | mipsisa32el \
     1206      | mipsisa32r2 | mipsisa32r2el \
     1207      | mipsisa32r3 | mipsisa32r3el \
     1208      | mipsisa32r5 | mipsisa32r5el \
     1209      | mipsisa32r6 | mipsisa32r6el \
     1210      | mipsisa64 | mipsisa64el \
     1211      | mipsisa64r2 | mipsisa64r2el \
     1212      | mipsisa64r3 | mipsisa64r3el \
     1213      | mipsisa64r5 | mipsisa64r5el \
     1214      | mipsisa64r6 | mipsisa64r6el \
     1215      | mipsisa64sb1 | mipsisa64sb1el \
     1216      | mipsisa64sr71k | mipsisa64sr71kel \
     1217      | mipsr5900 | mipsr5900el \
     1218      | mipstx39 | mipstx39el \
     1219      | mmix \
     1220      | mn10200 | mn10300 \
     1221      | moxie \
     1222      | mt \
     1223      | msp430 \
     1224      | nds32 | nds32le | nds32be \
     1225      | nfp \
     1226      | nios | nios2 | nios2eb | nios2el \
     1227      | none | np1 | ns16k | ns32k | nvptx \
     1228      | open8 \
     1229      | or1k* \
     1230      | or32 \
     1231      | orion \
     1232      | picochip \
     1233      | pdp10 | pdp11 | pj | pjl | pn | power \
     1234      | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
     1235      | pru \
     1236      | pyramid \
     1237      | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
     1238      | rl78 | romp | rs6000 | rx \
     1239      | s390 | s390x \
     1240      | score \
     1241      | sh | shl \
     1242      | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
     1243      | sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
     1244      | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
     1245      | sparclite \
     1246      | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
     1247      | spu \
     1248      | tahoe \
     1249      | thumbv7* \
     1250      | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
     1251      | tron \
     1252      | ubicom32 \
     1253      | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
     1254      | vax \
     1255      | visium \
     1256      | w65 \
     1257      | wasm32 | wasm64 \
     1258      | we32k \
     1259      | x86 | x86_64 | xc16x | xgate | xps100 \
     1260      | xstormy16 | xtensa* \
     1261      | ymp \
     1262      | z8k | z80)
     1263        ;;
     1264
     1265      *)
     1266        echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
     1267        exit 1
     1268        ;;
     1269    esac
     1270    ;;
     1271esac
     1272
     1273# Here we canonicalize certain aliases for manufacturers.
     1274case $vendor in
     1275  digital*)
     1276    vendor=dec
     1277    ;;
     1278  commodore*)
     1279    vendor=cbm
     1280    ;;
     1281  *)
     1282    ;;
     1283esac
     1284
     1285# Decode manufacturer-specific aliases for certain operating systems.
     1286
     1287if test x$basic_os != x
     1288then
     1289
     1290# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
     1291# set os.
     1292case $basic_os in
     1293  gnu/linux*)
     1294    kernel=linux
     1295    os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
     1296    ;;
     1297  os2-emx)
     1298    kernel=os2
     1299    os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
     1300    ;;
     1301  nto-qnx*)
     1302    kernel=nto
     1303    os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
     1304    ;;
     1305  *-*)
     1306    # shellcheck disable=SC2162
     1307    IFS="-" read kernel os <<EOF
     1308$basic_os
     1309EOF
     1310    ;;
     1311  # Default OS when just kernel was specified
     1312  nto*)
     1313    kernel=nto
     1314    os=$(echo $basic_os | sed -e 's|nto|qnx|')
     1315    ;;
     1316  linux*)
     1317    kernel=linux
     1318    os=$(echo $basic_os | sed -e 's|linux|gnu|')
     1319    ;;
     1320  *)
     1321    kernel=
     1322    os=$basic_os
     1323    ;;
     1324esac
     1325
     1326# Now, normalize the OS (knowing we just have one component, it's not a kernel,
     1327# etc.)
     1328case $os in
     1329  # First match some system type aliases that might get confused
     1330  # with valid system types.
     1331  # solaris* is a basic system type, with this one exception.
     1332  auroraux)
     1333    os=auroraux
     1334    ;;
     1335  bluegene*)
     1336    os=cnk
     1337    ;;
     1338  solaris1 | solaris1.*)
     1339    os=$(echo $os | sed -e 's|solaris1|sunos4|')
     1340    ;;
     1341  solaris)
     1342    os=solaris2
     1343    ;;
     1344  unixware*)
     1345    os=sysv4.2uw
     1346    ;;
     1347  # es1800 is here to avoid being matched by es* (a different OS)
     1348  es1800*)
     1349    os=ose
     1350    ;;
     1351  # Some version numbers need modification
     1352  chorusos*)
     1353    os=chorusos
     1354    ;;
     1355  isc)
     1356    os=isc2.2
     1357    ;;
     1358  sco6)
     1359    os=sco5v6
     1360    ;;
     1361  sco5)
     1362    os=sco3.2v5
     1363    ;;
     1364  sco4)
     1365    os=sco3.2v4
     1366    ;;
     1367  sco3.2.[4-9]*)
     1368    os=$(echo $os | sed -e 's/sco3.2./sco3.2v/')
     1369    ;;
     1370  sco*v* | scout)
     1371    # Don't match below
     1372    ;;
     1373  sco*)
     1374    os=sco3.2v2
     1375    ;;
     1376  psos*)
     1377    os=psos
     1378    ;;
     1379  qnx*)
     1380    os=qnx
     1381    ;;
     1382  hiux*)
     1383    os=hiuxwe2
     1384    ;;
     1385  lynx*178)
     1386    os=lynxos178
     1387    ;;
     1388  lynx*5)
     1389    os=lynxos5
     1390    ;;
     1391  lynxos*)
     1392    # don't get caught up in next wildcard
     1393    ;;
     1394  lynx*)
     1395    os=lynxos
     1396    ;;
     1397  mac[0-9]*)
     1398    os=$(echo "$os" | sed -e 's|mac|macos|')
     1399    ;;
     1400  opened*)
     1401    os=openedition
     1402    ;;
     1403  os400*)
     1404    os=os400
     1405    ;;
     1406  sunos5*)
     1407    os=$(echo "$os" | sed -e 's|sunos5|solaris2|')
     1408    ;;
     1409  sunos6*)
     1410    os=$(echo "$os" | sed -e 's|sunos6|solaris3|')
     1411    ;;
     1412  wince*)
     1413    os=wince
     1414    ;;
     1415  utek*)
     1416    os=bsd
     1417    ;;
     1418  dynix*)
     1419    os=bsd
     1420    ;;
     1421  acis*)
     1422    os=aos
     1423    ;;
     1424  atheos*)
     1425    os=atheos
     1426    ;;
     1427  syllable*)
     1428    os=syllable
     1429    ;;
    4571430  386bsd)
    458     basic_machine=i386-unknown
    459     os=-bsd
    460     ;;
    461   3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
    462     basic_machine=m68000-att
    463     ;;
    464   3b*)
    465     basic_machine=we32k-att
    466     ;;
    467   a29khif)
    468     basic_machine=a29k-amd
    469     os=-udi
    470     ;;
    471   abacus)
    472     basic_machine=abacus-unknown
    473     ;;
    474   adobe68k)
    475     basic_machine=m68010-adobe
    476     os=-scout
    477     ;;
    478   alliant | fx80)
    479     basic_machine=fx80-alliant
    480     ;;
    481   altos | altos3068)
    482     basic_machine=m68k-altos
    483     ;;
    484   am29k)
    485     basic_machine=a29k-none
    486     os=-bsd
    487     ;;
    488   amd64)
    489     basic_machine=x86_64-pc
    490     ;;
    491   amd64-*)
    492     basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
    493     ;;
    494   amdahl)
    495     basic_machine=580-amdahl
    496     os=-sysv
    497     ;;
    498   amiga | amiga-*)
    499     basic_machine=m68k-unknown
    500     ;;
    501   amigaos | amigados)
    502     basic_machine=m68k-unknown
    503     os=-amigaos
    504     ;;
    505   amigaunix | amix)
    506     basic_machine=m68k-unknown
    507     os=-sysv4
    508     ;;
    509   apollo68)
    510     basic_machine=m68k-apollo
    511     os=-sysv
    512     ;;
    513   apollo68bsd)
    514     basic_machine=m68k-apollo
    515     os=-bsd
    516     ;;
    517   aros)
    518     basic_machine=i386-pc
    519     os=-aros
    520     ;;
    521         asmjs)
    522     basic_machine=asmjs-unknown
    523     ;;
    524   aux)
    525     basic_machine=m68k-apple
    526     os=-aux
    527     ;;
    528   balance)
    529     basic_machine=ns32k-sequent
    530     os=-dynix
    531     ;;
    532   blackfin)
    533     basic_machine=bfin-unknown
    534     os=-linux
    535     ;;
    536   blackfin-*)
    537     basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
    538     os=-linux
    539     ;;
    540   bluegene*)
    541     basic_machine=powerpc-ibm
    542     os=-cnk
    543     ;;
    544   c54x-*)
    545     basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
    546     ;;
    547   c55x-*)
    548     basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
    549     ;;
    550   c6x-*)
    551     basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
    552     ;;
    553   c90)
    554     basic_machine=c90-cray
    555     os=-unicos
    556     ;;
    557   cegcc)
    558     basic_machine=arm-unknown
    559     os=-cegcc
    560     ;;
    561   convex-c1)
    562     basic_machine=c1-convex
    563     os=-bsd
    564     ;;
    565   convex-c2)
    566     basic_machine=c2-convex
    567     os=-bsd
    568     ;;
    569   convex-c32)
    570     basic_machine=c32-convex
    571     os=-bsd
    572     ;;
    573   convex-c34)
    574     basic_machine=c34-convex
    575     os=-bsd
    576     ;;
    577   convex-c38)
    578     basic_machine=c38-convex
    579     os=-bsd
    580     ;;
    581   cray | j90)
    582     basic_machine=j90-cray
    583     os=-unicos
    584     ;;
    585   craynv)
    586     basic_machine=craynv-cray
    587     os=-unicosmp
    588     ;;
    589   cr16 | cr16-*)
    590     basic_machine=cr16-unknown
    591     os=-elf
    592     ;;
    593   crds | unos)
    594     basic_machine=m68k-crds
    595     ;;
    596   crisv32 | crisv32-* | etraxfs*)
    597     basic_machine=crisv32-axis
    598     ;;
    599   cris | cris-* | etrax*)
    600     basic_machine=cris-axis
    601     ;;
    602   crx)
    603     basic_machine=crx-unknown
    604     os=-elf
    605     ;;
    606   da30 | da30-*)
    607     basic_machine=m68k-da30
    608     ;;
    609   decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
    610     basic_machine=mips-dec
    611     ;;
    612   decsystem10* | dec10*)
    613     basic_machine=pdp10-dec
    614     os=-tops10
    615     ;;
    616   decsystem20* | dec20*)
    617     basic_machine=pdp10-dec
    618     os=-tops20
    619     ;;
    620   delta | 3300 | motorola-3300 | motorola-delta \
    621         | 3300-motorola | delta-motorola)
    622     basic_machine=m68k-motorola
    623     ;;
    624   delta88)
    625     basic_machine=m88k-motorola
    626     os=-sysv3
    627     ;;
    628   dicos)
    629     basic_machine=i686-pc
    630     os=-dicos
    631     ;;
    632   djgpp)
    633     basic_machine=i586-pc
    634     os=-msdosdjgpp
    635     ;;
    636   dpx20 | dpx20-*)
    637     basic_machine=rs6000-bull
    638     os=-bosx
    639     ;;
    640   dpx2* | dpx2*-bull)
    641     basic_machine=m68k-bull
    642     os=-sysv3
    643     ;;
    644   ebmon29k)
    645     basic_machine=a29k-amd
    646     os=-ebmon
    647     ;;
    648   elxsi)
    649     basic_machine=elxsi-elxsi
    650     os=-bsd
    651     ;;
    652   encore | umax | mmax)
    653     basic_machine=ns32k-encore
    654     ;;
    655   es1800 | OSE68k | ose68k | ose | OSE)
    656     basic_machine=m68k-ericsson
    657     os=-ose
    658     ;;
    659   fx2800)
    660     basic_machine=i860-alliant
    661     ;;
    662   genix)
    663     basic_machine=ns32k-ns
    664     ;;
    665   gmicro)
    666     basic_machine=tron-gmicro
    667     os=-sysv
    668     ;;
    669   go32)
    670     basic_machine=i386-pc
    671     os=-go32
    672     ;;
    673   h3050r* | hiux*)
    674     basic_machine=hppa1.1-hitachi
    675     os=-hiuxwe2
    676     ;;
    677   h8300hms)
    678     basic_machine=h8300-hitachi
    679     os=-hms
    680     ;;
    681   h8300xray)
    682     basic_machine=h8300-hitachi
    683     os=-xray
    684     ;;
    685   h8500hms)
    686     basic_machine=h8500-hitachi
    687     os=-hms
    688     ;;
    689   harris)
    690     basic_machine=m88k-harris
    691     os=-sysv3
    692     ;;
    693   hp300-*)
    694     basic_machine=m68k-hp
    695     ;;
    696   hp300bsd)
    697     basic_machine=m68k-hp
    698     os=-bsd
    699     ;;
    700   hp300hpux)
    701     basic_machine=m68k-hp
    702     os=-hpux
    703     ;;
    704   hp3k9[0-9][0-9] | hp9[0-9][0-9])
    705     basic_machine=hppa1.0-hp
    706     ;;
    707   hp9k2[0-9][0-9] | hp9k31[0-9])
    708     basic_machine=m68000-hp
    709     ;;
    710   hp9k3[2-9][0-9])
    711     basic_machine=m68k-hp
    712     ;;
    713   hp9k6[0-9][0-9] | hp6[0-9][0-9])
    714     basic_machine=hppa1.0-hp
    715     ;;
    716   hp9k7[0-79][0-9] | hp7[0-79][0-9])
    717     basic_machine=hppa1.1-hp
    718     ;;
    719   hp9k78[0-9] | hp78[0-9])
    720     # FIXME: really hppa2.0-hp
    721     basic_machine=hppa1.1-hp
    722     ;;
    723   hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
    724     # FIXME: really hppa2.0-hp
    725     basic_machine=hppa1.1-hp
    726     ;;
    727   hp9k8[0-9][13679] | hp8[0-9][13679])
    728     basic_machine=hppa1.1-hp
    729     ;;
    730   hp9k8[0-9][0-9] | hp8[0-9][0-9])
    731     basic_machine=hppa1.0-hp
    732     ;;
    733   hppa-next)
    734     os=-nextstep3
    735     ;;
    736   hppaosf)
    737     basic_machine=hppa1.1-hp
    738     os=-osf
    739     ;;
    740   hppro)
    741     basic_machine=hppa1.1-hp
    742     os=-proelf
    743     ;;
    744   i370-ibm* | ibm*)
    745     basic_machine=i370-ibm
    746     ;;
    747   i*86v32)
    748     basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    749     os=-sysv32
    750     ;;
    751   i*86v4*)
    752     basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    753     os=-sysv4
    754     ;;
    755   i*86v)
    756     basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    757     os=-sysv
    758     ;;
    759   i*86sol2)
    760     basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
    761     os=-solaris2
    762     ;;
    763   i386mach)
    764     basic_machine=i386-mach
    765     os=-mach
    766     ;;
    767   i386-vsta | vsta)
    768     basic_machine=i386-unknown
    769     os=-vsta
    770     ;;
    771   iris | iris4d)
    772     basic_machine=mips-sgi
    773     case $os in
    774         -irix*)
     1431    os=bsd
     1432    ;;
     1433  ctix* | uts*)
     1434    os=sysv
     1435    ;;
     1436  nova*)
     1437    os=rtmk-nova
     1438    ;;
     1439  ns2)
     1440    os=nextstep2
     1441    ;;
     1442  # Preserve the version number of sinix5.
     1443  sinix5.*)
     1444    os=$(echo $os | sed -e 's|sinix|sysv|')
     1445    ;;
     1446  sinix*)
     1447    os=sysv4
     1448    ;;
     1449  tpf*)
     1450    os=tpf
     1451    ;;
     1452  triton*)
     1453    os=sysv3
     1454    ;;
     1455  oss*)
     1456    os=sysv3
     1457    ;;
     1458  svr4*)
     1459    os=sysv4
     1460    ;;
     1461  svr3)
     1462    os=sysv3
     1463    ;;
     1464  sysvr4)
     1465    os=sysv4
     1466    ;;
     1467  ose*)
     1468    os=ose
     1469    ;;
     1470  *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
     1471    os=mint
     1472    ;;
     1473  dicos*)
     1474    os=dicos
     1475    ;;
     1476  pikeos*)
     1477    # Until real need of OS specific support for
     1478    # particular features comes up, bare metal
     1479    # configurations are quite functional.
     1480    case $cpu in
     1481        arm*)
     1482      os=eabi
    7751483      ;;
    7761484        *)
    777       os=-irix4
     1485      os=elf
    7781486      ;;
    7791487    esac
    7801488    ;;
    781   isi68 | isi)
    782     basic_machine=m68k-isi
    783     os=-sysv
    784     ;;
    785   leon-*|leon[3-9]-*)
    786     basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
    787     ;;
    788   m68knommu)
    789     basic_machine=m68k-unknown
    790     os=-linux
    791     ;;
    792   m68knommu-*)
    793     basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
    794     os=-linux
    795     ;;
    796   m88k-omron*)
    797     basic_machine=m88k-omron
    798     ;;
    799   magnum | m3230)
    800     basic_machine=mips-mips
    801     os=-sysv
    802     ;;
    803   merlin)
    804     basic_machine=ns32k-utek
    805     os=-sysv
    806     ;;
    807   microblaze*)
    808     basic_machine=microblaze-xilinx
    809     ;;
    810   mingw64)
    811     basic_machine=x86_64-pc
    812     os=-mingw64
    813     ;;
    814   mingw32)
    815     basic_machine=i686-pc
    816     os=-mingw32
    817     ;;
    818   mingw32ce)
    819     basic_machine=arm-unknown
    820     os=-mingw32ce
    821     ;;
    822   miniframe)
    823     basic_machine=m68000-convergent
    824     ;;
    825   *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
    826     basic_machine=m68k-atari
    827     os=-mint
    828     ;;
    829   mips3*-*)
    830     basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
    831     ;;
    832   mips3*)
    833     basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    834     ;;
    835   monitor)
    836     basic_machine=m68k-rom68k
    837     os=-coff
    838     ;;
    839   morphos)
    840     basic_machine=powerpc-unknown
    841     os=-morphos
    842     ;;
    843   moxiebox)
    844     basic_machine=moxie-unknown
    845     os=-moxiebox
    846     ;;
    847   msdos)
    848     basic_machine=i386-pc
    849     os=-msdos
    850     ;;
    851   ms1-*)
    852     basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
    853     ;;
    854   msys)
    855     basic_machine=i686-pc
    856     os=-msys
    857     ;;
    858   mvs)
    859     basic_machine=i370-ibm
    860     os=-mvs
    861     ;;
    862   nacl)
    863     basic_machine=le32-unknown
    864     os=-nacl
    865     ;;
    866   ncr3000)
    867     basic_machine=i486-ncr
    868     os=-sysv4
    869     ;;
    870   netbsd386)
    871     basic_machine=i386-unknown
    872     os=-netbsd
    873     ;;
    874   netwinder)
    875     basic_machine=armv4l-rebel
    876     os=-linux
    877     ;;
    878   news | news700 | news800 | news900)
    879     basic_machine=m68k-sony
    880     os=-newsos
    881     ;;
    882   news1000)
    883     basic_machine=m68030-sony
    884     os=-newsos
    885     ;;
    886   news-3600 | risc-news)
    887     basic_machine=mips-sony
    888     os=-newsos
    889     ;;
    890   necv70)
    891     basic_machine=v70-nec
    892     os=-sysv
    893     ;;
    894   next | m*-next )
    895     basic_machine=m68k-next
    896     case $os in
    897         -nextstep* )
    898       ;;
    899         -ns2*)
    900           os=-nextstep2
    901       ;;
    902         *)
    903           os=-nextstep3
    904       ;;
    905     esac
    906     ;;
    907   nh3000)
    908     basic_machine=m68k-harris
    909     os=-cxux
    910     ;;
    911   nh[45]000)
    912     basic_machine=m88k-harris
    913     os=-cxux
    914     ;;
    915   nindy960)
    916     basic_machine=i960-intel
    917     os=-nindy
    918     ;;
    919   mon960)
    920     basic_machine=i960-intel
    921     os=-mon960
    922     ;;
    923   nonstopux)
    924     basic_machine=mips-compaq
    925     os=-nonstopux
    926     ;;
    927   np1)
    928     basic_machine=np1-gould
    929     ;;
    930   neo-tandem)
    931     basic_machine=neo-tandem
    932     ;;
    933   nse-tandem)
    934     basic_machine=nse-tandem
    935     ;;
    936   nsr-tandem)
    937     basic_machine=nsr-tandem
    938     ;;
    939   op50n-* | op60c-*)
    940     basic_machine=hppa1.1-oki
    941     os=-proelf
    942     ;;
    943   openrisc | openrisc-*)
    944     basic_machine=or32-unknown
    945     ;;
    946   os400)
    947     basic_machine=powerpc-ibm
    948     os=-os400
    949     ;;
    950   OSE68000 | ose68000)
    951     basic_machine=m68000-ericsson
    952     os=-ose
    953     ;;
    954   os68k)
    955     basic_machine=m68k-none
    956     os=-os68k
    957     ;;
    958   pa-hitachi)
    959     basic_machine=hppa1.1-hitachi
    960     os=-hiuxwe2
    961     ;;
    962   paragon)
    963     basic_machine=i860-intel
    964     os=-osf
    965     ;;
    966   parisc)
    967     basic_machine=hppa-unknown
    968     os=-linux
    969     ;;
    970   parisc-*)
    971     basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
    972     os=-linux
    973     ;;
    974   pbd)
    975     basic_machine=sparc-tti
    976     ;;
    977   pbb)
    978     basic_machine=m68k-tti
    979     ;;
    980   pc532 | pc532-*)
    981     basic_machine=ns32k-pc532
    982     ;;
    983   pc98)
    984     basic_machine=i386-pc
    985     ;;
    986   pc98-*)
    987     basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
    988     ;;
    989   pentium | p5 | k5 | k6 | nexgen | viac3)
    990     basic_machine=i586-pc
    991     ;;
    992   pentiumpro | p6 | 6x86 | athlon | athlon_*)
    993     basic_machine=i686-pc
    994     ;;
    995   pentiumii | pentium2 | pentiumiii | pentium3)
    996     basic_machine=i686-pc
    997     ;;
    998   pentium4)
    999     basic_machine=i786-pc
    1000     ;;
    1001   pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
    1002     basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
    1003     ;;
    1004   pentiumpro-* | p6-* | 6x86-* | athlon-*)
    1005     basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    1006     ;;
    1007   pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
    1008     basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
    1009     ;;
    1010   pentium4-*)
    1011     basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    1012     ;;
    1013   pn)
    1014     basic_machine=pn-gould
    1015     ;;
    1016   power)  basic_machine=power-ibm
    1017     ;;
    1018   ppc | ppcbe)  basic_machine=powerpc-unknown
    1019     ;;
    1020   ppc-* | ppcbe-*)
    1021     basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
    1022     ;;
    1023   ppcle | powerpclittle | ppc-le | powerpc-little)
    1024     basic_machine=powerpcle-unknown
    1025     ;;
    1026   ppcle-* | powerpclittle-*)
    1027     basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
    1028     ;;
    1029   ppc64)  basic_machine=powerpc64-unknown
    1030     ;;
    1031   ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
    1032     ;;
    1033   ppc64le | powerpc64little | ppc64-le | powerpc64-little)
    1034     basic_machine=powerpc64le-unknown
    1035     ;;
    1036   ppc64le-* | powerpc64little-*)
    1037     basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
    1038     ;;
    1039   ps2)
    1040     basic_machine=i386-ibm
    1041     ;;
    1042   pw32)
    1043     basic_machine=i586-unknown
    1044     os=-pw32
    1045     ;;
    1046   rdos | rdos64)
    1047     basic_machine=x86_64-pc
    1048     os=-rdos
    1049     ;;
    1050   rdos32)
    1051     basic_machine=i386-pc
    1052     os=-rdos
    1053     ;;
    1054   rom68k)
    1055     basic_machine=m68k-rom68k
    1056     os=-coff
    1057     ;;
    1058   rm[46]00)
    1059     basic_machine=mips-siemens
    1060     ;;
    1061   rtpc | rtpc-*)
    1062     basic_machine=romp-ibm
    1063     ;;
    1064   s390 | s390-*)
    1065     basic_machine=s390-ibm
    1066     ;;
    1067   s390x | s390x-*)
    1068     basic_machine=s390x-ibm
    1069     ;;
    1070   sa29200)
    1071     basic_machine=a29k-amd
    1072     os=-udi
    1073     ;;
    1074   sb1)
    1075     basic_machine=mipsisa64sb1-unknown
    1076     ;;
    1077   sb1el)
    1078     basic_machine=mipsisa64sb1el-unknown
    1079     ;;
    1080   sde)
    1081     basic_machine=mipsisa32-sde
    1082     os=-elf
    1083     ;;
    1084   sei)
    1085     basic_machine=mips-sei
    1086     os=-seiux
    1087     ;;
    1088   sequent)
    1089     basic_machine=i386-sequent
    1090     ;;
    1091   sh)
    1092     basic_machine=sh-hitachi
    1093     os=-hms
    1094     ;;
    1095   sh5el)
    1096     basic_machine=sh5le-unknown
    1097     ;;
    1098   sh64)
    1099     basic_machine=sh64-unknown
    1100     ;;
    1101   sparclite-wrs | simso-wrs)
    1102     basic_machine=sparclite-wrs
    1103     os=-vxworks
    1104     ;;
    1105   sps7)
    1106     basic_machine=m68k-bull
    1107     os=-sysv2
    1108     ;;
    1109   spur)
    1110     basic_machine=spur-unknown
    1111     ;;
    1112   st2000)
    1113     basic_machine=m68k-tandem
    1114     ;;
    1115   stratus)
    1116     basic_machine=i860-stratus
    1117     os=-sysv4
    1118     ;;
    1119   strongarm-* | thumb-*)
    1120     basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
    1121     ;;
    1122   sun2)
    1123     basic_machine=m68000-sun
    1124     ;;
    1125   sun2os3)
    1126     basic_machine=m68000-sun
    1127     os=-sunos3
    1128     ;;
    1129   sun2os4)
    1130     basic_machine=m68000-sun
    1131     os=-sunos4
    1132     ;;
    1133   sun3os3)
    1134     basic_machine=m68k-sun
    1135     os=-sunos3
    1136     ;;
    1137   sun3os4)
    1138     basic_machine=m68k-sun
    1139     os=-sunos4
    1140     ;;
    1141   sun4os3)
    1142     basic_machine=sparc-sun
    1143     os=-sunos3
    1144     ;;
    1145   sun4os4)
    1146     basic_machine=sparc-sun
    1147     os=-sunos4
    1148     ;;
    1149   sun4sol2)
    1150     basic_machine=sparc-sun
    1151     os=-solaris2
    1152     ;;
    1153   sun3 | sun3-*)
    1154     basic_machine=m68k-sun
    1155     ;;
    1156   sun4)
    1157     basic_machine=sparc-sun
    1158     ;;
    1159   sun386 | sun386i | roadrunner)
    1160     basic_machine=i386-sun
    1161     ;;
    1162   sv1)
    1163     basic_machine=sv1-cray
    1164     os=-unicos
    1165     ;;
    1166   symmetry)
    1167     basic_machine=i386-sequent
    1168     os=-dynix
    1169     ;;
    1170   t3e)
    1171     basic_machine=alphaev5-cray
    1172     os=-unicos
    1173     ;;
    1174   t90)
    1175     basic_machine=t90-cray
    1176     os=-unicos
    1177     ;;
    1178   tile*)
    1179     basic_machine=$basic_machine-unknown
    1180     os=-linux-gnu
    1181     ;;
    1182   tx39)
    1183     basic_machine=mipstx39-unknown
    1184     ;;
    1185   tx39el)
    1186     basic_machine=mipstx39el-unknown
    1187     ;;
    1188   toad1)
    1189     basic_machine=pdp10-xkl
    1190     os=-tops20
    1191     ;;
    1192   tower | tower-32)
    1193     basic_machine=m68k-ncr
    1194     ;;
    1195   tpf)
    1196     basic_machine=s390x-ibm
    1197     os=-tpf
    1198     ;;
    1199   udi29k)
    1200     basic_machine=a29k-amd
    1201     os=-udi
    1202     ;;
    1203   ultra3)
    1204     basic_machine=a29k-nyu
    1205     os=-sym1
    1206     ;;
    1207   v810 | necv810)
    1208     basic_machine=v810-nec
    1209     os=-none
    1210     ;;
    1211   vaxv)
    1212     basic_machine=vax-dec
    1213     os=-sysv
    1214     ;;
    1215   vms)
    1216     basic_machine=vax-dec
    1217     os=-vms
    1218     ;;
    1219   vpp*|vx|vx-*)
    1220     basic_machine=f301-fujitsu
    1221     ;;
    1222   vxworks960)
    1223     basic_machine=i960-wrs
    1224     os=-vxworks
    1225     ;;
    1226   vxworks68)
    1227     basic_machine=m68k-wrs
    1228     os=-vxworks
    1229     ;;
    1230   vxworks29k)
    1231     basic_machine=a29k-wrs
    1232     os=-vxworks
    1233     ;;
    1234   w65*)
    1235     basic_machine=w65-wdc
    1236     os=-none
    1237     ;;
    1238   w89k-*)
    1239     basic_machine=hppa1.1-winbond
    1240     os=-proelf
    1241     ;;
    1242   xbox)
    1243     basic_machine=i686-pc
    1244     os=-mingw32
    1245     ;;
    1246   xps | xps100)
    1247     basic_machine=xps100-honeywell
    1248     ;;
    1249   xscale-* | xscalee[bl]-*)
    1250     basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
    1251     ;;
    1252   ymp)
    1253     basic_machine=ymp-cray
    1254     os=-unicos
    1255     ;;
    1256   z8k-*-coff)
    1257     basic_machine=z8k-unknown
    1258     os=-sim
    1259     ;;
    1260   z80-*-coff)
    1261     basic_machine=z80-unknown
    1262     os=-sim
    1263     ;;
    1264   none)
    1265     basic_machine=none-none
    1266     os=-none
    1267     ;;
    1268 
    1269 # Here we handle the default manufacturer of certain CPU types.  It is in
    1270 # some cases the only manufacturer, in others, it is the most popular.
    1271   w89k)
    1272     basic_machine=hppa1.1-winbond
    1273     ;;
    1274   op50n)
    1275     basic_machine=hppa1.1-oki
    1276     ;;
    1277   op60c)
    1278     basic_machine=hppa1.1-oki
    1279     ;;
    1280   romp)
    1281     basic_machine=romp-ibm
    1282     ;;
    1283   mmix)
    1284     basic_machine=mmix-knuth
    1285     ;;
    1286   rs6000)
    1287     basic_machine=rs6000-ibm
    1288     ;;
    1289   vax)
    1290     basic_machine=vax-dec
    1291     ;;
    1292   pdp10)
    1293     # there are many clones, so DEC is not a safe bet
    1294     basic_machine=pdp10-unknown
    1295     ;;
    1296   pdp11)
    1297     basic_machine=pdp11-dec
    1298     ;;
    1299   we32k)
    1300     basic_machine=we32k-att
    1301     ;;
    1302   sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
    1303     basic_machine=sh-unknown
    1304     ;;
    1305   sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    1306     basic_machine=sparc-sun
    1307     ;;
    1308   cydra)
    1309     basic_machine=cydra-cydrome
    1310     ;;
    1311   orion)
    1312     basic_machine=orion-highlevel
    1313     ;;
    1314   orion105)
    1315     basic_machine=clipper-highlevel
    1316     ;;
    1317   mac | mpw | mac-mpw)
    1318     basic_machine=m68k-apple
    1319     ;;
    1320   pmac | pmac-mpw)
    1321     basic_machine=powerpc-apple
    1322     ;;
    1323   *-unknown)
    1324     # Make sure to match an already-canonicalized machine name.
    1325     ;;
    13261489  *)
    1327     echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
    1328     exit 1
     1490    # No normalization, but not necessarily accepted, that comes below.
    13291491    ;;
    13301492esac
    13311493
    1332 # Here we canonicalize certain aliases for manufacturers.
    1333 case $basic_machine in
    1334   *-digital*)
    1335     basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
    1336     ;;
    1337   *-commodore*)
    1338     basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
    1339     ;;
    1340   *)
    1341     ;;
    1342 esac
    1343 
    1344 # Decode manufacturer-specific aliases for certain operating systems.
    1345 
    1346 if [ x"$os" != x"" ]
    1347 then
    1348 case $os in
    1349   # First match some system type aliases
    1350   # that might get confused with valid system types.
    1351   # -solaris* is a basic system type, with this one exception.
    1352   -auroraux)
    1353     os=-auroraux
    1354     ;;
    1355   -solaris1 | -solaris1.*)
    1356     os=`echo $os | sed -e 's|solaris1|sunos4|'`
    1357     ;;
    1358   -solaris)
    1359     os=-solaris2
    1360     ;;
    1361   -svr4*)
    1362     os=-sysv4
    1363     ;;
    1364   -unixware*)
    1365     os=-sysv4.2uw
    1366     ;;
    1367   -gnu/linux*)
    1368     os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
    1369     ;;
    1370   # First accept the basic system types.
    1371   # The portable systems comes first.
    1372   # Each alternative MUST END IN A *, to match a version number.
    1373   # -sysv* is not here because it comes later, after sysvr4.
    1374   -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
    1375         | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
    1376         | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
    1377         | -sym* | -kopensolaris* | -plan9* \
    1378         | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    1379         | -aos* | -aros* | -cloudabi* \
    1380         | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    1381         | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1382         | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
    1383         | -bitrig* | -openbsd* | -solidbsd* \
    1384         | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
    1385         | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    1386         | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    1387         | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    1388         | -chorusos* | -chorusrdb* | -cegcc* \
    1389         | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1390         | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
    1391         | -linux-newlib* | -linux-musl* | -linux-uclibc* \
    1392         | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
    1393         | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    1394         | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
    1395         | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
    1396         | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    1397         | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    1398         | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
    1399         | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
    1400   # Remember, each alternative MUST END IN *, to match a version number.
    1401     ;;
    1402   -qnx*)
    1403     case $basic_machine in
    1404         x86-* | i*86-*)
    1405       ;;
    1406         *)
    1407       os=-nto$os
    1408       ;;
    1409     esac
    1410     ;;
    1411   -nto-qnx*)
    1412     ;;
    1413   -nto*)
    1414     os=`echo $os | sed -e 's|nto|nto-qnx|'`
    1415     ;;
    1416   -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    1417         | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
    1418         | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    1419     ;;
    1420   -mac*)
    1421     os=`echo $os | sed -e 's|mac|macos|'`
    1422     ;;
    1423   -linux-dietlibc)
    1424     os=-linux-dietlibc
    1425     ;;
    1426   -linux*)
    1427     os=`echo $os | sed -e 's|linux|linux-gnu|'`
    1428     ;;
    1429   -sunos5*)
    1430     os=`echo $os | sed -e 's|sunos5|solaris2|'`
    1431     ;;
    1432   -sunos6*)
    1433     os=`echo $os | sed -e 's|sunos6|solaris3|'`
    1434     ;;
    1435   -opened*)
    1436     os=-openedition
    1437     ;;
    1438   -os400*)
    1439     os=-os400
    1440     ;;
    1441   -wince*)
    1442     os=-wince
    1443     ;;
    1444   -osfrose*)
    1445     os=-osfrose
    1446     ;;
    1447   -osf*)
    1448     os=-osf
    1449     ;;
    1450   -utek*)
    1451     os=-bsd
    1452     ;;
    1453   -dynix*)
    1454     os=-bsd
    1455     ;;
    1456   -acis*)
    1457     os=-aos
    1458     ;;
    1459   -atheos*)
    1460     os=-atheos
    1461     ;;
    1462   -syllable*)
    1463     os=-syllable
    1464     ;;
    1465   -386bsd)
    1466     os=-bsd
    1467     ;;
    1468   -ctix* | -uts*)
    1469     os=-sysv
    1470     ;;
    1471   -nova*)
    1472     os=-rtmk-nova
    1473     ;;
    1474   -ns2 )
    1475     os=-nextstep2
    1476     ;;
    1477   -nsk*)
    1478     os=-nsk
    1479     ;;
    1480   # Preserve the version number of sinix5.
    1481   -sinix5.*)
    1482     os=`echo $os | sed -e 's|sinix|sysv|'`
    1483     ;;
    1484   -sinix*)
    1485     os=-sysv4
    1486     ;;
    1487   -tpf*)
    1488     os=-tpf
    1489     ;;
    1490   -triton*)
    1491     os=-sysv3
    1492     ;;
    1493   -oss*)
    1494     os=-sysv3
    1495     ;;
    1496   -svr4)
    1497     os=-sysv4
    1498     ;;
    1499   -svr3)
    1500     os=-sysv3
    1501     ;;
    1502   -sysvr4)
    1503     os=-sysv4
    1504     ;;
    1505   # This must come after -sysvr4.
    1506   -sysv*)
    1507     ;;
    1508   -ose*)
    1509     os=-ose
    1510     ;;
    1511   -es1800*)
    1512     os=-ose
    1513     ;;
    1514   -xenix)
    1515     os=-xenix
    1516     ;;
    1517   -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    1518     os=-mint
    1519     ;;
    1520   -aros*)
    1521     os=-aros
    1522     ;;
    1523   -zvmoe)
    1524     os=-zvmoe
    1525     ;;
    1526   -dicos*)
    1527     os=-dicos
    1528     ;;
    1529   -nacl*)
    1530     ;;
    1531   -none)
    1532     ;;
    1533   *)
    1534     # Get rid of the `-' at the beginning of $os.
    1535     os=`echo $os | sed 's/[^-]*-//'`
    1536     echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
    1537     exit 1
    1538     ;;
    1539 esac
    15401494else
    15411495
     
    15501504# system, and we'll never get to this point.
    15511505
    1552 case $basic_machine in
     1506kernel=
     1507case $cpu-$vendor in
    15531508  score-*)
    1554     os=-elf
     1509    os=elf
    15551510    ;;
    15561511  spu-*)
    1557     os=-elf
     1512    os=elf
    15581513    ;;
    15591514  *-acorn)
    1560     os=-riscix1.2
     1515    os=riscix1.2
    15611516    ;;
    15621517  arm*-rebel)
    1563     os=-linux
     1518    kernel=linux
     1519    os=gnu
    15641520    ;;
    15651521  arm*-semi)
    1566     os=-aout
     1522    os=aout
    15671523    ;;
    15681524  c4x-* | tic4x-*)
    1569     os=-coff
     1525    os=coff
    15701526    ;;
    15711527  c8051-*)
    1572     os=-elf
     1528    os=elf
     1529    ;;
     1530  clipper-intergraph)
     1531    os=clix
    15731532    ;;
    15741533  hexagon-*)
    1575     os=-elf
     1534    os=elf
    15761535    ;;
    15771536  tic54x-*)
    1578     os=-coff
     1537    os=coff
    15791538    ;;
    15801539  tic55x-*)
    1581     os=-coff
     1540    os=coff
    15821541    ;;
    15831542  tic6x-*)
    1584     os=-coff
     1543    os=coff
    15851544    ;;
    15861545  # This must come before the *-dec entry.
    15871546  pdp10-*)
    1588     os=-tops20
     1547    os=tops20
    15891548    ;;
    15901549  pdp11-*)
    1591     os=-none
     1550    os=none
    15921551    ;;
    15931552  *-dec | vax-*)
    1594     os=-ultrix4.2
     1553    os=ultrix4.2
    15951554    ;;
    15961555  m68*-apollo)
    1597     os=-domain
     1556    os=domain
    15981557    ;;
    15991558  i386-sun)
    1600     os=-sunos4.0.2
     1559    os=sunos4.0.2
    16011560    ;;
    16021561  m68000-sun)
    1603     os=-sunos3
     1562    os=sunos3
    16041563    ;;
    16051564  m68*-cisco)
    1606     os=-aout
     1565    os=aout
    16071566    ;;
    16081567  mep-*)
    1609     os=-elf
     1568    os=elf
    16101569    ;;
    16111570  mips*-cisco)
    1612     os=-elf
     1571    os=elf
    16131572    ;;
    16141573  mips*-*)
    1615     os=-elf
     1574    os=elf
    16161575    ;;
    16171576  or32-*)
    1618     os=-coff
     1577    os=coff
    16191578    ;;
    16201579  *-tti)  # must be before sparc entry or we get the wrong os.
    1621     os=-sysv3
     1580    os=sysv3
    16221581    ;;
    16231582  sparc-* | *-sun)
    1624     os=-sunos4.1.1
     1583    os=sunos4.1.1
     1584    ;;
     1585  pru-*)
     1586    os=elf
    16251587    ;;
    16261588  *-be)
    1627     os=-beos
    1628     ;;
    1629   *-haiku)
    1630     os=-haiku
     1589    os=beos
    16311590    ;;
    16321591  *-ibm)
    1633     os=-aix
     1592    os=aix
    16341593    ;;
    16351594  *-knuth)
    1636     os=-mmixware
     1595    os=mmixware
    16371596    ;;
    16381597  *-wec)
    1639     os=-proelf
     1598    os=proelf
    16401599    ;;
    16411600  *-winbond)
    1642     os=-proelf
     1601    os=proelf
    16431602    ;;
    16441603  *-oki)
    1645     os=-proelf
     1604    os=proelf
    16461605    ;;
    16471606  *-hp)
    1648     os=-hpux
     1607    os=hpux
    16491608    ;;
    16501609  *-hitachi)
    1651     os=-hiux
     1610    os=hiux
    16521611    ;;
    16531612  i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
    1654     os=-sysv
     1613    os=sysv
    16551614    ;;
    16561615  *-cbm)
    1657     os=-amigaos
     1616    os=amigaos
    16581617    ;;
    16591618  *-dg)
    1660     os=-dgux
     1619    os=dgux
    16611620    ;;
    16621621  *-dolphin)
    1663     os=-sysv3
     1622    os=sysv3
    16641623    ;;
    16651624  m68k-ccur)
    1666     os=-rtu
     1625    os=rtu
    16671626    ;;
    16681627  m88k-omron*)
    1669     os=-luna
    1670     ;;
    1671   *-next )
    1672     os=-nextstep
     1628    os=luna
     1629    ;;
     1630  *-next)
     1631    os=nextstep
    16731632    ;;
    16741633  *-sequent)
    1675     os=-ptx
     1634    os=ptx
    16761635    ;;
    16771636  *-crds)
    1678     os=-unos
     1637    os=unos
    16791638    ;;
    16801639  *-ns)
    1681     os=-genix
     1640    os=genix
    16821641    ;;
    16831642  i370-*)
    1684     os=-mvs
    1685     ;;
    1686   *-next)
    1687     os=-nextstep3
     1643    os=mvs
    16881644    ;;
    16891645  *-gould)
    1690     os=-sysv
     1646    os=sysv
    16911647    ;;
    16921648  *-highlevel)
    1693     os=-bsd
     1649    os=bsd
    16941650    ;;
    16951651  *-encore)
    1696     os=-bsd
     1652    os=bsd
    16971653    ;;
    16981654  *-sgi)
    1699     os=-irix
     1655    os=irix
    17001656    ;;
    17011657  *-siemens)
    1702     os=-sysv4
     1658    os=sysv4
    17031659    ;;
    17041660  *-masscomp)
    1705     os=-rtu
     1661    os=rtu
    17061662    ;;
    17071663  f30[01]-fujitsu | f700-fujitsu)
    1708     os=-uxpv
     1664    os=uxpv
    17091665    ;;
    17101666  *-rom68k)
    1711     os=-coff
     1667    os=coff
    17121668    ;;
    17131669  *-*bug)
    1714     os=-coff
     1670    os=coff
    17151671    ;;
    17161672  *-apple)
    1717     os=-macos
     1673    os=macos
    17181674    ;;
    17191675  *-atari*)
    1720     os=-mint
     1676    os=mint
     1677    ;;
     1678  *-wrs)
     1679    os=vxworks
    17211680    ;;
    17221681  *)
    1723     os=-none
     1682    os=none
    17241683    ;;
    17251684esac
     1685
    17261686fi
     1687
     1688# Now, validate our (potentially fixed-up) OS.
     1689case $os in
     1690  # Sometimes we do "kernel-libc", so those need to count as OSes.
     1691  musl* | newlib* | uclibc*)
     1692    ;;
     1693  # Likewise for "kernel-abi"
     1694  eabi* | gnueabi*)
     1695    ;;
     1696  # VxWorks passes extra cpu info in the 4th filed.
     1697  simlinux | simwindows | spe)
     1698    ;;
     1699  # Now accept the basic system types.
     1700  # The portable systems comes first.
     1701  # Each alternative MUST end in a * to match a version number.
     1702  gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
     1703       | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
     1704       | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
     1705       | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
     1706       | hiux* | abug | nacl* | netware* | windows* \
     1707       | os9* | macos* | osx* | ios* \
     1708       | mpw* | magic* | mmixware* | mon960* | lnews* \
     1709       | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
     1710       | aos* | aros* | cloudabi* | sortix* | twizzler* \
     1711       | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
     1712       | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
     1713       | mirbsd* | netbsd* | dicos* | openedition* | ose* \
     1714       | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
     1715       | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
     1716       | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
     1717       | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
     1718       | udi* | lites* | ieee* | go32* | aux* | hcos* \
     1719       | chorusrdb* | cegcc* | glidix* | serenity* \
     1720       | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
     1721       | midipix* | mingw32* | mingw64* | mint* \
     1722       | uxpv* | beos* | mpeix* | udk* | moxiebox* \
     1723       | interix* | uwin* | mks* | rhapsody* | darwin* \
     1724       | openstep* | oskit* | conix* | pw32* | nonstopux* \
     1725       | storm-chaos* | tops10* | tenex* | tops20* | its* \
     1726       | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
     1727       | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
     1728       | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
     1729       | skyos* | haiku* | rdos* | toppers* | drops* | es* \
     1730       | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
     1731       | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
     1732       | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
     1733    ;;
     1734  # This one is extra strict with allowed versions
     1735  sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
     1736    # Don't forget version if it is 3.2v4 or newer.
     1737    ;;
     1738  none)
     1739    ;;
     1740  *)
     1741    echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
     1742    exit 1
     1743    ;;
     1744esac
     1745
     1746# As a final step for OS-related things, validate the OS-kernel combination
     1747# (given a valid OS), if there is a kernel.
     1748case $kernel-$os in
     1749  linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
     1750    ;;
     1751  uclinux-uclibc* )
     1752    ;;
     1753  -dietlibc* | -newlib* | -musl* | -uclibc* )
     1754    # These are just libc implementations, not actual OSes, and thus
     1755    # require a kernel.
     1756    echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
     1757    exit 1
     1758    ;;
     1759  kfreebsd*-gnu* | kopensolaris*-gnu*)
     1760    ;;
     1761  vxworks-simlinux | vxworks-simwindows | vxworks-spe)
     1762    ;;
     1763  nto-qnx*)
     1764    ;;
     1765  os2-emx)
     1766    ;;
     1767  *-eabi* | *-gnueabi*)
     1768    ;;
     1769  -*)
     1770    # Blank kernel with real OS is always fine.
     1771    ;;
     1772  *-*)
     1773    echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
     1774    exit 1
     1775    ;;
     1776esac
    17271777
    17281778# Here we handle the case where we know the os, and the CPU type, but not the
    17291779# manufacturer.  We pick the logical manufacturer.
    1730 vendor=unknown
    1731 case $basic_machine in
    1732   *-unknown)
    1733     case $os in
    1734       -riscix*)
     1780case $vendor in
     1781  unknown)
     1782    case $cpu-$os in
     1783      *-riscix*)
    17351784        vendor=acorn
    17361785        ;;
    1737       -sunos*)
     1786      *-sunos*)
    17381787        vendor=sun
    17391788        ;;
    1740       -cnk*|-aix*)
     1789      *-cnk* | *-aix*)
    17411790        vendor=ibm
    17421791        ;;
    1743       -beos*)
     1792      *-beos*)
    17441793        vendor=be
    17451794        ;;
    1746       -hpux*)
     1795      *-hpux*)
    17471796        vendor=hp
    17481797        ;;
    1749       -mpeix*)
     1798      *-mpeix*)
    17501799        vendor=hp
    17511800        ;;
    1752       -hiux*)
     1801      *-hiux*)
    17531802        vendor=hitachi
    17541803        ;;
    1755       -unos*)
     1804      *-unos*)
    17561805        vendor=crds
    17571806        ;;
    1758       -dgux*)
     1807      *-dgux*)
    17591808        vendor=dg
    17601809        ;;
    1761       -luna*)
     1810      *-luna*)
    17621811        vendor=omron
    17631812        ;;
    1764       -genix*)
     1813      *-genix*)
    17651814        vendor=ns
    17661815        ;;
    1767       -mvs* | -opened*)
     1816      *-clix*)
     1817        vendor=intergraph
     1818        ;;
     1819      *-mvs* | *-opened*)
    17681820        vendor=ibm
    17691821        ;;
    1770       -os400*)
     1822      *-os400*)
    17711823        vendor=ibm
    17721824        ;;
    1773       -ptx*)
     1825      s390-* | s390x-*)
     1826        vendor=ibm
     1827        ;;
     1828      *-ptx*)
    17741829        vendor=sequent
    17751830        ;;
    1776       -tpf*)
     1831      *-tpf*)
    17771832        vendor=ibm
    17781833        ;;
    1779       -vxsim* | -vxworks* | -windiss*)
     1834      *-vxsim* | *-vxworks* | *-windiss*)
    17801835        vendor=wrs
    17811836        ;;
    1782       -aux*)
     1837      *-aux*)
    17831838        vendor=apple
    17841839        ;;
    1785       -hms*)
     1840      *-hms*)
    17861841        vendor=hitachi
    17871842        ;;
    1788       -mpw* | -macos*)
     1843      *-mpw* | *-macos*)
    17891844        vendor=apple
    17901845        ;;
    1791       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
     1846      *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
    17921847        vendor=atari
    17931848        ;;
    1794       -vos*)
     1849      *-vos*)
    17951850        vendor=stratus
    17961851        ;;
    17971852    esac
    1798     basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
    17991853    ;;
    18001854esac
    18011855
    1802 echo $basic_machine$os
     1856echo "$cpu-$vendor-${kernel:+$kernel-}$os"
    18031857exit
    18041858
    18051859# Local variables:
    1806 # eval: (add-hook 'write-file-hooks 'time-stamp)
     1860# eval: (add-hook 'before-save-hook 'time-stamp)
    18071861# time-stamp-start: "timestamp='"
    18081862# time-stamp-format: "%:y-%02m-%02d"
Note: See TracChangeset for help on using the changeset viewer.