Back to home page

Wine source

 
 

    


File indexing completed on 2023-11-24 23:29:37

87f48fcc7 Patr*0001 #! /bin/sh
                0002 # Attempt to guess a canonical system name.
3aca59945 Alex*0003 #   Copyright 1992-2023 Free Software Foundation, Inc.
87f48fcc7 Patr*0004 
b9f6d1be0 Alex*0005 # shellcheck disable=SC2006,SC2268 # see below for rationale
                0006 
3aca59945 Alex*0007 timestamp='2023-08-22'
87f48fcc7 Patr*0008 
                0009 # This file is free software; you can redistribute it and/or modify it
                0010 # under the terms of the GNU General Public License as published by
3aca59945 Alex*0011 # the Free Software Foundation, either version 3 of the License, or
87f48fcc7 Patr*0012 # (at your option) any later version.
                0013 #
                0014 # This program is distributed in the hope that it will be useful, but
                0015 # WITHOUT ANY WARRANTY; without even the implied warranty of
                0016 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                0017 # General Public License for more details.
                0018 #
                0019 # You should have received a copy of the GNU General Public License
f6a1b37d1 Alex*0020 # along with this program; if not, see <https://www.gnu.org/licenses/>.
87f48fcc7 Patr*0021 #
                0022 # As a special exception to the GNU General Public License, if you
                0023 # distribute this file as part of a program that contains a
                0024 # configuration script generated by Autoconf, you may include it under
bd72767ee Andr*0025 # the same distribution terms that you use for the rest of that
                0026 # program.  This Exception is an additional permission under section 7
                0027 # of the GNU General Public License, version 3 ("GPLv3").
87f48fcc7 Patr*0028 #
bf6c3a122 Alex*0029 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
87f48fcc7 Patr*0030 #
f00b8b9c1 Wolf*0031 # You can get the latest version of this script from:
b9f6d1be0 Alex*0032 # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
bd72767ee Andr*0033 #
bf6c3a122 Alex*0034 # Please send patches to <config-patches@gnu.org>.
bd72767ee Andr*0035 
87f48fcc7 Patr*0036 
b9f6d1be0 Alex*0037 # The "shellcheck disable" line above the timestamp inhibits complaints
                0038 # about features and limitations of the classic Bourne shell that were
                0039 # superseded or lifted in POSIX.  However, this script identifies a wide
                0040 # variety of pre-POSIX systems that do not have POSIX shells at all, and
                0041 # even some reasonably current systems (Solaris 10 as case-in-point) still
                0042 # have a pre-POSIX /bin/sh.
                0043 
                0044 
87f48fcc7 Patr*0045 me=`echo "$0" | sed -e 's,.*/,,'`
                0046 
                0047 usage="\
                0048 Usage: $0 [OPTION]
                0049 
3aca59945 Alex*0050 Output the configuration name of the system '$me' is run on.
87f48fcc7 Patr*0051 
f6a1b37d1 Alex*0052 Options:
87f48fcc7 Patr*0053   -h, --help         print this help, then exit
                0054   -t, --time-stamp   print date of last modification, then exit
                0055   -v, --version      print version number, then exit
                0056 
                0057 Report bugs and patches to <config-patches@gnu.org>."
                0058 
                0059 version="\
                0060 GNU config.guess ($timestamp)
                0061 
                0062 Originally written by Per Bothner.
3aca59945 Alex*0063 Copyright 1992-2023 Free Software Foundation, Inc.
87f48fcc7 Patr*0064 
                0065 This is free software; see the source for copying conditions.  There is NO
                0066 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
                0067 
                0068 help="
3aca59945 Alex*0069 Try '$me --help' for more information."
87f48fcc7 Patr*0070 
                0071 # Parse command line
                0072 while test $# -gt 0 ; do
                0073   case $1 in
                0074     --time-stamp | --time* | -t )
5c0dde779 Alex*0075        echo "$timestamp" ; exit ;;
87f48fcc7 Patr*0076     --version | -v )
5c0dde779 Alex*0077        echo "$version" ; exit ;;
87f48fcc7 Patr*0078     --help | --h* | -h )
5c0dde779 Alex*0079        echo "$usage"; exit ;;
87f48fcc7 Patr*0080     -- )     # Stop option processing
                0081        shift; break ;;
                0082     - ) # Use stdin as input.
                0083        break ;;
                0084     -* )
                0085        echo "$me: invalid option $1$help" >&2
                0086        exit 1 ;;
                0087     * )
                0088        break ;;
                0089   esac
                0090 done
                0091 
                0092 if test $# != 0; then
                0093   echo "$me: too many arguments$help" >&2
                0094   exit 1
                0095 fi
                0096 
b9f6d1be0 Alex*0097 # Just in case it came from the environment.
                0098 GUESS=
                0099 
4d9e7036b Alex*0100 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
                0101 # compiler to aid in system detection is discouraged as it requires
                0102 # temporary files to be created and, as you can see below, it is a
                0103 # headache to deal with in a portable fashion.
87f48fcc7 Patr*0104 
3aca59945 Alex*0105 # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
                0106 # use 'HOST_CC' if defined, but it is deprecated.
87f48fcc7 Patr*0107 
c67a307b8 Alex*0108 # Portable tmp directory creation inspired by the Autoconf team.
4d9e7036b Alex*0109 
11bb6deb0 Mart*0110 tmp=
                0111 # shellcheck disable=SC2172
                0112 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
                0113 
                0114 set_cc_for_build() {
                0115     # prevent multiple calls if $tmp is already set
                0116     test "$tmp" && return 0
                0117     : "${TMPDIR=/tmp}"
b9f6d1be0 Alex*0118     # shellcheck disable=SC2039,SC3028
11bb6deb0 Mart*0119     { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
                0120         { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
                0121         { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
                0122         { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
                0123     dummy=$tmp/dummy
                0124     case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
                0125         ,,)    echo "int x;" > "$dummy.c"
                0126                for driver in cc gcc c89 c99 ; do
                0127                    if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
b9f6d1be0 Alex*0128                        CC_FOR_BUILD=$driver
11bb6deb0 Mart*0129                        break
                0130                    fi
                0131                done
                0132                if test x"$CC_FOR_BUILD" = x ; then
                0133                    CC_FOR_BUILD=no_compiler_found
                0134                fi
                0135                ;;
                0136         ,,*)   CC_FOR_BUILD=$CC ;;
                0137         ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
                0138     esac
                0139 }
87f48fcc7 Patr*0140 
                0141 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
fb2b1c85b Alex*0142 # (ghazi@noc.rutgers.edu 1994-08-24)
11bb6deb0 Mart*0143 if test -f /.attbin/uname ; then
87f48fcc7 Patr*0144         PATH=$PATH:/.attbin ; export PATH
                0145 fi
                0146 
                0147 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
                0148 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
b9f6d1be0 Alex*0149 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
87f48fcc7 Patr*0150 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
                0151 
b9f6d1be0 Alex*0152 case $UNAME_SYSTEM in
bf6c3a122 Alex*0153 Linux|GNU|GNU/*)
b9f6d1be0 Alex*0154         LIBC=unknown
bf6c3a122 Alex*0155 
11bb6deb0 Mart*0156         set_cc_for_build
f6a1b37d1 Alex*0157         cat <<-EOF > "$dummy.c"
3aca59945 Alex*0158         #if defined(__ANDROID__)
                0159         LIBC=android
                0160         #else
bf6c3a122 Alex*0161         #include <features.h>
                0162         #if defined(__UCLIBC__)
                0163         LIBC=uclibc
                0164         #elif defined(__dietlibc__)
                0165         LIBC=dietlibc
b9f6d1be0 Alex*0166         #elif defined(__GLIBC__)
bf6c3a122 Alex*0167         LIBC=gnu
b9f6d1be0 Alex*0168         #else
                0169         #include <stdarg.h>
                0170         /* First heuristic to detect musl libc.  */
                0171         #ifdef __DEFINED_va_list
                0172         LIBC=musl
                0173         #endif
bf6c3a122 Alex*0174         #endif
3aca59945 Alex*0175         #endif
bf6c3a122 Alex*0176         EOF
b9f6d1be0 Alex*0177         cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
                0178         eval "$cc_set_libc"
f6a1b37d1 Alex*0179 
b9f6d1be0 Alex*0180         # Second heuristic to detect musl libc.
                0181         if [ "$LIBC" = unknown ] &&
                0182            command -v ldd >/dev/null &&
                0183            ldd --version 2>&1 | grep -q ^musl; then
                0184                 LIBC=musl
                0185         fi
                0186 
                0187         # If the system lacks a compiler, then just pick glibc.
                0188         # We could probably try harder.
                0189         if [ "$LIBC" = unknown ]; then
                0190                 LIBC=gnu
f6a1b37d1 Alex*0191         fi
bf6c3a122 Alex*0192         ;;
                0193 esac
                0194 
87f48fcc7 Patr*0195 # Note: order is significant - the case branches are not exclusive.
                0196 
b9f6d1be0 Alex*0197 case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
87f48fcc7 Patr*0198     *:NetBSD:*:*)
fb2b1c85b Alex*0199         # NetBSD (nbsd) targets should (where applicable) match one or
bd72767ee Andr*0200         # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
87f48fcc7 Patr*0201         # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
                0202         # switched to ELF, *-*-netbsd* would select the old
                0203         # object file format.  This provides both forward
                0204         # compatibility and a consistent mechanism for selecting the
                0205         # object file format.
fb2b1c85b Alex*0206         #
                0207         # Note: NetBSD doesn't particularly care about the vendor
                0208         # portion of the name.  We always set it to "unknown".
bf6c3a122 Alex*0209         UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
b9f6d1be0 Alex*0210             /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
                0211             /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
bf6c3a122 Alex*0212             echo unknown)`
b9f6d1be0 Alex*0213         case $UNAME_MACHINE_ARCH in
                0214             aarch64eb) machine=aarch64_be-unknown ;;
4d9e7036b Alex*0215             armeb) machine=armeb-unknown ;;
fb2b1c85b Alex*0216             arm*) machine=arm-unknown ;;
                0217             sh3el) machine=shl-unknown ;;
                0218             sh3eb) machine=sh-unknown ;;
aafc07086 Alex*0219             sh5el) machine=sh5le-unknown ;;
bf6c3a122 Alex*0220             earmv*)
f6a1b37d1 Alex*0221                 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
                0222                 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
b9f6d1be0 Alex*0223                 machine=${arch}${endian}-unknown
bf6c3a122 Alex*0224                 ;;
b9f6d1be0 Alex*0225             *) machine=$UNAME_MACHINE_ARCH-unknown ;;
87f48fcc7 Patr*0226         esac
                0227         # The Operating System including object format, if it has switched
f6a1b37d1 Alex*0228         # to ELF recently (or will in the future) and ABI.
b9f6d1be0 Alex*0229         case $UNAME_MACHINE_ARCH in
f6a1b37d1 Alex*0230             earm*)
                0231                 os=netbsdelf
                0232                 ;;
                0233             arm*|i386|m68k|ns32k|sh3*|sparc|vax)
11bb6deb0 Mart*0234                 set_cc_for_build
87f48fcc7 Patr*0235                 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
f00b8b9c1 Wolf*0236                         | grep -q __ELF__
87f48fcc7 Patr*0237                 then
                0238                     # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
                0239                     # Return netbsd for either.  FIX?
                0240                     os=netbsd
                0241                 else
                0242                     os=netbsdelf
                0243                 fi
                0244                 ;;
                0245             *)
2843d4f83 Andr*0246                 os=netbsd
87f48fcc7 Patr*0247                 ;;
                0248         esac
bf6c3a122 Alex*0249         # Determine ABI tags.
b9f6d1be0 Alex*0250         case $UNAME_MACHINE_ARCH in
bf6c3a122 Alex*0251             earm*)
                0252                 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
f6a1b37d1 Alex*0253                 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
bf6c3a122 Alex*0254                 ;;
                0255         esac
87f48fcc7 Patr*0256         # The OS release
4d9e7036b Alex*0257         # Debian GNU/NetBSD machines have a different userland, and
                0258         # thus, need a distinct triplet. However, they do not need
                0259         # kernel version information, so it can be replaced with a
                0260         # suitable tag, in the style of linux-gnu.
b9f6d1be0 Alex*0261         case $UNAME_VERSION in
4d9e7036b Alex*0262             Debian*)
                0263                 release='-gnu'
                0264                 ;;
                0265             *)
f6a1b37d1 Alex*0266                 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
4d9e7036b Alex*0267                 ;;
                0268         esac
87f48fcc7 Patr*0269         # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
                0270         # contains redundant information, the shorter form:
                0271         # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
b9f6d1be0 Alex*0272         GUESS=$machine-${os}${release}${abi-}
                0273         ;;
bd72767ee Andr*0274     *:Bitrig:*:*)
                0275         UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
b9f6d1be0 Alex*0276         GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
                0277         ;;
fb2b1c85b Alex*0278     *:OpenBSD:*:*)
5c0dde779 Alex*0279         UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
b9f6d1be0 Alex*0280         GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
                0281         ;;
                0282     *:SecBSD:*:*)
                0283         UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
                0284         GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
                0285         ;;
f6a1b37d1 Alex*0286     *:LibertyBSD:*:*)
                0287         UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
b9f6d1be0 Alex*0288         GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
                0289         ;;
f6a1b37d1 Alex*0290     *:MidnightBSD:*:*)
b9f6d1be0 Alex*0291         GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
                0292         ;;
c67a307b8 Alex*0293     *:ekkoBSD:*:*)
b9f6d1be0 Alex*0294         GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
                0295         ;;
5c0dde779 Alex*0296     *:SolidBSD:*:*)
b9f6d1be0 Alex*0297         GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
                0298         ;;
11bb6deb0 Mart*0299     *:OS108:*:*)
b9f6d1be0 Alex*0300         GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
                0301         ;;
c67a307b8 Alex*0302     macppc:MirBSD:*:*)
b9f6d1be0 Alex*0303         GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
                0304         ;;
c67a307b8 Alex*0305     *:MirBSD:*:*)
b9f6d1be0 Alex*0306         GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
                0307         ;;
bf6c3a122 Alex*0308     *:Sortix:*:*)
b9f6d1be0 Alex*0309         GUESS=$UNAME_MACHINE-unknown-sortix
                0310         ;;
11bb6deb0 Mart*0311     *:Twizzler:*:*)
b9f6d1be0 Alex*0312         GUESS=$UNAME_MACHINE-unknown-twizzler
                0313         ;;
f6a1b37d1 Alex*0314     *:Redox:*:*)
b9f6d1be0 Alex*0315         GUESS=$UNAME_MACHINE-unknown-redox
                0316         ;;
f6a1b37d1 Alex*0317     mips:OSF1:*.*)
b9f6d1be0 Alex*0318         GUESS=mips-dec-osf1
                0319         ;;
87f48fcc7 Patr*0320     alpha:OSF1:*:*)
b9f6d1be0 Alex*0321         # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
                0322         trap '' 0
c67a307b8 Alex*0323         case $UNAME_RELEASE in
                0324         *4.0)
87f48fcc7 Patr*0325                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
c67a307b8 Alex*0326                 ;;
                0327         *5.*)
2843d4f83 Andr*0328                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
c67a307b8 Alex*0329                 ;;
                0330         esac
                0331         # According to Compaq, /usr/sbin/psrinfo has been available on
                0332         # OSF/1 and Tru64 systems produced since 1995.  I hope that
                0333         # covers most systems running today.  This code pipes the CPU
                0334         # types through head -n 1, so we only detect the type of CPU 0.
                0335         ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
b9f6d1be0 Alex*0336         case $ALPHA_CPU_TYPE in
c67a307b8 Alex*0337             "EV4 (21064)")
f6a1b37d1 Alex*0338                 UNAME_MACHINE=alpha ;;
c67a307b8 Alex*0339             "EV4.5 (21064)")
f6a1b37d1 Alex*0340                 UNAME_MACHINE=alpha ;;
c67a307b8 Alex*0341             "LCA4 (21066/21068)")
f6a1b37d1 Alex*0342                 UNAME_MACHINE=alpha ;;
c67a307b8 Alex*0343             "EV5 (21164)")
f6a1b37d1 Alex*0344                 UNAME_MACHINE=alphaev5 ;;
c67a307b8 Alex*0345             "EV5.6 (21164A)")
f6a1b37d1 Alex*0346                 UNAME_MACHINE=alphaev56 ;;
c67a307b8 Alex*0347             "EV5.6 (21164PC)")
f6a1b37d1 Alex*0348                 UNAME_MACHINE=alphapca56 ;;
c67a307b8 Alex*0349             "EV5.7 (21164PC)")
f6a1b37d1 Alex*0350                 UNAME_MACHINE=alphapca57 ;;
c67a307b8 Alex*0351             "EV6 (21264)")
f6a1b37d1 Alex*0352                 UNAME_MACHINE=alphaev6 ;;
c67a307b8 Alex*0353             "EV6.7 (21264A)")
f6a1b37d1 Alex*0354                 UNAME_MACHINE=alphaev67 ;;
c67a307b8 Alex*0355             "EV6.8CB (21264C)")
f6a1b37d1 Alex*0356                 UNAME_MACHINE=alphaev68 ;;
c67a307b8 Alex*0357             "EV6.8AL (21264B)")
f6a1b37d1 Alex*0358                 UNAME_MACHINE=alphaev68 ;;
c67a307b8 Alex*0359             "EV6.8CX (21264D)")
f6a1b37d1 Alex*0360                 UNAME_MACHINE=alphaev68 ;;
c67a307b8 Alex*0361             "EV6.9A (21264/EV69A)")
f6a1b37d1 Alex*0362                 UNAME_MACHINE=alphaev69 ;;
c67a307b8 Alex*0363             "EV7 (21364)")
f6a1b37d1 Alex*0364                 UNAME_MACHINE=alphaev7 ;;
c67a307b8 Alex*0365             "EV7.9 (21364A)")
f6a1b37d1 Alex*0366                 UNAME_MACHINE=alphaev79 ;;
c67a307b8 Alex*0367         esac
                0368         # A Pn.n version is a patched version.
87f48fcc7 Patr*0369         # A Vn.n version is a released version.
                0370         # A Tn.n version is a released field test version.
                0371         # A Xn.n version is an unreleased experimental baselevel.
                0372         # 1.2 uses "1.2" for uname -r.
b9f6d1be0 Alex*0373         OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
                0374         GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
                0375         ;;
87f48fcc7 Patr*0376     Amiga*:UNIX_System_V:4.0:*)
b9f6d1be0 Alex*0377         GUESS=m68k-unknown-sysv4
                0378         ;;
87f48fcc7 Patr*0379     *:[Aa]miga[Oo][Ss]:*:*)
b9f6d1be0 Alex*0380         GUESS=$UNAME_MACHINE-unknown-amigaos
                0381         ;;
fb2b1c85b Alex*0382     *:[Mm]orph[Oo][Ss]:*:*)
b9f6d1be0 Alex*0383         GUESS=$UNAME_MACHINE-unknown-morphos
                0384         ;;
87f48fcc7 Patr*0385     *:OS/390:*:*)
b9f6d1be0 Alex*0386         GUESS=i370-ibm-openedition
                0387         ;;
c67a307b8 Alex*0388     *:z/VM:*:*)
b9f6d1be0 Alex*0389         GUESS=s390-ibm-zvmoe
                0390         ;;
c67a307b8 Alex*0391     *:OS400:*:*)
b9f6d1be0 Alex*0392         GUESS=powerpc-ibm-os400
                0393         ;;
87f48fcc7 Patr*0394     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
b9f6d1be0 Alex*0395         GUESS=arm-acorn-riscix$UNAME_RELEASE
                0396         ;;
bd72767ee Andr*0397     arm*:riscos:*:*|arm*:RISCOS:*:*)
b9f6d1be0 Alex*0398         GUESS=arm-unknown-riscos
                0399         ;;
87f48fcc7 Patr*0400     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
b9f6d1be0 Alex*0401         GUESS=hppa1.1-hitachi-hiuxmpp
                0402         ;;
87f48fcc7 Patr*0403     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
                0404         # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
b9f6d1be0 Alex*0405         case `(/bin/universe) 2>/dev/null` in
                0406             att) GUESS=pyramid-pyramid-sysv3 ;;
                0407             *)   GUESS=pyramid-pyramid-bsd   ;;
                0408         esac
                0409         ;;
87f48fcc7 Patr*0410     NILE*:*:*:dcosx)
b9f6d1be0 Alex*0411         GUESS=pyramid-pyramid-svr4
                0412         ;;
c67a307b8 Alex*0413     DRS?6000:unix:4.0:6*)
b9f6d1be0 Alex*0414         GUESS=sparc-icl-nx6
                0415         ;;
c67a307b8 Alex*0416     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
4d9e7036b Alex*0417         case `/usr/bin/uname -p` in
b9f6d1be0 Alex*0418             sparc) GUESS=sparc-icl-nx7 ;;
                0419         esac
                0420         ;;
a4b314f48 Alex*0421     s390x:SunOS:*:*)
b9f6d1be0 Alex*0422         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
                0423         GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
                0424         ;;
87f48fcc7 Patr*0425     sun4H:SunOS:5.*:*)
b9f6d1be0 Alex*0426         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
                0427         GUESS=sparc-hal-solaris2$SUN_REL
                0428         ;;
87f48fcc7 Patr*0429     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
b9f6d1be0 Alex*0430         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
                0431         GUESS=sparc-sun-solaris2$SUN_REL
                0432         ;;
f00b8b9c1 Wolf*0433     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
b9f6d1be0 Alex*0434         GUESS=i386-pc-auroraux$UNAME_RELEASE
                0435         ;;
a4b314f48 Alex*0436     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
11bb6deb0 Mart*0437         set_cc_for_build
f6a1b37d1 Alex*0438         SUN_ARCH=i386
a4b314f48 Alex*0439         # If there is a compiler, see if it is configured for 64-bit objects.
                0440         # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
                0441         # This test works for both compilers.
b9f6d1be0 Alex*0442         if test "$CC_FOR_BUILD" != no_compiler_found; then
a4b314f48 Alex*0443             if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3aca59945 Alex*0444                 (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
a4b314f48 Alex*0445                 grep IS_64BIT_ARCH >/dev/null
                0446             then
f6a1b37d1 Alex*0447                 SUN_ARCH=x86_64
a4b314f48 Alex*0448             fi
                0449         fi
b9f6d1be0 Alex*0450         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
                0451         GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
                0452         ;;
87f48fcc7 Patr*0453     sun4*:SunOS:6*:*)
                0454         # According to config.sub, this is the proper way to canonicalize
                0455         # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
                0456         # it's likely to be more like Solaris than SunOS4.
b9f6d1be0 Alex*0457         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
                0458         GUESS=sparc-sun-solaris3$SUN_REL
                0459         ;;
87f48fcc7 Patr*0460     sun4*:SunOS:*:*)
b9f6d1be0 Alex*0461         case `/usr/bin/arch -k` in
87f48fcc7 Patr*0462             Series*|S4*)
                0463                 UNAME_RELEASE=`uname -v`
                0464                 ;;
                0465         esac
3aca59945 Alex*0466         # Japanese Language versions have a version number like '4.1.3-JL'.
b9f6d1be0 Alex*0467         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
                0468         GUESS=sparc-sun-sunos$SUN_REL
                0469         ;;
87f48fcc7 Patr*0470     sun3*:SunOS:*:*)
b9f6d1be0 Alex*0471         GUESS=m68k-sun-sunos$UNAME_RELEASE
                0472         ;;
87f48fcc7 Patr*0473     sun*:*:4.2BSD:*)
58faa1cf7 Alex*0474         UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
f6a1b37d1 Alex*0475         test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
b9f6d1be0 Alex*0476         case `/bin/arch` in
87f48fcc7 Patr*0477             sun3)
b9f6d1be0 Alex*0478                 GUESS=m68k-sun-sunos$UNAME_RELEASE
87f48fcc7 Patr*0479                 ;;
                0480             sun4)
b9f6d1be0 Alex*0481                 GUESS=sparc-sun-sunos$UNAME_RELEASE
87f48fcc7 Patr*0482                 ;;
                0483         esac
b9f6d1be0 Alex*0484         ;;
87f48fcc7 Patr*0485     aushp:SunOS:*:*)
b9f6d1be0 Alex*0486         GUESS=sparc-auspex-sunos$UNAME_RELEASE
                0487         ;;
87f48fcc7 Patr*0488     # The situation for MiNT is a little confusing.  The machine name
                0489     # can be virtually everything (everything which is not
                0490     # "atarist" or "atariste" at least should have a processor
                0491     # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
                0492     # to the lowercase version "mint" (or "freemint").  Finally
                0493     # the system name "TOS" denotes a system which is actually not
                0494     # MiNT.  But MiNT is downward compatible to TOS, so this should
                0495     # be no problem.
                0496     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
b9f6d1be0 Alex*0497         GUESS=m68k-atari-mint$UNAME_RELEASE
                0498         ;;
87f48fcc7 Patr*0499     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
b9f6d1be0 Alex*0500         GUESS=m68k-atari-mint$UNAME_RELEASE
                0501         ;;
87f48fcc7 Patr*0502     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
b9f6d1be0 Alex*0503         GUESS=m68k-atari-mint$UNAME_RELEASE
                0504         ;;
87f48fcc7 Patr*0505     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
b9f6d1be0 Alex*0506         GUESS=m68k-milan-mint$UNAME_RELEASE
                0507         ;;
87f48fcc7 Patr*0508     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
b9f6d1be0 Alex*0509         GUESS=m68k-hades-mint$UNAME_RELEASE
                0510         ;;
87f48fcc7 Patr*0511     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
b9f6d1be0 Alex*0512         GUESS=m68k-unknown-mint$UNAME_RELEASE
                0513         ;;
c67a307b8 Alex*0514     m68k:machten:*:*)
b9f6d1be0 Alex*0515         GUESS=m68k-apple-machten$UNAME_RELEASE
                0516         ;;
87f48fcc7 Patr*0517     powerpc:machten:*:*)
b9f6d1be0 Alex*0518         GUESS=powerpc-apple-machten$UNAME_RELEASE
                0519         ;;
87f48fcc7 Patr*0520     RISC*:Mach:*:*)
b9f6d1be0 Alex*0521         GUESS=mips-dec-mach_bsd4.3
                0522         ;;
87f48fcc7 Patr*0523     RISC*:ULTRIX:*:*)
b9f6d1be0 Alex*0524         GUESS=mips-dec-ultrix$UNAME_RELEASE
                0525         ;;
87f48fcc7 Patr*0526     VAX*:ULTRIX*:*:*)
b9f6d1be0 Alex*0527         GUESS=vax-dec-ultrix$UNAME_RELEASE
                0528         ;;
87f48fcc7 Patr*0529     2020:CLIX:*:* | 2430:CLIX:*:*)
b9f6d1be0 Alex*0530         GUESS=clipper-intergraph-clix$UNAME_RELEASE
                0531         ;;
87f48fcc7 Patr*0532     mips:*:*:UMIPS | mips:*:*:RISCos)
11bb6deb0 Mart*0533         set_cc_for_build
f6a1b37d1 Alex*0534         sed 's/^        //' << EOF > "$dummy.c"
87f48fcc7 Patr*0535 #ifdef __cplusplus
                0536 #include <stdio.h>  /* for printf() prototype */
                0537         int main (int argc, char *argv[]) {
                0538 #else
                0539         int main (argc, argv) int argc; char *argv[]; {
                0540 #endif
                0541         #if defined (host_mips) && defined (MIPSEB)
                0542         #if defined (SYSTYPE_SYSV)
f6a1b37d1 Alex*0543           printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
87f48fcc7 Patr*0544         #endif
                0545         #if defined (SYSTYPE_SVR4)
f6a1b37d1 Alex*0546           printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
87f48fcc7 Patr*0547         #endif
                0548         #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
f6a1b37d1 Alex*0549           printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
87f48fcc7 Patr*0550         #endif
                0551         #endif
                0552           exit (-1);
                0553         }
                0554 EOF
f6a1b37d1 Alex*0555         $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
                0556           dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
                0557           SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
5c0dde779 Alex*0558             { echo "$SYSTEM_NAME"; exit; }
b9f6d1be0 Alex*0559         GUESS=mips-mips-riscos$UNAME_RELEASE
                0560         ;;
87f48fcc7 Patr*0561     Motorola:PowerMAX_OS:*:*)
b9f6d1be0 Alex*0562         GUESS=powerpc-motorola-powermax
                0563         ;;
4d9e7036b Alex*0564     Motorola:*:4.3:PL8-*)
b9f6d1be0 Alex*0565         GUESS=powerpc-harris-powermax
                0566         ;;
4d9e7036b Alex*0567     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
b9f6d1be0 Alex*0568         GUESS=powerpc-harris-powermax
                0569         ;;
87f48fcc7 Patr*0570     Night_Hawk:Power_UNIX:*:*)
b9f6d1be0 Alex*0571         GUESS=powerpc-harris-powerunix
                0572         ;;
87f48fcc7 Patr*0573     m88k:CX/UX:7*:*)
b9f6d1be0 Alex*0574         GUESS=m88k-harris-cxux7
                0575         ;;
87f48fcc7 Patr*0576     m88k:*:4*:R4*)
b9f6d1be0 Alex*0577         GUESS=m88k-motorola-sysv4
                0578         ;;
87f48fcc7 Patr*0579     m88k:*:3*:R3*)
b9f6d1be0 Alex*0580         GUESS=m88k-motorola-sysv3
                0581         ;;
87f48fcc7 Patr*0582     AViiON:dgux:*:*)
2843d4f83 Andr*0583         # DG/UX returns AViiON for all architectures
                0584         UNAME_PROCESSOR=`/usr/bin/uname -p`
b9f6d1be0 Alex*0585         if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
87f48fcc7 Patr*0586         then
b9f6d1be0 Alex*0587             if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
                0588                test "$TARGET_BINARY_INTERFACE"x = x
87f48fcc7 Patr*0589             then
b9f6d1be0 Alex*0590                 GUESS=m88k-dg-dgux$UNAME_RELEASE
87f48fcc7 Patr*0591             else
b9f6d1be0 Alex*0592                 GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
87f48fcc7 Patr*0593             fi
                0594         else
b9f6d1be0 Alex*0595             GUESS=i586-dg-dgux$UNAME_RELEASE
87f48fcc7 Patr*0596         fi
b9f6d1be0 Alex*0597         ;;
87f48fcc7 Patr*0598     M88*:DolphinOS:*:*) # DolphinOS (SVR3)
b9f6d1be0 Alex*0599         GUESS=m88k-dolphin-sysv3
                0600         ;;
87f48fcc7 Patr*0601     M88*:*:R3*:*)
                0602         # Delta 88k system running SVR3
b9f6d1be0 Alex*0603         GUESS=m88k-motorola-sysv3
                0604         ;;
87f48fcc7 Patr*0605     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
b9f6d1be0 Alex*0606         GUESS=m88k-tektronix-sysv3
                0607         ;;
87f48fcc7 Patr*0608     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
b9f6d1be0 Alex*0609         GUESS=m68k-tektronix-bsd
                0610         ;;
87f48fcc7 Patr*0611     *:IRIX*:*:*)
b9f6d1be0 Alex*0612         IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
                0613         GUESS=mips-sgi-irix$IRIX_REL
                0614         ;;
87f48fcc7 Patr*0615     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
b9f6d1be0 Alex*0616         GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
                0617         ;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
87f48fcc7 Patr*0618     i*86:AIX:*:*)
b9f6d1be0 Alex*0619         GUESS=i386-ibm-aix
                0620         ;;
87f48fcc7 Patr*0621     ia64:AIX:*:*)
b9f6d1be0 Alex*0622         if test -x /usr/bin/oslevel ; then
87f48fcc7 Patr*0623                 IBM_REV=`/usr/bin/oslevel`
                0624         else
b9f6d1be0 Alex*0625                 IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
87f48fcc7 Patr*0626         fi
b9f6d1be0 Alex*0627         GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
                0628         ;;
87f48fcc7 Patr*0629     *:AIX:2:3)
                0630         if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
11bb6deb0 Mart*0631                 set_cc_for_build
f6a1b37d1 Alex*0632                 sed 's/^                //' << EOF > "$dummy.c"
87f48fcc7 Patr*0633                 #include <sys/systemcfg.h>
                0634 
                0635                 main()
                0636                         {
                0637                         if (!__power_pc())
                0638                                 exit(1);
                0639                         puts("powerpc-ibm-aix3.2.5");
                0640                         exit(0);
                0641                         }
                0642 EOF
f6a1b37d1 Alex*0643                 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
5c0dde779 Alex*0644                 then
b9f6d1be0 Alex*0645                         GUESS=$SYSTEM_NAME
5c0dde779 Alex*0646                 else
b9f6d1be0 Alex*0647                         GUESS=rs6000-ibm-aix3.2.5
5c0dde779 Alex*0648                 fi
87f48fcc7 Patr*0649         elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
b9f6d1be0 Alex*0650                 GUESS=rs6000-ibm-aix3.2.4
87f48fcc7 Patr*0651         else
b9f6d1be0 Alex*0652                 GUESS=rs6000-ibm-aix3.2
87f48fcc7 Patr*0653         fi
b9f6d1be0 Alex*0654         ;;
e6c8c6a54 Alex*0655     *:AIX:*:[4567])
58faa1cf7 Alex*0656         IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
f6a1b37d1 Alex*0657         if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
87f48fcc7 Patr*0658                 IBM_ARCH=rs6000
                0659         else
                0660                 IBM_ARCH=powerpc
                0661         fi
b9f6d1be0 Alex*0662         if test -x /usr/bin/lslpp ; then
                0663                 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
bf6c3a122 Alex*0664                            awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
87f48fcc7 Patr*0665         else
b9f6d1be0 Alex*0666                 IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
87f48fcc7 Patr*0667         fi
b9f6d1be0 Alex*0668         GUESS=$IBM_ARCH-ibm-aix$IBM_REV
                0669         ;;
87f48fcc7 Patr*0670     *:AIX:*:*)
b9f6d1be0 Alex*0671         GUESS=rs6000-ibm-aix
                0672         ;;
f6a1b37d1 Alex*0673     ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
b9f6d1be0 Alex*0674         GUESS=romp-ibm-bsd4.4
                0675         ;;
87f48fcc7 Patr*0676     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
b9f6d1be0 Alex*0677         GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
                0678         ;;                                  # report: romp-ibm BSD 4.3
87f48fcc7 Patr*0679     *:BOSX:*:*)
b9f6d1be0 Alex*0680         GUESS=rs6000-bull-bosx
                0681         ;;
87f48fcc7 Patr*0682     DPX/2?00:B.O.S.:*:*)
b9f6d1be0 Alex*0683         GUESS=m68k-bull-sysv3
                0684         ;;
87f48fcc7 Patr*0685     9000/[34]??:4.3bsd:1.*:*)
b9f6d1be0 Alex*0686         GUESS=m68k-hp-bsd
                0687         ;;
87f48fcc7 Patr*0688     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
b9f6d1be0 Alex*0689         GUESS=m68k-hp-bsd4.4
                0690         ;;
87f48fcc7 Patr*0691     9000/[34678]??:HP-UX:*:*)
b9f6d1be0 Alex*0692         HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
                0693         case $UNAME_MACHINE in
f6a1b37d1 Alex*0694             9000/31?)            HP_ARCH=m68000 ;;
                0695             9000/[34]??)         HP_ARCH=m68k ;;
87f48fcc7 Patr*0696             9000/[678][0-9][0-9])
b9f6d1be0 Alex*0697                 if test -x /usr/bin/getconf; then
fb2b1c85b Alex*0698                     sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
2843d4f83 Andr*0699                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
b9f6d1be0 Alex*0700                     case $sc_cpu_version in
f6a1b37d1 Alex*0701                       523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
                0702                       528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
2843d4f83 Andr*0703                       532)                      # CPU_PA_RISC2_0
b9f6d1be0 Alex*0704                         case $sc_kernel_bits in
f6a1b37d1 Alex*0705                           32) HP_ARCH=hppa2.0n ;;
                0706                           64) HP_ARCH=hppa2.0w ;;
                0707                           '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
2843d4f83 Andr*0708                         esac ;;
                0709                     esac
fb2b1c85b Alex*0710                 fi
b9f6d1be0 Alex*0711                 if test "$HP_ARCH" = ""; then
11bb6deb0 Mart*0712                     set_cc_for_build
f6a1b37d1 Alex*0713                     sed 's/^            //' << EOF > "$dummy.c"
87f48fcc7 Patr*0714 
2843d4f83 Andr*0715                 #define _HPUX_SOURCE
                0716                 #include <stdlib.h>
                0717                 #include <unistd.h>
87f48fcc7 Patr*0718 
2843d4f83 Andr*0719                 int main ()
                0720                 {
                0721                 #if defined(_SC_KERNEL_BITS)
                0722                     long bits = sysconf(_SC_KERNEL_BITS);
                0723                 #endif
                0724                     long cpu  = sysconf (_SC_CPU_VERSION);
87f48fcc7 Patr*0725 
2843d4f83 Andr*0726                     switch (cpu)
                0727                         {
                0728                         case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
                0729                         case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
                0730                         case CPU_PA_RISC2_0:
                0731                 #if defined(_SC_KERNEL_BITS)
                0732                             switch (bits)
                0733                                 {
                0734                                 case 64: puts ("hppa2.0w"); break;
                0735                                 case 32: puts ("hppa2.0n"); break;
                0736                                 default: puts ("hppa2.0"); break;
                0737                                 } break;
                0738                 #else  /* !defined(_SC_KERNEL_BITS) */
                0739                             puts ("hppa2.0"); break;
                0740                 #endif
                0741                         default: puts ("hppa1.0"); break;
                0742                         }
                0743                     exit (0);
                0744                 }
87f48fcc7 Patr*0745 EOF
f6a1b37d1 Alex*0746                     (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
c67a307b8 Alex*0747                     test -z "$HP_ARCH" && HP_ARCH=hppa
fb2b1c85b Alex*0748                 fi ;;
87f48fcc7 Patr*0749         esac
b9f6d1be0 Alex*0750         if test "$HP_ARCH" = hppa2.0w
c67a307b8 Alex*0751         then
11bb6deb0 Mart*0752             set_cc_for_build
5c0dde779 Alex*0753 
                0754             # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
                0755             # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
                0756             # generating 64-bit code.  GNU and HP use different nomenclature:
                0757             #
                0758             # $ CC_FOR_BUILD=cc ./config.guess
                0759             # => hppa2.0w-hp-hpux11.23
                0760             # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
                0761             # => hppa64-hp-hpux11.23
                0762 
f6a1b37d1 Alex*0763             if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
f00b8b9c1 Wolf*0764                 grep -q __LP64__
c67a307b8 Alex*0765             then
f6a1b37d1 Alex*0766                 HP_ARCH=hppa2.0w
c67a307b8 Alex*0767             else
f6a1b37d1 Alex*0768                 HP_ARCH=hppa64
c67a307b8 Alex*0769             fi
                0770         fi
b9f6d1be0 Alex*0771         GUESS=$HP_ARCH-hp-hpux$HPUX_REV
                0772         ;;
87f48fcc7 Patr*0773     ia64:HP-UX:*:*)
b9f6d1be0 Alex*0774         HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
                0775         GUESS=ia64-hp-hpux$HPUX_REV
                0776         ;;
87f48fcc7 Patr*0777     3050*:HI-UX:*:*)
11bb6deb0 Mart*0778         set_cc_for_build
f6a1b37d1 Alex*0779         sed 's/^        //' << EOF > "$dummy.c"
87f48fcc7 Patr*0780         #include <unistd.h>
                0781         int
                0782         main ()
                0783         {
                0784           long cpu = sysconf (_SC_CPU_VERSION);
                0785           /* The order matters, because CPU_IS_HP_MC68K erroneously returns
                0786              true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
                0787              results, however.  */
                0788           if (CPU_IS_PA_RISC (cpu))
                0789             {
                0790               switch (cpu)
                0791                 {
                0792                   case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
                0793                   case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
                0794                   case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
                0795                   default: puts ("hppa-hitachi-hiuxwe2"); break;
                0796                 }
                0797             }
                0798           else if (CPU_IS_HP_MC68K (cpu))
                0799             puts ("m68k-hitachi-hiuxwe2");
                0800           else puts ("unknown-hitachi-hiuxwe2");
                0801           exit (0);
                0802         }
                0803 EOF
f6a1b37d1 Alex*0804         $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
5c0dde779 Alex*0805                 { echo "$SYSTEM_NAME"; exit; }
b9f6d1be0 Alex*0806         GUESS=unknown-hitachi-hiuxwe2
                0807         ;;
f6a1b37d1 Alex*0808     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
b9f6d1be0 Alex*0809         GUESS=hppa1.1-hp-bsd
                0810         ;;
87f48fcc7 Patr*0811     9000/8??:4.3bsd:*:*)
b9f6d1be0 Alex*0812         GUESS=hppa1.0-hp-bsd
                0813         ;;
fb2b1c85b Alex*0814     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
b9f6d1be0 Alex*0815         GUESS=hppa1.0-hp-mpeix
                0816         ;;
f6a1b37d1 Alex*0817     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
b9f6d1be0 Alex*0818         GUESS=hppa1.1-hp-osf
                0819         ;;
87f48fcc7 Patr*0820     hp8??:OSF1:*:*)
b9f6d1be0 Alex*0821         GUESS=hppa1.0-hp-osf
                0822         ;;
87f48fcc7 Patr*0823     i*86:OSF1:*:*)
b9f6d1be0 Alex*0824         if test -x /usr/sbin/sysversion ; then
                0825             GUESS=$UNAME_MACHINE-unknown-osf1mk
87f48fcc7 Patr*0826         else
b9f6d1be0 Alex*0827             GUESS=$UNAME_MACHINE-unknown-osf1
87f48fcc7 Patr*0828         fi
b9f6d1be0 Alex*0829         ;;
87f48fcc7 Patr*0830     parisc*:Lites*:*:*)
b9f6d1be0 Alex*0831         GUESS=hppa1.1-hp-lites
                0832         ;;
87f48fcc7 Patr*0833     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
b9f6d1be0 Alex*0834         GUESS=c1-convex-bsd
                0835         ;;
87f48fcc7 Patr*0836     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
                0837         if getsysinfo -f scalar_acc
                0838         then echo c32-convex-bsd
                0839         else echo c2-convex-bsd
                0840         fi
2843d4f83 Andr*0841         exit ;;
87f48fcc7 Patr*0842     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
b9f6d1be0 Alex*0843         GUESS=c34-convex-bsd
                0844         ;;
87f48fcc7 Patr*0845     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
b9f6d1be0 Alex*0846         GUESS=c38-convex-bsd
                0847         ;;
87f48fcc7 Patr*0848     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
b9f6d1be0 Alex*0849         GUESS=c4-convex-bsd
                0850         ;;
87f48fcc7 Patr*0851     CRAY*Y-MP:*:*:*)
b9f6d1be0 Alex*0852         CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
                0853         GUESS=ymp-cray-unicos$CRAY_REL
                0854         ;;
87f48fcc7 Patr*0855     CRAY*[A-Z]90:*:*:*)
f6a1b37d1 Alex*0856         echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
87f48fcc7 Patr*0857         | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
fb2b1c85b Alex*0858               -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
                0859               -e 's/\.[^.]*$/.X/'
5c0dde779 Alex*0860         exit ;;
87f48fcc7 Patr*0861     CRAY*TS:*:*:*)
b9f6d1be0 Alex*0862         CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
                0863         GUESS=t90-cray-unicos$CRAY_REL
                0864         ;;
87f48fcc7 Patr*0865     CRAY*T3E:*:*:*)
b9f6d1be0 Alex*0866         CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
                0867         GUESS=alphaev5-cray-unicosmk$CRAY_REL
                0868         ;;
87f48fcc7 Patr*0869     CRAY*SV1:*:*:*)
b9f6d1be0 Alex*0870         CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
                0871         GUESS=sv1-cray-unicos$CRAY_REL
                0872         ;;
c67a307b8 Alex*0873     *:UNICOS/mp:*:*)
b9f6d1be0 Alex*0874         CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
                0875         GUESS=craynv-cray-unicosmp$CRAY_REL
                0876         ;;
87f48fcc7 Patr*0877     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
f6a1b37d1 Alex*0878         FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
                0879         FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
                0880         FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
b9f6d1be0 Alex*0881         GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
                0882         ;;
c67a307b8 Alex*0883     5000:UNIX_System_V:4.*:*)
f6a1b37d1 Alex*0884         FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
                0885         FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
b9f6d1be0 Alex*0886         GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
                0887         ;;
87f48fcc7 Patr*0888     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
b9f6d1be0 Alex*0889         GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
                0890         ;;
87f48fcc7 Patr*0891     sparc*:BSD/OS:*:*)
b9f6d1be0 Alex*0892         GUESS=sparc-unknown-bsdi$UNAME_RELEASE
                0893         ;;
87f48fcc7 Patr*0894     *:BSD/OS:*:*)
b9f6d1be0 Alex*0895         GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
                0896         ;;
11bb6deb0 Mart*0897     arm:FreeBSD:*:*)
                0898         UNAME_PROCESSOR=`uname -p`
                0899         set_cc_for_build
                0900         if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                0901             | grep -q __ARM_PCS_VFP
                0902         then
b9f6d1be0 Alex*0903             FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
                0904             GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
11bb6deb0 Mart*0905         else
b9f6d1be0 Alex*0906             FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
                0907             GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
11bb6deb0 Mart*0908         fi
b9f6d1be0 Alex*0909         ;;
87f48fcc7 Patr*0910     *:FreeBSD:*:*)
3aca59945 Alex*0911         UNAME_PROCESSOR=`uname -p`
b9f6d1be0 Alex*0912         case $UNAME_PROCESSOR in
5c0dde779 Alex*0913             amd64)
f6a1b37d1 Alex*0914                 UNAME_PROCESSOR=x86_64 ;;
                0915             i386)
                0916                 UNAME_PROCESSOR=i586 ;;
5c0dde779 Alex*0917         esac
b9f6d1be0 Alex*0918         FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
                0919         GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
                0920         ;;
87f48fcc7 Patr*0921     i*:CYGWIN*:*)
b9f6d1be0 Alex*0922         GUESS=$UNAME_MACHINE-pc-cygwin
                0923         ;;
bd72767ee Andr*0924     *:MINGW64*:*)
b9f6d1be0 Alex*0925         GUESS=$UNAME_MACHINE-pc-mingw64
                0926         ;;
aafc07086 Alex*0927     *:MINGW*:*)
b9f6d1be0 Alex*0928         GUESS=$UNAME_MACHINE-pc-mingw32
                0929         ;;
bf6c3a122 Alex*0930     *:MSYS*:*)
b9f6d1be0 Alex*0931         GUESS=$UNAME_MACHINE-pc-msys
                0932         ;;
87f48fcc7 Patr*0933     i*:PW*:*)
b9f6d1be0 Alex*0934         GUESS=$UNAME_MACHINE-pc-pw32
                0935         ;;
3aca59945 Alex*0936     *:SerenityOS:*:*)
                0937         GUESS=$UNAME_MACHINE-pc-serenity
                0938         ;;
f00b8b9c1 Wolf*0939     *:Interix*:*)
b9f6d1be0 Alex*0940         case $UNAME_MACHINE in
a4b314f48 Alex*0941             x86)
b9f6d1be0 Alex*0942                 GUESS=i586-pc-interix$UNAME_RELEASE
                0943                 ;;
f00b8b9c1 Wolf*0944             authenticamd | genuineintel | EM64T)
b9f6d1be0 Alex*0945                 GUESS=x86_64-unknown-interix$UNAME_RELEASE
                0946                 ;;
a4b314f48 Alex*0947             IA64)
b9f6d1be0 Alex*0948                 GUESS=ia64-unknown-interix$UNAME_RELEASE
                0949                 ;;
aafc07086 Alex*0950         esac ;;
87f48fcc7 Patr*0951     i*:UWIN*:*)
b9f6d1be0 Alex*0952         GUESS=$UNAME_MACHINE-pc-uwin
                0953         ;;
5c0dde779 Alex*0954     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
b9f6d1be0 Alex*0955         GUESS=x86_64-pc-cygwin
                0956         ;;
87f48fcc7 Patr*0957     prep*:SunOS:5.*:*)
b9f6d1be0 Alex*0958         SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
                0959         GUESS=powerpcle-unknown-solaris2$SUN_REL
                0960         ;;
87f48fcc7 Patr*0961     *:GNU:*:*)
c67a307b8 Alex*0962         # the GNU system
b9f6d1be0 Alex*0963         GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
                0964         GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
                0965         GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
                0966         ;;
c67a307b8 Alex*0967     *:GNU/*:*:*)
                0968         # other systems with GNU libc and userland
b9f6d1be0 Alex*0969         GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
                0970         GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
                0971         GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
                0972         ;;
3aca59945 Alex*0973     x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
                0974         GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
                0975         ;;
                0976     *:[Mm]anagarm:*:*)
                0977         GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
                0978         ;;
11bb6deb0 Mart*0979     *:Minix:*:*)
b9f6d1be0 Alex*0980         GUESS=$UNAME_MACHINE-unknown-minix
                0981         ;;
bd72767ee Andr*0982     aarch64:Linux:*:*)
3aca59945 Alex*0983         set_cc_for_build
                0984         CPU=$UNAME_MACHINE
                0985         LIBCABI=$LIBC
                0986         if test "$CC_FOR_BUILD" != no_compiler_found; then
                0987             ABI=64
                0988             sed 's/^        //' << EOF > "$dummy.c"
                0989             #ifdef __ARM_EABI__
                0990             #ifdef __ARM_PCS_VFP
                0991             ABI=eabihf
                0992             #else
                0993             ABI=eabi
                0994             #endif
                0995             #endif
                0996 EOF
                0997             cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
                0998             eval "$cc_set_abi"
                0999             case $ABI in
                1000                 eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
                1001             esac
                1002         fi
                1003         GUESS=$CPU-unknown-linux-$LIBCABI
b9f6d1be0 Alex*1004         ;;
bd72767ee Andr*1005     aarch64_be:Linux:*:*)
                1006         UNAME_MACHINE=aarch64_be
b9f6d1be0 Alex*1007         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1008         ;;
f00b8b9c1 Wolf*1009     alpha:Linux:*:*)
11bb6deb0 Mart*1010         case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
f00b8b9c1 Wolf*1011           EV5)   UNAME_MACHINE=alphaev5 ;;
                1012           EV56)  UNAME_MACHINE=alphaev56 ;;
                1013           PCA56) UNAME_MACHINE=alphapca56 ;;
                1014           PCA57) UNAME_MACHINE=alphapca56 ;;
                1015           EV6)   UNAME_MACHINE=alphaev6 ;;
                1016           EV67)  UNAME_MACHINE=alphaev67 ;;
                1017           EV68*) UNAME_MACHINE=alphaev68 ;;
2843d4f83 Andr*1018         esac
f00b8b9c1 Wolf*1019         objdump --private-headers /bin/sh | grep -q ld.so.1
f6a1b37d1 Alex*1020         if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
b9f6d1be0 Alex*1021         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1022         ;;
                1023     arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
                1024         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1025         ;;
87f48fcc7 Patr*1026     arm*:Linux:*:*)
11bb6deb0 Mart*1027         set_cc_for_build
a4b314f48 Alex*1028         if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
                1029             | grep -q __ARM_EABI__
                1030         then
b9f6d1be0 Alex*1031             GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
a4b314f48 Alex*1032         else
2843d4f83 Andr*1033             if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                1034                 | grep -q __ARM_PCS_VFP
                1035             then
b9f6d1be0 Alex*1036                 GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
2843d4f83 Andr*1037             else
b9f6d1be0 Alex*1038                 GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
2843d4f83 Andr*1039             fi
a4b314f48 Alex*1040         fi
b9f6d1be0 Alex*1041         ;;
aafc07086 Alex*1042     avr32*:Linux:*:*)
b9f6d1be0 Alex*1043         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1044         ;;
c67a307b8 Alex*1045     cris:Linux:*:*)
b9f6d1be0 Alex*1046         GUESS=$UNAME_MACHINE-axis-linux-$LIBC
                1047         ;;
c67a307b8 Alex*1048     crisv32:Linux:*:*)
b9f6d1be0 Alex*1049         GUESS=$UNAME_MACHINE-axis-linux-$LIBC
                1050         ;;
bf6c3a122 Alex*1051     e2k:Linux:*:*)
b9f6d1be0 Alex*1052         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1053         ;;
c67a307b8 Alex*1054     frv:Linux:*:*)
b9f6d1be0 Alex*1055         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1056         ;;
2843d4f83 Andr*1057     hexagon:Linux:*:*)
b9f6d1be0 Alex*1058         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1059         ;;
f00b8b9c1 Wolf*1060     i*86:Linux:*:*)
b9f6d1be0 Alex*1061         GUESS=$UNAME_MACHINE-pc-linux-$LIBC
                1062         ;;
87f48fcc7 Patr*1063     ia64:Linux:*:*)
b9f6d1be0 Alex*1064         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1065         ;;
f6a1b37d1 Alex*1066     k1om:Linux:*:*)
b9f6d1be0 Alex*1067         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1068         ;;
3aca59945 Alex*1069     kvx:Linux:*:*)
                1070         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1071         ;;
                1072     kvx:cos:*:*)
                1073         GUESS=$UNAME_MACHINE-unknown-cos
                1074         ;;
                1075     kvx:mbr:*:*)
                1076         GUESS=$UNAME_MACHINE-unknown-mbr
                1077         ;;
                1078     loongarch32:Linux:*:* | loongarch64:Linux:*:*)
b9f6d1be0 Alex*1079         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1080         ;;
c67a307b8 Alex*1081     m32r*:Linux:*:*)
b9f6d1be0 Alex*1082         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1083         ;;
87f48fcc7 Patr*1084     m68*:Linux:*:*)
b9f6d1be0 Alex*1085         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1086         ;;
f00b8b9c1 Wolf*1087     mips:Linux:*:* | mips64:Linux:*:*)
11bb6deb0 Mart*1088         set_cc_for_build
                1089         IS_GLIBC=0
                1090         test x"${LIBC}" = xgnu && IS_GLIBC=1
f6a1b37d1 Alex*1091         sed 's/^        //' << EOF > "$dummy.c"
4d9e7036b Alex*1092         #undef CPU
11bb6deb0 Mart*1093         #undef mips
                1094         #undef mipsel
                1095         #undef mips64
                1096         #undef mips64el
                1097         #if ${IS_GLIBC} && defined(_ABI64)
                1098         LIBCABI=gnuabi64
                1099         #else
                1100         #if ${IS_GLIBC} && defined(_ABIN32)
                1101         LIBCABI=gnuabin32
                1102         #else
                1103         LIBCABI=${LIBC}
                1104         #endif
                1105         #endif
                1106 
                1107         #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
                1108         CPU=mipsisa64r6
                1109         #else
                1110         #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
                1111         CPU=mipsisa32r6
                1112         #else
                1113         #if defined(__mips64)
                1114         CPU=mips64
                1115         #else
                1116         CPU=mips
                1117         #endif
                1118         #endif
                1119         #endif
                1120 
4d9e7036b Alex*1121         #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
11bb6deb0 Mart*1122         MIPS_ENDIAN=el
4d9e7036b Alex*1123         #else
                1124         #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
11bb6deb0 Mart*1125         MIPS_ENDIAN=
4d9e7036b Alex*1126         #else
11bb6deb0 Mart*1127         MIPS_ENDIAN=
4d9e7036b Alex*1128         #endif
                1129         #endif
                1130 EOF
b9f6d1be0 Alex*1131         cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
                1132         eval "$cc_set_vars"
11bb6deb0 Mart*1133         test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
87f48fcc7 Patr*1134         ;;
f6a1b37d1 Alex*1135     mips64el:Linux:*:*)
b9f6d1be0 Alex*1136         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1137         ;;
bf6c3a122 Alex*1138     openrisc*:Linux:*:*)
b9f6d1be0 Alex*1139         GUESS=or1k-unknown-linux-$LIBC
                1140         ;;
bf6c3a122 Alex*1141     or32:Linux:*:* | or1k*:Linux:*:*)
b9f6d1be0 Alex*1142         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1143         ;;
a4b314f48 Alex*1144     padre:Linux:*:*)
b9f6d1be0 Alex*1145         GUESS=sparc-unknown-linux-$LIBC
                1146         ;;
f00b8b9c1 Wolf*1147     parisc64:Linux:*:* | hppa64:Linux:*:*)
b9f6d1be0 Alex*1148         GUESS=hppa64-unknown-linux-$LIBC
                1149         ;;
87f48fcc7 Patr*1150     parisc:Linux:*:* | hppa:Linux:*:*)
                1151         # Look for CPU level
                1152         case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
b9f6d1be0 Alex*1153           PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
                1154           PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
                1155           *)    GUESS=hppa-unknown-linux-$LIBC ;;
87f48fcc7 Patr*1156         esac
b9f6d1be0 Alex*1157         ;;
f00b8b9c1 Wolf*1158     ppc64:Linux:*:*)
b9f6d1be0 Alex*1159         GUESS=powerpc64-unknown-linux-$LIBC
                1160         ;;
f00b8b9c1 Wolf*1161     ppc:Linux:*:*)
b9f6d1be0 Alex*1162         GUESS=powerpc-unknown-linux-$LIBC
                1163         ;;
bf6c3a122 Alex*1164     ppc64le:Linux:*:*)
b9f6d1be0 Alex*1165         GUESS=powerpc64le-unknown-linux-$LIBC
                1166         ;;
bf6c3a122 Alex*1167     ppcle:Linux:*:*)
b9f6d1be0 Alex*1168         GUESS=powerpcle-unknown-linux-$LIBC
                1169         ;;
                1170     riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
                1171         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1172         ;;
87f48fcc7 Patr*1173     s390:Linux:*:* | s390x:Linux:*:*)
b9f6d1be0 Alex*1174         GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
                1175         ;;
c67a307b8 Alex*1176     sh64*:Linux:*:*)
b9f6d1be0 Alex*1177         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1178         ;;
87f48fcc7 Patr*1179     sh*:Linux:*:*)
b9f6d1be0 Alex*1180         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1181         ;;
87f48fcc7 Patr*1182     sparc:Linux:*:* | sparc64:Linux:*:*)
b9f6d1be0 Alex*1183         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1184         ;;
e6c8c6a54 Alex*1185     tile*:Linux:*:*)
b9f6d1be0 Alex*1186         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1187         ;;
5c0dde779 Alex*1188     vax:Linux:*:*)
b9f6d1be0 Alex*1189         GUESS=$UNAME_MACHINE-dec-linux-$LIBC
                1190         ;;
87f48fcc7 Patr*1191     x86_64:Linux:*:*)
11bb6deb0 Mart*1192         set_cc_for_build
3aca59945 Alex*1193         CPU=$UNAME_MACHINE
11bb6deb0 Mart*1194         LIBCABI=$LIBC
b9f6d1be0 Alex*1195         if test "$CC_FOR_BUILD" != no_compiler_found; then
3aca59945 Alex*1196             ABI=64
                1197             sed 's/^        //' << EOF > "$dummy.c"
                1198             #ifdef __i386__
                1199             ABI=x86
                1200             #else
                1201             #ifdef __ILP32__
                1202             ABI=x32
                1203             #endif
                1204             #endif
                1205 EOF
                1206             cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
                1207             eval "$cc_set_abi"
                1208             case $ABI in
                1209                 x86) CPU=i686 ;;
                1210                 x32) LIBCABI=${LIBC}x32 ;;
                1211             esac
f6a1b37d1 Alex*1212         fi
3aca59945 Alex*1213         GUESS=$CPU-pc-linux-$LIBCABI
b9f6d1be0 Alex*1214         ;;
a4b314f48 Alex*1215     xtensa*:Linux:*:*)
b9f6d1be0 Alex*1216         GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
                1217         ;;
87f48fcc7 Patr*1218     i*86:DYNIX/ptx:4*:*)
fb2b1c85b Alex*1219         # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
                1220         # earlier versions are messed up and put the nodename in both
                1221         # sysname and nodename.
b9f6d1be0 Alex*1222         GUESS=i386-sequent-sysv4
                1223         ;;
87f48fcc7 Patr*1224     i*86:UNIX_SV:4.2MP:2.*)
2843d4f83 Andr*1225         # Unixware is an offshoot of SVR4, but it has its own version
                1226         # number series starting with 2...
                1227         # I am not positive that other SVR4 systems won't match this,
87f48fcc7 Patr*1228         # I just have to hope.  -- rms.
2843d4f83 Andr*1229         # Use sysv4.2uw... so that sysv4* matches it.
b9f6d1be0 Alex*1230         GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
                1231         ;;
4d9e7036b Alex*1232     i*86:OS/2:*:*)
3aca59945 Alex*1233         # If we were able to find 'uname', then EMX Unix compatibility
4d9e7036b Alex*1234         # is probably installed.
b9f6d1be0 Alex*1235         GUESS=$UNAME_MACHINE-pc-os2-emx
                1236         ;;
4d9e7036b Alex*1237     i*86:XTS-300:*:STOP)
b9f6d1be0 Alex*1238         GUESS=$UNAME_MACHINE-unknown-stop
                1239         ;;
4d9e7036b Alex*1240     i*86:atheos:*:*)
b9f6d1be0 Alex*1241         GUESS=$UNAME_MACHINE-unknown-atheos
                1242         ;;
5c0dde779 Alex*1243     i*86:syllable:*:*)
b9f6d1be0 Alex*1244         GUESS=$UNAME_MACHINE-pc-syllable
                1245         ;;
f00b8b9c1 Wolf*1246     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
b9f6d1be0 Alex*1247         GUESS=i386-unknown-lynxos$UNAME_RELEASE
                1248         ;;
4d9e7036b Alex*1249     i*86:*DOS:*:*)
b9f6d1be0 Alex*1250         GUESS=$UNAME_MACHINE-pc-msdosdjgpp
                1251         ;;
f6a1b37d1 Alex*1252     i*86:*:4.*:*)
                1253         UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
87f48fcc7 Patr*1254         if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
b9f6d1be0 Alex*1255                 GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
87f48fcc7 Patr*1256         else
b9f6d1be0 Alex*1257                 GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
87f48fcc7 Patr*1258         fi
b9f6d1be0 Alex*1259         ;;
5c0dde779 Alex*1260     i*86:*:5:[678]*)
2843d4f83 Andr*1261         # UnixWare 7.x, OpenUNIX and OpenServer 6.
fb2b1c85b Alex*1262         case `/bin/uname -X | grep "^Machine"` in
87f48fcc7 Patr*1263             *486*)           UNAME_MACHINE=i486 ;;
fb2b1c85b Alex*1264             *Pentium)        UNAME_MACHINE=i586 ;;
87f48fcc7 Patr*1265             *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
                1266         esac
b9f6d1be0 Alex*1267         GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
                1268         ;;
87f48fcc7 Patr*1269     i*86:*:3.2:*)
                1270         if test -f /usr/options/cb.name; then
                1271                 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
b9f6d1be0 Alex*1272                 GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
87f48fcc7 Patr*1273         elif /bin/uname -X 2>/dev/null >/dev/null ; then
4d9e7036b Alex*1274                 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
                1275                 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
                1276                 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
87f48fcc7 Patr*1277                         && UNAME_MACHINE=i586
4d9e7036b Alex*1278                 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
87f48fcc7 Patr*1279                         && UNAME_MACHINE=i686
4d9e7036b Alex*1280                 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
87f48fcc7 Patr*1281                         && UNAME_MACHINE=i686
b9f6d1be0 Alex*1282                 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
87f48fcc7 Patr*1283         else
b9f6d1be0 Alex*1284                 GUESS=$UNAME_MACHINE-pc-sysv32
87f48fcc7 Patr*1285         fi
b9f6d1be0 Alex*1286         ;;
87f48fcc7 Patr*1287     pc:*:*:*)
                1288         # Left here for compatibility:
2843d4f83 Andr*1289         # uname -m prints for DJGPP always 'pc', but it prints nothing about
                1290         # the processor, so we play safe by assuming i586.
a4b314f48 Alex*1291         # Note: whatever this is, it MUST be the same as what config.sub
f6a1b37d1 Alex*1292         # prints for the "djgpp" host, or else GDB configure will decide that
a4b314f48 Alex*1293         # this is a cross-build.
b9f6d1be0 Alex*1294         GUESS=i586-pc-msdosdjgpp
                1295         ;;
87f48fcc7 Patr*1296     Intel:Mach:3*:*)
b9f6d1be0 Alex*1297         GUESS=i386-pc-mach3
                1298         ;;
87f48fcc7 Patr*1299     paragon:*:*:*)
b9f6d1be0 Alex*1300         GUESS=i860-intel-osf1
                1301         ;;
87f48fcc7 Patr*1302     i860:*:4.*:*) # i860-SVR4
                1303         if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
b9f6d1be0 Alex*1304           GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
87f48fcc7 Patr*1305         else # Add other i860-SVR4 vendors below as they are discovered.
b9f6d1be0 Alex*1306           GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
87f48fcc7 Patr*1307         fi
b9f6d1be0 Alex*1308         ;;
87f48fcc7 Patr*1309     mini*:CTIX:SYS*5:*)
                1310         # "miniframe"
b9f6d1be0 Alex*1311         GUESS=m68010-convergent-sysv
                1312         ;;
4d9e7036b Alex*1313     mc68k:UNIX:SYSTEM5:3.51m)
b9f6d1be0 Alex*1314         GUESS=m68k-convergent-sysv
                1315         ;;
4d9e7036b Alex*1316     M680?0:D-NIX:5.3:*)
b9f6d1be0 Alex*1317         GUESS=m68k-diab-dnix
                1318         ;;
c67a307b8 Alex*1319     M68*:*:R3V[5678]*:*)
5c0dde779 Alex*1320         test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
c67a307b8 Alex*1321     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
87f48fcc7 Patr*1322         OS_REL=''
                1323         test -r /etc/.relid \
                1324         && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
                1325         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
f6a1b37d1 Alex*1326           && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
87f48fcc7 Patr*1327         /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
f6a1b37d1 Alex*1328           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
87f48fcc7 Patr*1329     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
2843d4f83 Andr*1330         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
                1331           && { echo i486-ncr-sysv4; exit; } ;;
a4b314f48 Alex*1332     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
                1333         OS_REL='.3'
                1334         test -r /etc/.relid \
                1335             && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
                1336         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
f6a1b37d1 Alex*1337             && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
a4b314f48 Alex*1338         /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
f6a1b37d1 Alex*1339             && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
a4b314f48 Alex*1340         /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
f6a1b37d1 Alex*1341             && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
87f48fcc7 Patr*1342     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
b9f6d1be0 Alex*1343         GUESS=m68k-unknown-lynxos$UNAME_RELEASE
                1344         ;;
87f48fcc7 Patr*1345     mc68030:UNIX_System_V:4.*:*)
b9f6d1be0 Alex*1346         GUESS=m68k-atari-sysv4
                1347         ;;
87f48fcc7 Patr*1348     TSUNAMI:LynxOS:2.*:*)
b9f6d1be0 Alex*1349         GUESS=sparc-unknown-lynxos$UNAME_RELEASE
                1350         ;;
87f48fcc7 Patr*1351     rs6000:LynxOS:2.*:*)
b9f6d1be0 Alex*1352         GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
                1353         ;;
f00b8b9c1 Wolf*1354     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
b9f6d1be0 Alex*1355         GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
                1356         ;;
87f48fcc7 Patr*1357     SM[BE]S:UNIX_SV:*:*)
b9f6d1be0 Alex*1358         GUESS=mips-dde-sysv$UNAME_RELEASE
                1359         ;;
87f48fcc7 Patr*1360     RM*:ReliantUNIX-*:*:*)
b9f6d1be0 Alex*1361         GUESS=mips-sni-sysv4
                1362         ;;
87f48fcc7 Patr*1363     RM*:SINIX-*:*:*)
b9f6d1be0 Alex*1364         GUESS=mips-sni-sysv4
                1365         ;;
87f48fcc7 Patr*1366     *:SINIX-*:*:*)
                1367         if uname -p 2>/dev/null >/dev/null ; then
                1368                 UNAME_MACHINE=`(uname -p) 2>/dev/null`
b9f6d1be0 Alex*1369                 GUESS=$UNAME_MACHINE-sni-sysv4
87f48fcc7 Patr*1370         else
b9f6d1be0 Alex*1371                 GUESS=ns32k-sni-sysv
87f48fcc7 Patr*1372         fi
b9f6d1be0 Alex*1373         ;;
3aca59945 Alex*1374     PENTIUM:*:4.0*:*)   # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
2843d4f83 Andr*1375                         # says <Richard.M.Bartel@ccMail.Census.GOV>
b9f6d1be0 Alex*1376         GUESS=i586-unisys-sysv4
                1377         ;;
87f48fcc7 Patr*1378     *:UNIX_System_V:4*:FTX*)
                1379         # From Gerald Hewes <hewes@openmarket.com>.
                1380         # How about differentiating between stratus architectures? -djm
b9f6d1be0 Alex*1381         GUESS=hppa1.1-stratus-sysv4
                1382         ;;
87f48fcc7 Patr*1383     *:*:*:FTX*)
                1384         # From seanf@swdc.stratus.com.
b9f6d1be0 Alex*1385         GUESS=i860-stratus-sysv4
                1386         ;;
5c0dde779 Alex*1387     i*86:VOS:*:*)
                1388         # From Paul.Green@stratus.com.
b9f6d1be0 Alex*1389         GUESS=$UNAME_MACHINE-stratus-vos
                1390         ;;
fb2b1c85b Alex*1391     *:VOS:*:*)
                1392         # From Paul.Green@stratus.com.
b9f6d1be0 Alex*1393         GUESS=hppa1.1-stratus-vos
                1394         ;;
87f48fcc7 Patr*1395     mc68*:A/UX:*:*)
b9f6d1be0 Alex*1396         GUESS=m68k-apple-aux$UNAME_RELEASE
                1397         ;;
87f48fcc7 Patr*1398     news*:NEWS-OS:6*:*)
b9f6d1be0 Alex*1399         GUESS=mips-sony-newsos6
                1400         ;;
87f48fcc7 Patr*1401     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
b9f6d1be0 Alex*1402         if test -d /usr/nec; then
                1403                 GUESS=mips-nec-sysv$UNAME_RELEASE
87f48fcc7 Patr*1404         else
b9f6d1be0 Alex*1405                 GUESS=mips-unknown-sysv$UNAME_RELEASE
87f48fcc7 Patr*1406         fi
b9f6d1be0 Alex*1407         ;;
87f48fcc7 Patr*1408     BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
b9f6d1be0 Alex*1409         GUESS=powerpc-be-beos
                1410         ;;
87f48fcc7 Patr*1411     BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
b9f6d1be0 Alex*1412         GUESS=powerpc-apple-beos
                1413         ;;
87f48fcc7 Patr*1414     BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
b9f6d1be0 Alex*1415         GUESS=i586-pc-beos
                1416         ;;
a4b314f48 Alex*1417     BePC:Haiku:*:*)     # Haiku running on Intel PC compatible.
b9f6d1be0 Alex*1418         GUESS=i586-pc-haiku
                1419         ;;
3aca59945 Alex*1420     ppc:Haiku:*:*)      # Haiku running on Apple PowerPC
                1421         GUESS=powerpc-apple-haiku
                1422         ;;
                1423     *:Haiku:*:*)        # Haiku modern gcc (not bound by BeOS compat)
                1424         GUESS=$UNAME_MACHINE-unknown-haiku
b9f6d1be0 Alex*1425         ;;
87f48fcc7 Patr*1426     SX-4:SUPER-UX:*:*)
b9f6d1be0 Alex*1427         GUESS=sx4-nec-superux$UNAME_RELEASE
                1428         ;;
87f48fcc7 Patr*1429     SX-5:SUPER-UX:*:*)
b9f6d1be0 Alex*1430         GUESS=sx5-nec-superux$UNAME_RELEASE
                1431         ;;
4d9e7036b Alex*1432     SX-6:SUPER-UX:*:*)
b9f6d1be0 Alex*1433         GUESS=sx6-nec-superux$UNAME_RELEASE
                1434         ;;
aafc07086 Alex*1435     SX-7:SUPER-UX:*:*)
b9f6d1be0 Alex*1436         GUESS=sx7-nec-superux$UNAME_RELEASE
                1437         ;;
aafc07086 Alex*1438     SX-8:SUPER-UX:*:*)
b9f6d1be0 Alex*1439         GUESS=sx8-nec-superux$UNAME_RELEASE
                1440         ;;
aafc07086 Alex*1441     SX-8R:SUPER-UX:*:*)
b9f6d1be0 Alex*1442         GUESS=sx8r-nec-superux$UNAME_RELEASE
                1443         ;;
f6a1b37d1 Alex*1444     SX-ACE:SUPER-UX:*:*)
b9f6d1be0 Alex*1445         GUESS=sxace-nec-superux$UNAME_RELEASE
                1446         ;;
87f48fcc7 Patr*1447     Power*:Rhapsody:*:*)
b9f6d1be0 Alex*1448         GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
                1449         ;;
87f48fcc7 Patr*1450     *:Rhapsody:*:*)
b9f6d1be0 Alex*1451         GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
                1452         ;;
11bb6deb0 Mart*1453     arm64:Darwin:*:*)
b9f6d1be0 Alex*1454         GUESS=aarch64-apple-darwin$UNAME_RELEASE
                1455         ;;
87f48fcc7 Patr*1456     *:Darwin:*:*)
11bb6deb0 Mart*1457         UNAME_PROCESSOR=`uname -p`
                1458         case $UNAME_PROCESSOR in
                1459             unknown) UNAME_PROCESSOR=powerpc ;;
                1460         esac
                1461         if command -v xcode-select > /dev/null 2> /dev/null && \
                1462                 ! xcode-select --print-path > /dev/null 2> /dev/null ; then
                1463             # Avoid executing cc if there is no toolchain installed as
                1464             # cc will be a stub that puts up a graphical alert
                1465             # prompting the user to install developer tools.
                1466             CC_FOR_BUILD=no_compiler_found
                1467         else
                1468             set_cc_for_build
bf6c3a122 Alex*1469         fi
b9f6d1be0 Alex*1470         if test "$CC_FOR_BUILD" != no_compiler_found; then
11bb6deb0 Mart*1471             if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
                1472                    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
                1473                    grep IS_64BIT_ARCH >/dev/null
                1474             then
                1475                 case $UNAME_PROCESSOR in
                1476                     i386) UNAME_PROCESSOR=x86_64 ;;
                1477                     powerpc) UNAME_PROCESSOR=powerpc64 ;;
                1478                 esac
                1479             fi
                1480             # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
                1481             if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
                1482                    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
                1483                    grep IS_PPC >/dev/null
                1484             then
                1485                 UNAME_PROCESSOR=powerpc
bf6c3a122 Alex*1486             fi
                1487         elif test "$UNAME_PROCESSOR" = i386 ; then
11bb6deb0 Mart*1488             # uname -m returns i386 or x86_64
                1489             UNAME_PROCESSOR=$UNAME_MACHINE
bf6c3a122 Alex*1490         fi
b9f6d1be0 Alex*1491         GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
                1492         ;;
87f48fcc7 Patr*1493     *:procnto*:*:* | *:QNX:[0123456789]*:*)
58faa1cf7 Alex*1494         UNAME_PROCESSOR=`uname -p`
f6a1b37d1 Alex*1495         if test "$UNAME_PROCESSOR" = x86; then
58faa1cf7 Alex*1496                 UNAME_PROCESSOR=i386
87f48fcc7 Patr*1497                 UNAME_MACHINE=pc
                1498         fi
b9f6d1be0 Alex*1499         GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
                1500         ;;
87f48fcc7 Patr*1501     *:QNX:*:4*)
b9f6d1be0 Alex*1502         GUESS=i386-pc-qnx
                1503         ;;
f6a1b37d1 Alex*1504     NEO-*:NONSTOP_KERNEL:*:*)
b9f6d1be0 Alex*1505         GUESS=neo-tandem-nsk$UNAME_RELEASE
                1506         ;;
bd72767ee Andr*1507     NSE-*:NONSTOP_KERNEL:*:*)
b9f6d1be0 Alex*1508         GUESS=nse-tandem-nsk$UNAME_RELEASE
                1509         ;;
f6a1b37d1 Alex*1510     NSR-*:NONSTOP_KERNEL:*:*)
b9f6d1be0 Alex*1511         GUESS=nsr-tandem-nsk$UNAME_RELEASE
                1512         ;;
f6a1b37d1 Alex*1513     NSV-*:NONSTOP_KERNEL:*:*)
b9f6d1be0 Alex*1514         GUESS=nsv-tandem-nsk$UNAME_RELEASE
                1515         ;;
f6a1b37d1 Alex*1516     NSX-*:NONSTOP_KERNEL:*:*)
b9f6d1be0 Alex*1517         GUESS=nsx-tandem-nsk$UNAME_RELEASE
                1518         ;;
87f48fcc7 Patr*1519     *:NonStop-UX:*:*)
b9f6d1be0 Alex*1520         GUESS=mips-compaq-nonstopux
                1521         ;;
87f48fcc7 Patr*1522     BS2000:POSIX*:*:*)
b9f6d1be0 Alex*1523         GUESS=bs2000-siemens-sysv
                1524         ;;
87f48fcc7 Patr*1525     DS/*:UNIX_System_V:*:*)
b9f6d1be0 Alex*1526         GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
                1527         ;;
87f48fcc7 Patr*1528     *:Plan9:*:*)
                1529         # "uname -m" is not consistent, so use $cputype instead. 386
                1530         # is converted to i386 for consistency with other x86
                1531         # operating systems.
b9f6d1be0 Alex*1532         if test "${cputype-}" = 386; then
87f48fcc7 Patr*1533             UNAME_MACHINE=i386
b9f6d1be0 Alex*1534         elif test "x${cputype-}" != x; then
                1535             UNAME_MACHINE=$cputype
87f48fcc7 Patr*1536         fi
b9f6d1be0 Alex*1537         GUESS=$UNAME_MACHINE-unknown-plan9
                1538         ;;
87f48fcc7 Patr*1539     *:TOPS-10:*:*)
b9f6d1be0 Alex*1540         GUESS=pdp10-unknown-tops10
                1541         ;;
87f48fcc7 Patr*1542     *:TENEX:*:*)
b9f6d1be0 Alex*1543         GUESS=pdp10-unknown-tenex
                1544         ;;
87f48fcc7 Patr*1545     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
b9f6d1be0 Alex*1546         GUESS=pdp10-dec-tops20
                1547         ;;
87f48fcc7 Patr*1548     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
b9f6d1be0 Alex*1549         GUESS=pdp10-xkl-tops20
                1550         ;;
87f48fcc7 Patr*1551     *:TOPS-20:*:*)
b9f6d1be0 Alex*1552         GUESS=pdp10-unknown-tops20
                1553         ;;
87f48fcc7 Patr*1554     *:ITS:*:*)
b9f6d1be0 Alex*1555         GUESS=pdp10-unknown-its
                1556         ;;
c67a307b8 Alex*1557     SEI:*:*:SEIUX)
b9f6d1be0 Alex*1558         GUESS=mips-sei-seiux$UNAME_RELEASE
                1559         ;;
c67a307b8 Alex*1560     *:DragonFly:*:*)
b9f6d1be0 Alex*1561         DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
                1562         GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
                1563         ;;
c67a307b8 Alex*1564     *:*VMS:*:*)
2843d4f83 Andr*1565         UNAME_MACHINE=`(uname -p) 2>/dev/null`
b9f6d1be0 Alex*1566         case $UNAME_MACHINE in
                1567             A*) GUESS=alpha-dec-vms ;;
                1568             I*) GUESS=ia64-dec-vms ;;
                1569             V*) GUESS=vax-dec-vms ;;
c67a307b8 Alex*1570         esac ;;
                1571     *:XENIX:*:SysV)
b9f6d1be0 Alex*1572         GUESS=i386-pc-xenix
                1573         ;;
5c0dde779 Alex*1574     i*86:skyos:*:*)
b9f6d1be0 Alex*1575         SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
                1576         GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
                1577         ;;
5c0dde779 Alex*1578     i*86:rdos:*:*)
b9f6d1be0 Alex*1579         GUESS=$UNAME_MACHINE-pc-rdos
                1580         ;;
3aca59945 Alex*1581     i*86:Fiwix:*:*)
                1582         GUESS=$UNAME_MACHINE-pc-fiwix
                1583         ;;
b9f6d1be0 Alex*1584     *:AROS:*:*)
                1585         GUESS=$UNAME_MACHINE-unknown-aros
                1586         ;;
bd72767ee Andr*1587     x86_64:VMkernel:*:*)
b9f6d1be0 Alex*1588         GUESS=$UNAME_MACHINE-unknown-esx
                1589         ;;
f6a1b37d1 Alex*1590     amd64:Isilon\ OneFS:*:*)
b9f6d1be0 Alex*1591         GUESS=x86_64-unknown-onefs
                1592         ;;
11bb6deb0 Mart*1593     *:Unleashed:*:*)
b9f6d1be0 Alex*1594         GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
                1595         ;;
87f48fcc7 Patr*1596 esac
                1597 
b9f6d1be0 Alex*1598 # Do we have a guess based on uname results?
                1599 if test "x$GUESS" != x; then
                1600     echo "$GUESS"
                1601     exit
                1602 fi
                1603 
11bb6deb0 Mart*1604 # No uname command or uname output not recognized.
                1605 set_cc_for_build
                1606 cat > "$dummy.c" <<EOF
                1607 #ifdef _SEQUENT_
                1608 #include <sys/types.h>
                1609 #include <sys/utsname.h>
                1610 #endif
                1611 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
                1612 #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
                1613 #include <signal.h>
                1614 #if defined(_SIZE_T_) || defined(SIGLOST)
                1615 #include <sys/utsname.h>
                1616 #endif
                1617 #endif
                1618 #endif
                1619 main ()
                1620 {
                1621 #if defined (sony)
                1622 #if defined (MIPSEB)
                1623   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
                1624      I don't know....  */
                1625   printf ("mips-sony-bsd\n"); exit (0);
                1626 #else
                1627 #include <sys/param.h>
                1628   printf ("m68k-sony-newsos%s\n",
                1629 #ifdef NEWSOS4
                1630   "4"
                1631 #else
                1632   ""
                1633 #endif
                1634   ); exit (0);
                1635 #endif
                1636 #endif
                1637 
                1638 #if defined (NeXT)
                1639 #if !defined (__ARCHITECTURE__)
                1640 #define __ARCHITECTURE__ "m68k"
                1641 #endif
                1642   int version;
                1643   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
                1644   if (version < 4)
                1645     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
                1646   else
                1647     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
                1648   exit (0);
                1649 #endif
                1650 
                1651 #if defined (MULTIMAX) || defined (n16)
                1652 #if defined (UMAXV)
                1653   printf ("ns32k-encore-sysv\n"); exit (0);
                1654 #else
                1655 #if defined (CMU)
                1656   printf ("ns32k-encore-mach\n"); exit (0);
                1657 #else
                1658   printf ("ns32k-encore-bsd\n"); exit (0);
                1659 #endif
                1660 #endif
                1661 #endif
                1662 
                1663 #if defined (__386BSD__)
                1664   printf ("i386-pc-bsd\n"); exit (0);
                1665 #endif
                1666 
                1667 #if defined (sequent)
                1668 #if defined (i386)
                1669   printf ("i386-sequent-dynix\n"); exit (0);
                1670 #endif
                1671 #if defined (ns32000)
                1672   printf ("ns32k-sequent-dynix\n"); exit (0);
                1673 #endif
                1674 #endif
                1675 
                1676 #if defined (_SEQUENT_)
                1677   struct utsname un;
                1678 
                1679   uname(&un);
                1680   if (strncmp(un.version, "V2", 2) == 0) {
                1681     printf ("i386-sequent-ptx2\n"); exit (0);
                1682   }
                1683   if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
                1684     printf ("i386-sequent-ptx1\n"); exit (0);
                1685   }
                1686   printf ("i386-sequent-ptx\n"); exit (0);
                1687 #endif
                1688 
                1689 #if defined (vax)
                1690 #if !defined (ultrix)
                1691 #include <sys/param.h>
                1692 #if defined (BSD)
                1693 #if BSD == 43
                1694   printf ("vax-dec-bsd4.3\n"); exit (0);
                1695 #else
                1696 #if BSD == 199006
                1697   printf ("vax-dec-bsd4.3reno\n"); exit (0);
                1698 #else
                1699   printf ("vax-dec-bsd\n"); exit (0);
                1700 #endif
                1701 #endif
                1702 #else
                1703   printf ("vax-dec-bsd\n"); exit (0);
                1704 #endif
                1705 #else
                1706 #if defined(_SIZE_T_) || defined(SIGLOST)
                1707   struct utsname un;
                1708   uname (&un);
                1709   printf ("vax-dec-ultrix%s\n", un.release); exit (0);
                1710 #else
                1711   printf ("vax-dec-ultrix\n"); exit (0);
                1712 #endif
                1713 #endif
                1714 #endif
                1715 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
                1716 #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
                1717 #if defined(_SIZE_T_) || defined(SIGLOST)
                1718   struct utsname *un;
                1719   uname (&un);
                1720   printf ("mips-dec-ultrix%s\n", un.release); exit (0);
                1721 #else
                1722   printf ("mips-dec-ultrix\n"); exit (0);
                1723 #endif
                1724 #endif
                1725 #endif
                1726 
                1727 #if defined (alliant) && defined (i860)
                1728   printf ("i860-alliant-bsd\n"); exit (0);
                1729 #endif
                1730 
                1731   exit (1);
                1732 }
                1733 EOF
                1734 
b9f6d1be0 Alex*1735 $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
11bb6deb0 Mart*1736         { echo "$SYSTEM_NAME"; exit; }
                1737 
                1738 # Apollos put the system type in the environment.
                1739 test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
                1740 
f6a1b37d1 Alex*1741 echo "$0: unable to guess system type" >&2
                1742 
b9f6d1be0 Alex*1743 case $UNAME_MACHINE:$UNAME_SYSTEM in
f6a1b37d1 Alex*1744     mips:Linux | mips64:Linux)
                1745         # If we got here on MIPS GNU/Linux, output extra information.
                1746         cat >&2 <<EOF
                1747 
                1748 NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
                1749 the system type. Please install a C compiler and try again.
                1750 EOF
                1751         ;;
                1752 esac
                1753 
87f48fcc7 Patr*1754 cat >&2 <<EOF
                1755 
f6a1b37d1 Alex*1756 This script (version $timestamp), has failed to recognize the
                1757 operating system you are using. If your script is old, overwrite *all*
                1758 copies of config.guess and config.sub with the latest versions from:
87f48fcc7 Patr*1759 
b9f6d1be0 Alex*1760   https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
5c0dde779 Alex*1761 and
b9f6d1be0 Alex*1762   https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
11bb6deb0 Mart*1763 EOF
                1764 
b9f6d1be0 Alex*1765 our_year=`echo $timestamp | sed 's,-.*,,'`
                1766 thisyear=`date +%Y`
11bb6deb0 Mart*1767 # shellcheck disable=SC2003
b9f6d1be0 Alex*1768 script_age=`expr "$thisyear" - "$our_year"`
                1769 if test "$script_age" -lt 3 ; then
11bb6deb0 Mart*1770    cat >&2 <<EOF
87f48fcc7 Patr*1771 
f6a1b37d1 Alex*1772 If $0 has already been updated, send the following data and any
                1773 information you think might be pertinent to config-patches@gnu.org to
                1774 provide the necessary information to handle your system.
87f48fcc7 Patr*1775 
                1776 config.guess timestamp = $timestamp
                1777 
                1778 uname -m = `(uname -m) 2>/dev/null || echo unknown`
                1779 uname -r = `(uname -r) 2>/dev/null || echo unknown`
                1780 uname -s = `(uname -s) 2>/dev/null || echo unknown`
                1781 uname -v = `(uname -v) 2>/dev/null || echo unknown`
                1782 
                1783 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
                1784 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
                1785 
                1786 hostinfo               = `(hostinfo) 2>/dev/null`
                1787 /bin/universe          = `(/bin/universe) 2>/dev/null`
                1788 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
                1789 /bin/arch              = `(/bin/arch) 2>/dev/null`
                1790 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
                1791 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
                1792 
f6a1b37d1 Alex*1793 UNAME_MACHINE = "$UNAME_MACHINE"
                1794 UNAME_RELEASE = "$UNAME_RELEASE"
                1795 UNAME_SYSTEM  = "$UNAME_SYSTEM"
                1796 UNAME_VERSION = "$UNAME_VERSION"
87f48fcc7 Patr*1797 EOF
11bb6deb0 Mart*1798 fi
87f48fcc7 Patr*1799 
                1800 exit 1
                1801 
                1802 # Local variables:
11bb6deb0 Mart*1803 # eval: (add-hook 'before-save-hook 'time-stamp)
87f48fcc7 Patr*1804 # time-stamp-start: "timestamp='"
                1805 # time-stamp-format: "%:y-%02m-%02d"
                1806 # time-stamp-end: "'"
                1807 # End: