blob: 45001cfecde8f3e0716992163e3e211b6997f749 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001#! /bin/sh
2# Attempt to guess a canonical system name.
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05003# Copyright 1992-2020 Free Software Foundation, Inc.
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00004
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05005timestamp='2020-01-01'
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00006
Theodore Ts'o50e1e101997-04-26 13:58:21 +00007# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
Theodore Ts'oc253c3b2013-01-16 13:10:54 -05009# the Free Software Foundation; either version 3 of the License, or
Theodore Ts'o50e1e101997-04-26 13:58:21 +000010# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
Theodore Ts'o2cae2562018-03-02 14:26:52 -050018# along with this program; if not, see <https://www.gnu.org/licenses/>.
Theodore Ts'o50e1e101997-04-26 13:58:21 +000019#
20# As a special exception to the GNU General Public License, if you
21# distribute this file as part of a program that contains a
22# configuration script generated by Autoconf, you may include it under
Theodore Ts'oc253c3b2013-01-16 13:10:54 -050023# the same distribution terms that you use for the rest of that
24# program. This Exception is an additional permission under section 7
25# of the GNU General Public License, version 3 ("GPLv3").
Theodore Ts'o50e1e101997-04-26 13:58:21 +000026#
Theodore Ts'o6ece39e2015-06-20 22:10:10 -040027# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
Theodore Ts'o50e1e101997-04-26 13:58:21 +000028#
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -070029# You can get the latest version of this script from:
Theodore Ts'o2cae2562018-03-02 14:26:52 -050030# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
Theodore Ts'oc253c3b2013-01-16 13:10:54 -050031#
Theodore Ts'o6ece39e2015-06-20 22:10:10 -040032# Please send patches to <config-patches@gnu.org>.
Theodore Ts'oc253c3b2013-01-16 13:10:54 -050033
Theodore Ts'o50e1e101997-04-26 13:58:21 +000034
Theodore Ts'o197fb3a2000-07-05 15:42:23 +000035me=`echo "$0" | sed -e 's,.*/,,'`
36
37usage="\
38Usage: $0 [OPTION]
39
Theodore Ts'od8998862001-05-05 06:49:27 +000040Output the configuration name of the system \`$me' is run on.
Theodore Ts'o197fb3a2000-07-05 15:42:23 +000041
Theodore Ts'o2cae2562018-03-02 14:26:52 -050042Options:
Theodore Ts'od8998862001-05-05 06:49:27 +000043 -h, --help print this help, then exit
44 -t, --time-stamp print date of last modification, then exit
45 -v, --version print version number, then exit
46
47Report bugs and patches to <config-patches@gnu.org>."
48
49version="\
50GNU config.guess ($timestamp)
51
52Originally written by Per Bothner.
Theodore Ts'o8676d7e2020-01-01 15:16:41 -050053Copyright 1992-2020 Free Software Foundation, Inc.
Theodore Ts'od8998862001-05-05 06:49:27 +000054
55This is free software; see the source for copying conditions. There is NO
56warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
Theodore Ts'o197fb3a2000-07-05 15:42:23 +000057
58help="
59Try \`$me --help' for more information."
60
61# Parse command line
62while test $# -gt 0 ; do
Theodore Ts'od8998862001-05-05 06:49:27 +000063 case $1 in
64 --time-stamp | --time* | -t )
Theodore Ts'oa99d4902006-04-09 18:37:22 -040065 echo "$timestamp" ; exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +000066 --version | -v )
Theodore Ts'oa99d4902006-04-09 18:37:22 -040067 echo "$version" ; exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +000068 --help | --h* | -h )
Theodore Ts'oa99d4902006-04-09 18:37:22 -040069 echo "$usage"; exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +000070 -- ) # Stop option processing
71 shift; break ;;
72 - ) # Use stdin as input.
73 break ;;
74 -* )
Theodore Ts'od8998862001-05-05 06:49:27 +000075 echo "$me: invalid option $1$help" >&2
Theodore Ts'o197fb3a2000-07-05 15:42:23 +000076 exit 1 ;;
77 * )
78 break ;;
79 esac
80done
81
82if test $# != 0; then
83 echo "$me: too many arguments$help" >&2
84 exit 1
85fi
86
Theodore Ts'o138b8122003-03-15 20:24:16 -050087# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
88# compiler to aid in system detection is discouraged as it requires
89# temporary files to be created and, as you can see below, it is a
90# headache to deal with in a portable fashion.
Theodore Ts'od8998862001-05-05 06:49:27 +000091
Theodore Ts'od8998862001-05-05 06:49:27 +000092# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
93# use `HOST_CC' if defined, but it is deprecated.
94
Theodore Ts'o138b8122003-03-15 20:24:16 -050095# Portable tmp directory creation inspired by the Autoconf team.
96
Theodore Ts'o8676d7e2020-01-01 15:16:41 -050097tmp=
98# shellcheck disable=SC2172
99trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
100
101set_cc_for_build() {
102 # prevent multiple calls if $tmp is already set
103 test "$tmp" && return 0
104 : "${TMPDIR=/tmp}"
105 # shellcheck disable=SC2039
106 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
107 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
108 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
109 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
110 dummy=$tmp/dummy
111 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
112 ,,) echo "int x;" > "$dummy.c"
113 for driver in cc gcc c89 c99 ; do
114 if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
115 CC_FOR_BUILD="$driver"
116 break
117 fi
118 done
119 if test x"$CC_FOR_BUILD" = x ; then
120 CC_FOR_BUILD=no_compiler_found
121 fi
122 ;;
123 ,,*) CC_FOR_BUILD=$CC ;;
124 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
125 esac
126}
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000127
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000128# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
Theodore Ts'o138b8122003-03-15 20:24:16 -0500129# (ghazi@noc.rutgers.edu 1994-08-24)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500130if test -f /.attbin/uname ; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000131 PATH=$PATH:/.attbin ; export PATH
132fi
133
134UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
135UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
Theodore Ts'od8998862001-05-05 06:49:27 +0000136UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000137UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
138
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500139case "$UNAME_SYSTEM" in
Theodore Ts'o26cbfab2013-12-10 23:12:38 -0500140Linux|GNU|GNU/*)
141 # If the system lacks a compiler, then just pick glibc.
142 # We could probably try harder.
143 LIBC=gnu
144
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500145 set_cc_for_build
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500146 cat <<-EOF > "$dummy.c"
Theodore Ts'o26cbfab2013-12-10 23:12:38 -0500147 #include <features.h>
148 #if defined(__UCLIBC__)
149 LIBC=uclibc
150 #elif defined(__dietlibc__)
151 LIBC=dietlibc
152 #else
153 LIBC=gnu
154 #endif
155 EOF
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500156 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
157
158 # If ldd exists, use it to detect musl libc.
159 if command -v ldd >/dev/null && \
160 ldd --version 2>&1 | grep -q ^musl
161 then
162 LIBC=musl
163 fi
Theodore Ts'o26cbfab2013-12-10 23:12:38 -0500164 ;;
165esac
166
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000167# Note: order is significant - the case branches are not exclusive.
168
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500169case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000170 *:NetBSD:*:*)
Theodore Ts'o138b8122003-03-15 20:24:16 -0500171 # NetBSD (nbsd) targets should (where applicable) match one or
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700172 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000173 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
174 # switched to ELF, *-*-netbsd* would select the old
175 # object file format. This provides both forward
176 # compatibility and a consistent mechanism for selecting the
177 # object file format.
Theodore Ts'o138b8122003-03-15 20:24:16 -0500178 #
179 # Note: NetBSD doesn't particularly care about the vendor
180 # portion of the name. We always set it to "unknown".
181 sysctl="sysctl -n hw.machine_arch"
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400182 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500183 "/sbin/$sysctl" 2>/dev/null || \
184 "/usr/sbin/$sysctl" 2>/dev/null || \
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400185 echo unknown)`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500186 case "$UNAME_MACHINE_ARCH" in
Theodore Ts'o138b8122003-03-15 20:24:16 -0500187 armeb) machine=armeb-unknown ;;
188 arm*) machine=arm-unknown ;;
189 sh3el) machine=shl-unknown ;;
190 sh3eb) machine=sh-unknown ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400191 sh5el) machine=sh5le-unknown ;;
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400192 earmv*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500193 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
194 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
195 machine="${arch}${endian}"-unknown
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400196 ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500197 *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000198 esac
Theodore Ts'od8998862001-05-05 06:49:27 +0000199 # The Operating System including object format, if it has switched
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400200 # to ELF recently (or will in the future) and ABI.
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500201 case "$UNAME_MACHINE_ARCH" in
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400202 earm*)
203 os=netbsdelf
204 ;;
205 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500206 set_cc_for_build
Theodore Ts'od8998862001-05-05 06:49:27 +0000207 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700208 | grep -q __ELF__
Theodore Ts'od8998862001-05-05 06:49:27 +0000209 then
210 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
211 # Return netbsd for either. FIX?
212 os=netbsd
213 else
214 os=netbsdelf
215 fi
216 ;;
217 *)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700218 os=netbsd
Theodore Ts'od8998862001-05-05 06:49:27 +0000219 ;;
220 esac
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400221 # Determine ABI tags.
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500222 case "$UNAME_MACHINE_ARCH" in
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400223 earm*)
224 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500225 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400226 ;;
227 esac
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000228 # The OS release
Theodore Ts'o138b8122003-03-15 20:24:16 -0500229 # Debian GNU/NetBSD machines have a different userland, and
230 # thus, need a distinct triplet. However, they do not need
231 # kernel version information, so it can be replaced with a
232 # suitable tag, in the style of linux-gnu.
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500233 case "$UNAME_VERSION" in
Theodore Ts'o138b8122003-03-15 20:24:16 -0500234 Debian*)
235 release='-gnu'
236 ;;
237 *)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500238 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
Theodore Ts'o138b8122003-03-15 20:24:16 -0500239 ;;
240 esac
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000241 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
242 # contains redundant information, the shorter form:
243 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500244 echo "$machine-${os}${release}${abi-}"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400245 exit ;;
Theodore Ts'oc253c3b2013-01-16 13:10:54 -0500246 *:Bitrig:*:*)
247 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500248 echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
Theodore Ts'oc253c3b2013-01-16 13:10:54 -0500249 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500250 *:OpenBSD:*:*)
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400251 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500252 echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400253 exit ;;
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400254 *:LibertyBSD:*:*)
255 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500256 echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
257 exit ;;
258 *:MidnightBSD:*:*)
259 echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400260 exit ;;
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400261 *:ekkoBSD:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500262 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400263 exit ;;
264 *:SolidBSD:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500265 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400266 exit ;;
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500267 *:OS108:*:*)
268 echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
269 exit ;;
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400270 macppc:MirBSD:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500271 echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400272 exit ;;
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400273 *:MirBSD:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500274 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400275 exit ;;
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400276 *:Sortix:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500277 echo "$UNAME_MACHINE"-unknown-sortix
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400278 exit ;;
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500279 *:Twizzler:*:*)
280 echo "$UNAME_MACHINE"-unknown-twizzler
281 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500282 *:Redox:*:*)
283 echo "$UNAME_MACHINE"-unknown-redox
284 exit ;;
285 mips:OSF1:*.*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500286 echo mips-dec-osf1
287 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000288 alpha:OSF1:*:*)
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400289 case $UNAME_RELEASE in
290 *4.0)
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000291 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400292 ;;
293 *5.*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700294 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400295 ;;
296 esac
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400297 # According to Compaq, /usr/sbin/psrinfo has been available on
298 # OSF/1 and Tru64 systems produced since 1995. I hope that
299 # covers most systems running today. This code pipes the CPU
300 # types through head -n 1, so we only detect the type of CPU 0.
301 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
302 case "$ALPHA_CPU_TYPE" in
303 "EV4 (21064)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400304 UNAME_MACHINE=alpha ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400305 "EV4.5 (21064)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400306 UNAME_MACHINE=alpha ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400307 "LCA4 (21066/21068)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400308 UNAME_MACHINE=alpha ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400309 "EV5 (21164)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400310 UNAME_MACHINE=alphaev5 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400311 "EV5.6 (21164A)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400312 UNAME_MACHINE=alphaev56 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400313 "EV5.6 (21164PC)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400314 UNAME_MACHINE=alphapca56 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400315 "EV5.7 (21164PC)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400316 UNAME_MACHINE=alphapca57 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400317 "EV6 (21264)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400318 UNAME_MACHINE=alphaev6 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400319 "EV6.7 (21264A)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400320 UNAME_MACHINE=alphaev67 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400321 "EV6.8CB (21264C)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400322 UNAME_MACHINE=alphaev68 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400323 "EV6.8AL (21264B)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400324 UNAME_MACHINE=alphaev68 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400325 "EV6.8CX (21264D)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400326 UNAME_MACHINE=alphaev68 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400327 "EV6.9A (21264/EV69A)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400328 UNAME_MACHINE=alphaev69 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400329 "EV7 (21364)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400330 UNAME_MACHINE=alphaev7 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400331 "EV7.9 (21364A)")
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400332 UNAME_MACHINE=alphaev79 ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400333 esac
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400334 # A Pn.n version is a patched version.
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000335 # A Vn.n version is a released version.
336 # A Tn.n version is a released field test version.
337 # A Xn.n version is an unreleased experimental baselevel.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000338 # 1.2 uses "1.2" for uname -r.
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500339 echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700340 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
341 exitcode=$?
342 trap '' 0
343 exit $exitcode ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000344 Amiga*:UNIX_System_V:4.0:*)
Theodore Ts'od8998862001-05-05 06:49:27 +0000345 echo m68k-unknown-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400346 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000347 *:[Aa]miga[Oo][Ss]:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500348 echo "$UNAME_MACHINE"-unknown-amigaos
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400349 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500350 *:[Mm]orph[Oo][Ss]:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500351 echo "$UNAME_MACHINE"-unknown-morphos
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400352 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000353 *:OS/390:*:*)
354 echo i370-ibm-openedition
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400355 exit ;;
356 *:z/VM:*:*)
357 echo s390-ibm-zvmoe
358 exit ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400359 *:OS400:*:*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700360 echo powerpc-ibm-os400
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400361 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000362 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500363 echo arm-acorn-riscix"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400364 exit ;;
Theodore Ts'oc253c3b2013-01-16 13:10:54 -0500365 arm*:riscos:*:*|arm*:RISCOS:*:*)
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400366 echo arm-unknown-riscos
367 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000368 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000369 echo hppa1.1-hitachi-hiuxmpp
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400370 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000371 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000372 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000373 if test "`(/bin/universe) 2>/dev/null`" = att ; then
374 echo pyramid-pyramid-sysv3
375 else
376 echo pyramid-pyramid-bsd
377 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400378 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000379 NILE*:*:*:dcosx)
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000380 echo pyramid-pyramid-svr4
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400381 exit ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400382 DRS?6000:unix:4.0:6*)
383 echo sparc-icl-nx6
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400384 exit ;;
385 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
Theodore Ts'o138b8122003-03-15 20:24:16 -0500386 case `/usr/bin/uname -p` in
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400387 sparc) echo sparc-icl-nx7; exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500388 esac ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400389 s390x:SunOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500390 echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400391 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000392 sun4H:SunOS:5.*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500393 echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400394 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000395 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500396 echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400397 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700398 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500399 echo i386-pc-auroraux"$UNAME_RELEASE"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700400 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400401 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500402 set_cc_for_build
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400403 SUN_ARCH=i386
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400404 # If there is a compiler, see if it is configured for 64-bit objects.
405 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
406 # This test works for both compilers.
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400407 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400408 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400409 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400410 grep IS_64BIT_ARCH >/dev/null
411 then
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400412 SUN_ARCH=x86_64
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400413 fi
414 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500415 echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400416 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000417 sun4*:SunOS:6*:*)
418 # According to config.sub, this is the proper way to canonicalize
419 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
420 # it's likely to be more like Solaris than SunOS4.
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500421 echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400422 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000423 sun4*:SunOS:*:*)
424 case "`/usr/bin/arch -k`" in
425 Series*|S4*)
426 UNAME_RELEASE=`uname -v`
427 ;;
428 esac
429 # Japanese Language versions have a version number like `4.1.3-JL'.
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500430 echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400431 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000432 sun3*:SunOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500433 echo m68k-sun-sunos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400434 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000435 sun*:*:4.2BSD:*)
Theodore Ts'o138b8122003-03-15 20:24:16 -0500436 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500437 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000438 case "`/bin/arch`" in
439 sun3)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500440 echo m68k-sun-sunos"$UNAME_RELEASE"
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000441 ;;
442 sun4)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500443 echo sparc-sun-sunos"$UNAME_RELEASE"
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000444 ;;
445 esac
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400446 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000447 aushp:SunOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500448 echo sparc-auspex-sunos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400449 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000450 # The situation for MiNT is a little confusing. The machine name
451 # can be virtually everything (everything which is not
452 # "atarist" or "atariste" at least should have a processor
453 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
454 # to the lowercase version "mint" (or "freemint"). Finally
455 # the system name "TOS" denotes a system which is actually not
456 # MiNT. But MiNT is downward compatible to TOS, so this should
457 # be no problem.
458 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500459 echo m68k-atari-mint"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400460 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000461 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500462 echo m68k-atari-mint"$UNAME_RELEASE"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700463 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000464 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500465 echo m68k-atari-mint"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400466 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000467 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500468 echo m68k-milan-mint"$UNAME_RELEASE"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700469 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000470 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500471 echo m68k-hades-mint"$UNAME_RELEASE"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700472 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000473 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500474 echo m68k-unknown-mint"$UNAME_RELEASE"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700475 exit ;;
Theodore Ts'o03cb57e2004-09-17 18:15:58 -0400476 m68k:machten:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500477 echo m68k-apple-machten"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400478 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000479 powerpc:machten:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500480 echo powerpc-apple-machten"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400481 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000482 RISC*:Mach:*:*)
483 echo mips-dec-mach_bsd4.3
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400484 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000485 RISC*:ULTRIX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500486 echo mips-dec-ultrix"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400487 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000488 VAX*:ULTRIX*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500489 echo vax-dec-ultrix"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400490 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000491 2020:CLIX:*:* | 2430:CLIX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500492 echo clipper-intergraph-clix"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400493 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000494 mips:*:*:UMIPS | mips:*:*:RISCos)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500495 set_cc_for_build
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500496 sed 's/^ //' << EOF > "$dummy.c"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000497#ifdef __cplusplus
498#include <stdio.h> /* for printf() prototype */
499 int main (int argc, char *argv[]) {
500#else
501 int main (argc, argv) int argc; char *argv[]; {
502#endif
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000503 #if defined (host_mips) && defined (MIPSEB)
504 #if defined (SYSTYPE_SYSV)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500505 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000506 #endif
507 #if defined (SYSTYPE_SVR4)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500508 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000509 #endif
510 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500511 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000512 #endif
513 #endif
514 exit (-1);
515 }
516EOF
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500517 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
518 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
519 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400520 { echo "$SYSTEM_NAME"; exit; }
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500521 echo mips-mips-riscos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400522 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000523 Motorola:PowerMAX_OS:*:*)
524 echo powerpc-motorola-powermax
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400525 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500526 Motorola:*:4.3:PL8-*)
527 echo powerpc-harris-powermax
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400528 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500529 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
530 echo powerpc-harris-powermax
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400531 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000532 Night_Hawk:Power_UNIX:*:*)
533 echo powerpc-harris-powerunix
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400534 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000535 m88k:CX/UX:7*:*)
536 echo m88k-harris-cxux7
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400537 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000538 m88k:*:4*:R4*)
539 echo m88k-motorola-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400540 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000541 m88k:*:3*:R3*)
542 echo m88k-motorola-sysv3
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400543 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000544 AViiON:dgux:*:*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700545 # DG/UX returns AViiON for all architectures
546 UNAME_PROCESSOR=`/usr/bin/uname -p`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500547 if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000548 then
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500549 if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
550 [ "$TARGET_BINARY_INTERFACE"x = x ]
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000551 then
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500552 echo m88k-dg-dgux"$UNAME_RELEASE"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000553 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500554 echo m88k-dg-dguxbcs"$UNAME_RELEASE"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000555 fi
556 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500557 echo i586-dg-dgux"$UNAME_RELEASE"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000558 fi
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700559 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000560 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
561 echo m88k-dolphin-sysv3
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400562 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000563 M88*:*:R3*:*)
564 # Delta 88k system running SVR3
565 echo m88k-motorola-sysv3
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400566 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000567 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
568 echo m88k-tektronix-sysv3
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400569 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000570 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
571 echo m68k-tektronix-bsd
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400572 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000573 *:IRIX*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500574 echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400575 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000576 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400577 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
578 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
Theodore Ts'od8998862001-05-05 06:49:27 +0000579 i*86:AIX:*:*)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000580 echo i386-ibm-aix
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400581 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000582 ia64:AIX:*:*)
583 if [ -x /usr/bin/oslevel ] ; then
584 IBM_REV=`/usr/bin/oslevel`
585 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500586 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
Theodore Ts'od8998862001-05-05 06:49:27 +0000587 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500588 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400589 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000590 *:AIX:2:3)
591 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500592 set_cc_for_build
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500593 sed 's/^ //' << EOF > "$dummy.c"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000594 #include <sys/systemcfg.h>
595
596 main()
597 {
598 if (!__power_pc())
599 exit(1);
600 puts("powerpc-ibm-aix3.2.5");
601 exit(0);
602 }
603EOF
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500604 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400605 then
606 echo "$SYSTEM_NAME"
607 else
608 echo rs6000-ibm-aix3.2.5
609 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000610 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
611 echo rs6000-ibm-aix3.2.4
612 else
613 echo rs6000-ibm-aix3.2
614 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400615 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700616 *:AIX:*:[4567])
Theodore Ts'o138b8122003-03-15 20:24:16 -0500617 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500618 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000619 IBM_ARCH=rs6000
620 else
621 IBM_ARCH=powerpc
622 fi
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400623 if [ -x /usr/bin/lslpp ] ; then
624 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
625 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000626 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500627 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000628 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500629 echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400630 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000631 *:AIX:*:*)
632 echo rs6000-ibm-aix
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400633 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500634 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000635 echo romp-ibm-bsd4.4
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400636 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000637 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500638 echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400639 exit ;; # report: romp-ibm BSD 4.3
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000640 *:BOSX:*:*)
641 echo rs6000-bull-bosx
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400642 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000643 DPX/2?00:B.O.S.:*:*)
644 echo m68k-bull-sysv3
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400645 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000646 9000/[34]??:4.3bsd:1.*:*)
647 echo m68k-hp-bsd
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400648 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000649 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
650 echo m68k-hp-bsd4.4
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400651 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000652 9000/[34678]??:HP-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500653 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
654 case "$UNAME_MACHINE" in
655 9000/31?) HP_ARCH=m68000 ;;
656 9000/[34]??) HP_ARCH=m68k ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000657 9000/[678][0-9][0-9])
Theodore Ts'o138b8122003-03-15 20:24:16 -0500658 if [ -x /usr/bin/getconf ]; then
659 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700660 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500661 case "$sc_cpu_version" in
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400662 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
663 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700664 532) # CPU_PA_RISC2_0
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500665 case "$sc_kernel_bits" in
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400666 32) HP_ARCH=hppa2.0n ;;
667 64) HP_ARCH=hppa2.0w ;;
668 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700669 esac ;;
670 esac
Theodore Ts'o138b8122003-03-15 20:24:16 -0500671 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500672 if [ "$HP_ARCH" = "" ]; then
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500673 set_cc_for_build
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500674 sed 's/^ //' << EOF > "$dummy.c"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000675
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700676 #define _HPUX_SOURCE
677 #include <stdlib.h>
678 #include <unistd.h>
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000679
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700680 int main ()
681 {
682 #if defined(_SC_KERNEL_BITS)
683 long bits = sysconf(_SC_KERNEL_BITS);
684 #endif
685 long cpu = sysconf (_SC_CPU_VERSION);
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000686
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700687 switch (cpu)
688 {
689 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
690 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
691 case CPU_PA_RISC2_0:
692 #if defined(_SC_KERNEL_BITS)
693 switch (bits)
694 {
695 case 64: puts ("hppa2.0w"); break;
696 case 32: puts ("hppa2.0n"); break;
697 default: puts ("hppa2.0"); break;
698 } break;
699 #else /* !defined(_SC_KERNEL_BITS) */
700 puts ("hppa2.0"); break;
701 #endif
702 default: puts ("hppa1.0"); break;
703 }
704 exit (0);
705 }
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000706EOF
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500707 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
Theodore Ts'o138b8122003-03-15 20:24:16 -0500708 test -z "$HP_ARCH" && HP_ARCH=hppa
709 fi ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000710 esac
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500711 if [ "$HP_ARCH" = hppa2.0w ]
Theodore Ts'o138b8122003-03-15 20:24:16 -0500712 then
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500713 set_cc_for_build
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400714
715 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
716 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
717 # generating 64-bit code. GNU and HP use different nomenclature:
718 #
719 # $ CC_FOR_BUILD=cc ./config.guess
720 # => hppa2.0w-hp-hpux11.23
721 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
722 # => hppa64-hp-hpux11.23
723
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400724 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700725 grep -q __LP64__
Theodore Ts'o138b8122003-03-15 20:24:16 -0500726 then
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400727 HP_ARCH=hppa2.0w
Theodore Ts'o138b8122003-03-15 20:24:16 -0500728 else
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400729 HP_ARCH=hppa64
Theodore Ts'o138b8122003-03-15 20:24:16 -0500730 fi
731 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500732 echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400733 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000734 ia64:HP-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500735 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
736 echo ia64-hp-hpux"$HPUX_REV"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400737 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000738 3050*:HI-UX:*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500739 set_cc_for_build
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500740 sed 's/^ //' << EOF > "$dummy.c"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000741 #include <unistd.h>
742 int
743 main ()
744 {
745 long cpu = sysconf (_SC_CPU_VERSION);
746 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
747 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
748 results, however. */
749 if (CPU_IS_PA_RISC (cpu))
750 {
751 switch (cpu)
752 {
753 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
754 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
755 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
756 default: puts ("hppa-hitachi-hiuxwe2"); break;
757 }
758 }
759 else if (CPU_IS_HP_MC68K (cpu))
760 puts ("m68k-hitachi-hiuxwe2");
761 else puts ("unknown-hitachi-hiuxwe2");
762 exit (0);
763 }
764EOF
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500765 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400766 { echo "$SYSTEM_NAME"; exit; }
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000767 echo unknown-hitachi-hiuxwe2
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400768 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500769 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000770 echo hppa1.1-hp-bsd
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400771 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000772 9000/8??:4.3bsd:*:*)
773 echo hppa1.0-hp-bsd
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400774 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500775 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000776 echo hppa1.0-hp-mpeix
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400777 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500778 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000779 echo hppa1.1-hp-osf
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400780 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000781 hp8??:OSF1:*:*)
782 echo hppa1.0-hp-osf
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400783 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000784 i*86:OSF1:*:*)
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000785 if [ -x /usr/sbin/sysversion ] ; then
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500786 echo "$UNAME_MACHINE"-unknown-osf1mk
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000787 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500788 echo "$UNAME_MACHINE"-unknown-osf1
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000789 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400790 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000791 parisc*:Lites*:*:*)
792 echo hppa1.1-hp-lites
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400793 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000794 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
795 echo c1-convex-bsd
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700796 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000797 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
798 if getsysinfo -f scalar_acc
799 then echo c32-convex-bsd
800 else echo c2-convex-bsd
801 fi
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700802 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000803 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
804 echo c34-convex-bsd
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700805 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000806 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
807 echo c38-convex-bsd
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700808 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000809 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
810 echo c4-convex-bsd
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700811 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000812 CRAY*Y-MP:*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500813 echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400814 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000815 CRAY*[A-Z]90:*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500816 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000817 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
Theodore Ts'o138b8122003-03-15 20:24:16 -0500818 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
819 -e 's/\.[^.]*$/.X/'
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400820 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000821 CRAY*TS:*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500822 echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400823 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000824 CRAY*T3E:*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500825 echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400826 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000827 CRAY*SV1:*:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500828 echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400829 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -0500830 *:UNICOS/mp:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500831 echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400832 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000833 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400834 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
835 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500836 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700837 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
838 exit ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400839 5000:UNIX_System_V:4.*:*)
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400840 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500841 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700842 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400843 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000844 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500845 echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400846 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000847 sparc*:BSD/OS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500848 echo sparc-unknown-bsdi"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400849 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000850 *:BSD/OS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500851 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400852 exit ;;
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500853 arm:FreeBSD:*:*)
854 UNAME_PROCESSOR=`uname -p`
855 set_cc_for_build
856 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
857 | grep -q __ARM_PCS_VFP
858 then
859 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
860 else
861 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
862 fi
863 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000864 *:FreeBSD:*:*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700865 UNAME_PROCESSOR=`/usr/bin/uname -p`
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500866 case "$UNAME_PROCESSOR" in
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400867 amd64)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500868 UNAME_PROCESSOR=x86_64 ;;
869 i386)
870 UNAME_PROCESSOR=i586 ;;
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400871 esac
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500872 echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400873 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000874 i*:CYGWIN*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500875 echo "$UNAME_MACHINE"-pc-cygwin
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400876 exit ;;
Theodore Ts'oc253c3b2013-01-16 13:10:54 -0500877 *:MINGW64*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500878 echo "$UNAME_MACHINE"-pc-mingw64
Theodore Ts'oc253c3b2013-01-16 13:10:54 -0500879 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400880 *:MINGW*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500881 echo "$UNAME_MACHINE"-pc-mingw32
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400882 exit ;;
Theodore Ts'o285cbe62014-07-04 00:30:04 -0400883 *:MSYS*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500884 echo "$UNAME_MACHINE"-pc-msys
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400885 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000886 i*:PW*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500887 echo "$UNAME_MACHINE"-pc-pw32
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400888 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700889 *:Interix*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500890 case "$UNAME_MACHINE" in
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400891 x86)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500892 echo i586-pc-interix"$UNAME_RELEASE"
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400893 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700894 authenticamd | genuineintel | EM64T)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500895 echo x86_64-unknown-interix"$UNAME_RELEASE"
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400896 exit ;;
897 IA64)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500898 echo ia64-unknown-interix"$UNAME_RELEASE"
Theodore Ts'o3a09e962009-05-29 22:22:23 -0400899 exit ;;
900 esac ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +0000901 i*:UWIN*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500902 echo "$UNAME_MACHINE"-pc-uwin
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400903 exit ;;
904 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500905 echo x86_64-pc-cygwin
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400906 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +0000907 prep*:SunOS:5.*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500908 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400909 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000910 *:GNU:*:*)
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400911 # the GNU system
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500912 echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400913 exit ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -0400914 *:GNU/*:*:*)
915 # other systems with GNU libc and userland
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500916 echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400917 exit ;;
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500918 *:Minix:*:*)
919 echo "$UNAME_MACHINE"-unknown-minix
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400920 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700921 aarch64:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500922 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400923 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700924 aarch64_be:Linux:*:*)
925 UNAME_MACHINE=aarch64_be
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500926 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400927 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +0000928 alpha:Linux:*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500929 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
Theodore Ts'o138b8122003-03-15 20:24:16 -0500930 EV5) UNAME_MACHINE=alphaev5 ;;
931 EV56) UNAME_MACHINE=alphaev56 ;;
932 PCA56) UNAME_MACHINE=alphapca56 ;;
933 PCA57) UNAME_MACHINE=alphapca56 ;;
934 EV6) UNAME_MACHINE=alphaev6 ;;
935 EV67) UNAME_MACHINE=alphaev67 ;;
936 EV68*) UNAME_MACHINE=alphaev68 ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700937 esac
938 objdump --private-headers /bin/sh | grep -q ld.so.1
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400939 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500940 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o26cbfab2013-12-10 23:12:38 -0500941 exit ;;
942 arc:Linux:*:* | arceb:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500943 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -0400944 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700945 arm*:Linux:*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500946 set_cc_for_build
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700947 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
948 | grep -q __ARM_EABI__
949 then
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500950 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700951 else
952 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
953 | grep -q __ARM_PCS_VFP
954 then
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500955 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700956 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500957 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700958 fi
959 fi
960 exit ;;
961 avr32*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500962 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700963 exit ;;
964 cris:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500965 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700966 exit ;;
967 crisv32:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500968 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700969 exit ;;
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400970 e2k:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500971 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o6ece39e2015-06-20 22:10:10 -0400972 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700973 frv:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500974 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700975 exit ;;
976 hexagon:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500977 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700978 exit ;;
979 i*86:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500980 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700981 exit ;;
982 ia64:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500983 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700984 exit ;;
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400985 k1om:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500986 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa7c023f2016-09-01 15:34:37 -0400987 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700988 m32r*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500989 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700990 exit ;;
991 m68*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500992 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700993 exit ;;
994 mips:Linux:*:* | mips64:Linux:*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -0500995 set_cc_for_build
996 IS_GLIBC=0
997 test x"${LIBC}" = xgnu && IS_GLIBC=1
Theodore Ts'o2cae2562018-03-02 14:26:52 -0500998 sed 's/^ //' << EOF > "$dummy.c"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -0700999 #undef CPU
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001000 #undef mips
1001 #undef mipsel
1002 #undef mips64
1003 #undef mips64el
1004 #if ${IS_GLIBC} && defined(_ABI64)
1005 LIBCABI=gnuabi64
1006 #else
1007 #if ${IS_GLIBC} && defined(_ABIN32)
1008 LIBCABI=gnuabin32
1009 #else
1010 LIBCABI=${LIBC}
1011 #endif
1012 #endif
1013
1014 #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1015 CPU=mipsisa64r6
1016 #else
1017 #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1018 CPU=mipsisa32r6
1019 #else
1020 #if defined(__mips64)
1021 CPU=mips64
1022 #else
1023 CPU=mips
1024 #endif
1025 #endif
1026 #endif
1027
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001028 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001029 MIPS_ENDIAN=el
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001030 #else
1031 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001032 MIPS_ENDIAN=
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001033 #else
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001034 MIPS_ENDIAN=
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001035 #endif
1036 #endif
1037EOF
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001038 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
1039 test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001040 ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001041 mips64el:Linux:*:*)
1042 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1043 exit ;;
Theodore Ts'o285cbe62014-07-04 00:30:04 -04001044 openrisc*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001045 echo or1k-unknown-linux-"$LIBC"
Theodore Ts'o26cbfab2013-12-10 23:12:38 -05001046 exit ;;
Theodore Ts'o285cbe62014-07-04 00:30:04 -04001047 or32:Linux:*:* | or1k*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001048 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001049 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001050 padre:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001051 echo sparc-unknown-linux-"$LIBC"
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001052 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001053 parisc64:Linux:*:* | hppa64:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001054 echo hppa64-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001055 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001056 parisc:Linux:*:* | hppa:Linux:*:*)
1057 # Look for CPU level
1058 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001059 PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1060 PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1061 *) echo hppa-unknown-linux-"$LIBC" ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001062 esac
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001063 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001064 ppc64:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001065 echo powerpc64-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001066 exit ;;
1067 ppc:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001068 echo powerpc-unknown-linux-"$LIBC"
Theodore Ts'o26cbfab2013-12-10 23:12:38 -05001069 exit ;;
1070 ppc64le:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001071 echo powerpc64le-unknown-linux-"$LIBC"
Theodore Ts'o26cbfab2013-12-10 23:12:38 -05001072 exit ;;
1073 ppcle:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001074 echo powerpcle-unknown-linux-"$LIBC"
1075 exit ;;
1076 riscv32:Linux:*:* | riscv64:Linux:*:*)
1077 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001078 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001079 s390:Linux:*:* | s390x:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001080 echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001081 exit ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -04001082 sh64*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001083 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001084 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001085 sh*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001086 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001087 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001088 sparc:Linux:*:* | sparc64:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001089 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001090 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001091 tile*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001092 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001093 exit ;;
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001094 vax:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001095 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001096 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001097 x86_64:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001098 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001099 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001100 xtensa*:Linux:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001101 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001102 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001103 i*86:DYNIX/ptx:4*:*)
Theodore Ts'o138b8122003-03-15 20:24:16 -05001104 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1105 # earlier versions are messed up and put the nodename in both
1106 # sysname and nodename.
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001107 echo i386-sequent-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001108 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001109 i*86:UNIX_SV:4.2MP:2.*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001110 # Unixware is an offshoot of SVR4, but it has its own version
1111 # number series starting with 2...
1112 # I am not positive that other SVR4 systems won't match this,
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001113 # I just have to hope. -- rms.
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001114 # Use sysv4.2uw... so that sysv4* matches it.
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001115 echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001116 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001117 i*86:OS/2:*:*)
1118 # If we were able to find `uname', then EMX Unix compatibility
1119 # is probably installed.
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001120 echo "$UNAME_MACHINE"-pc-os2-emx
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001121 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001122 i*86:XTS-300:*:STOP)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001123 echo "$UNAME_MACHINE"-unknown-stop
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001124 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001125 i*86:atheos:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001126 echo "$UNAME_MACHINE"-unknown-atheos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001127 exit ;;
1128 i*86:syllable:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001129 echo "$UNAME_MACHINE"-pc-syllable
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001130 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001131 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001132 echo i386-unknown-lynxos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001133 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001134 i*86:*DOS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001135 echo "$UNAME_MACHINE"-pc-msdosdjgpp
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001136 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001137 i*86:*:4.*:*)
1138 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001139 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001140 echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001141 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001142 echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001143 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001144 exit ;;
1145 i*86:*:5:[678]*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001146 # UnixWare 7.x, OpenUNIX and OpenServer 6.
Theodore Ts'o138b8122003-03-15 20:24:16 -05001147 case `/bin/uname -X | grep "^Machine"` in
1148 *486*) UNAME_MACHINE=i486 ;;
1149 *Pentium) UNAME_MACHINE=i586 ;;
1150 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1151 esac
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001152 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001153 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001154 i*86:*:3.2:*)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001155 if test -f /usr/options/cb.name; then
1156 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001157 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001158 elif /bin/uname -X 2>/dev/null >/dev/null ; then
Theodore Ts'o138b8122003-03-15 20:24:16 -05001159 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1160 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1161 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001162 && UNAME_MACHINE=i586
Theodore Ts'o138b8122003-03-15 20:24:16 -05001163 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001164 && UNAME_MACHINE=i686
Theodore Ts'o138b8122003-03-15 20:24:16 -05001165 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001166 && UNAME_MACHINE=i686
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001167 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001168 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001169 echo "$UNAME_MACHINE"-pc-sysv32
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001170 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001171 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001172 pc:*:*:*)
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001173 # Left here for compatibility:
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001174 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1175 # the processor, so we play safe by assuming i586.
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001176 # Note: whatever this is, it MUST be the same as what config.sub
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001177 # prints for the "djgpp" host, or else GDB configure will decide that
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001178 # this is a cross-build.
1179 echo i586-pc-msdosdjgpp
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001180 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001181 Intel:Mach:3*:*)
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001182 echo i386-pc-mach3
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001183 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001184 paragon:*:*:*)
1185 echo i860-intel-osf1
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001186 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001187 i860:*:4.*:*) # i860-SVR4
1188 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001189 echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001190 else # Add other i860-SVR4 vendors below as they are discovered.
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001191 echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001192 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001193 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001194 mini*:CTIX:SYS*5:*)
1195 # "miniframe"
1196 echo m68010-convergent-sysv
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001197 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001198 mc68k:UNIX:SYSTEM5:3.51m)
1199 echo m68k-convergent-sysv
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001200 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001201 M680?0:D-NIX:5.3:*)
1202 echo m68k-diab-dnix
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001203 exit ;;
Theodore Ts'o03cb57e2004-09-17 18:15:58 -04001204 M68*:*:R3V[5678]*:*)
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001205 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1206 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)
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001207 OS_REL=''
1208 test -r /etc/.relid \
1209 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1210 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001211 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001212 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001213 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001214 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001215 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1216 && { echo i486-ncr-sysv4; exit; } ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001217 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1218 OS_REL='.3'
1219 test -r /etc/.relid \
1220 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1221 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001222 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001223 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001224 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001225 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001226 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001227 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001228 echo m68k-unknown-lynxos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001229 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001230 mc68030:UNIX_System_V:4.*:*)
1231 echo m68k-atari-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001232 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001233 TSUNAMI:LynxOS:2.*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001234 echo sparc-unknown-lynxos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001235 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001236 rs6000:LynxOS:2.*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001237 echo rs6000-unknown-lynxos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001238 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001239 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001240 echo powerpc-unknown-lynxos"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001241 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001242 SM[BE]S:UNIX_SV:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001243 echo mips-dde-sysv"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001244 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001245 RM*:ReliantUNIX-*:*:*)
1246 echo mips-sni-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001247 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001248 RM*:SINIX-*:*:*)
1249 echo mips-sni-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001250 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001251 *:SINIX-*:*:*)
1252 if uname -p 2>/dev/null >/dev/null ; then
1253 UNAME_MACHINE=`(uname -p) 2>/dev/null`
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001254 echo "$UNAME_MACHINE"-sni-sysv4
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001255 else
1256 echo ns32k-sni-sysv
1257 fi
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001258 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001259 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1260 # says <Richard.M.Bartel@ccMail.Census.GOV>
1261 echo i586-unisys-sysv4
1262 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001263 *:UNIX_System_V:4*:FTX*)
1264 # From Gerald Hewes <hewes@openmarket.com>.
1265 # How about differentiating between stratus architectures? -djm
1266 echo hppa1.1-stratus-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001267 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001268 *:*:*:FTX*)
1269 # From seanf@swdc.stratus.com.
1270 echo i860-stratus-sysv4
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001271 exit ;;
1272 i*86:VOS:*:*)
1273 # From Paul.Green@stratus.com.
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001274 echo "$UNAME_MACHINE"-stratus-vos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001275 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001276 *:VOS:*:*)
1277 # From Paul.Green@stratus.com.
1278 echo hppa1.1-stratus-vos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001279 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001280 mc68*:A/UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001281 echo m68k-apple-aux"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001282 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001283 news*:NEWS-OS:6*:*)
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001284 echo mips-sony-newsos6
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001285 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001286 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001287 if [ -d /usr/nec ]; then
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001288 echo mips-nec-sysv"$UNAME_RELEASE"
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001289 else
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001290 echo mips-unknown-sysv"$UNAME_RELEASE"
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001291 fi
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001292 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001293 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1294 echo powerpc-be-beos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001295 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001296 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1297 echo powerpc-apple-beos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001298 exit ;;
Theodore Ts'ocf554b11999-01-02 04:10:33 +00001299 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1300 echo i586-pc-beos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001301 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001302 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1303 echo i586-pc-haiku
1304 exit ;;
Theodore Ts'oc253c3b2013-01-16 13:10:54 -05001305 x86_64:Haiku:*:*)
1306 echo x86_64-unknown-haiku
1307 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001308 SX-4:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001309 echo sx4-nec-superux"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001310 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001311 SX-5:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001312 echo sx5-nec-superux"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001313 exit ;;
Theodore Ts'o138b8122003-03-15 20:24:16 -05001314 SX-6:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001315 echo sx6-nec-superux"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001316 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001317 SX-7:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001318 echo sx7-nec-superux"$UNAME_RELEASE"
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001319 exit ;;
1320 SX-8:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001321 echo sx8-nec-superux"$UNAME_RELEASE"
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001322 exit ;;
1323 SX-8R:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001324 echo sx8r-nec-superux"$UNAME_RELEASE"
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001325 exit ;;
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001326 SX-ACE:SUPER-UX:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001327 echo sxace-nec-superux"$UNAME_RELEASE"
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001328 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001329 Power*:Rhapsody:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001330 echo powerpc-apple-rhapsody"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001331 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001332 *:Rhapsody:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001333 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001334 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001335 *:Darwin:*:*)
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001336 UNAME_PROCESSOR=`uname -p`
1337 case $UNAME_PROCESSOR in
1338 unknown) UNAME_PROCESSOR=powerpc ;;
1339 esac
1340 if command -v xcode-select > /dev/null 2> /dev/null && \
1341 ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1342 # Avoid executing cc if there is no toolchain installed as
1343 # cc will be a stub that puts up a graphical alert
1344 # prompting the user to install developer tools.
1345 CC_FOR_BUILD=no_compiler_found
1346 else
1347 set_cc_for_build
Theodore Ts'o26cbfab2013-12-10 23:12:38 -05001348 fi
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001349 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1350 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1351 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1352 grep IS_64BIT_ARCH >/dev/null
1353 then
1354 case $UNAME_PROCESSOR in
1355 i386) UNAME_PROCESSOR=x86_64 ;;
1356 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1357 esac
1358 fi
1359 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1360 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1361 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1362 grep IS_PPC >/dev/null
1363 then
1364 UNAME_PROCESSOR=powerpc
Theodore Ts'o26cbfab2013-12-10 23:12:38 -05001365 fi
1366 elif test "$UNAME_PROCESSOR" = i386 ; then
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001367 # uname -m returns i386 or x86_64
1368 UNAME_PROCESSOR=$UNAME_MACHINE
Theodore Ts'o26cbfab2013-12-10 23:12:38 -05001369 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001370 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001371 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001372 *:procnto*:*:* | *:QNX:[0123456789]*:*)
Theodore Ts'o138b8122003-03-15 20:24:16 -05001373 UNAME_PROCESSOR=`uname -p`
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001374 if test "$UNAME_PROCESSOR" = x86; then
Theodore Ts'o138b8122003-03-15 20:24:16 -05001375 UNAME_PROCESSOR=i386
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001376 UNAME_MACHINE=pc
1377 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001378 echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001379 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001380 *:QNX:*:4*)
1381 echo i386-pc-qnx
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001382 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001383 NEO-*:NONSTOP_KERNEL:*:*)
1384 echo neo-tandem-nsk"$UNAME_RELEASE"
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001385 exit ;;
Theodore Ts'oc253c3b2013-01-16 13:10:54 -05001386 NSE-*:NONSTOP_KERNEL:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001387 echo nse-tandem-nsk"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001388 exit ;;
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001389 NSR-*:NONSTOP_KERNEL:*:*)
1390 echo nsr-tandem-nsk"$UNAME_RELEASE"
1391 exit ;;
1392 NSV-*:NONSTOP_KERNEL:*:*)
1393 echo nsv-tandem-nsk"$UNAME_RELEASE"
1394 exit ;;
1395 NSX-*:NONSTOP_KERNEL:*:*)
1396 echo nsx-tandem-nsk"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001397 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001398 *:NonStop-UX:*:*)
1399 echo mips-compaq-nonstopux
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001400 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001401 BS2000:POSIX*:*:*)
1402 echo bs2000-siemens-sysv
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001403 exit ;;
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001404 DS/*:UNIX_System_V:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001405 echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001406 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001407 *:Plan9:*:*)
1408 # "uname -m" is not consistent, so use $cputype instead. 386
1409 # is converted to i386 for consistency with other x86
1410 # operating systems.
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001411 # shellcheck disable=SC2154
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001412 if test "$cputype" = 386; then
Theodore Ts'od8998862001-05-05 06:49:27 +00001413 UNAME_MACHINE=i386
1414 else
1415 UNAME_MACHINE="$cputype"
1416 fi
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001417 echo "$UNAME_MACHINE"-unknown-plan9
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001418 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001419 *:TOPS-10:*:*)
1420 echo pdp10-unknown-tops10
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001421 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001422 *:TENEX:*:*)
1423 echo pdp10-unknown-tenex
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001424 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001425 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1426 echo pdp10-dec-tops20
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001427 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001428 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1429 echo pdp10-xkl-tops20
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001430 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001431 *:TOPS-20:*:*)
1432 echo pdp10-unknown-tops20
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001433 exit ;;
Theodore Ts'od8998862001-05-05 06:49:27 +00001434 *:ITS:*:*)
1435 echo pdp10-unknown-its
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001436 exit ;;
Theodore Ts'od2d386d2004-05-04 18:42:53 -04001437 SEI:*:*:SEIUX)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001438 echo mips-sei-seiux"$UNAME_RELEASE"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001439 exit ;;
Theodore Ts'o03cb57e2004-09-17 18:15:58 -04001440 *:DragonFly:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001441 echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001442 exit ;;
1443 *:*VMS:*:*)
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001444 UNAME_MACHINE=`(uname -p) 2>/dev/null`
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001445 case "$UNAME_MACHINE" in
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001446 A*) echo alpha-dec-vms ; exit ;;
1447 I*) echo ia64-dec-vms ; exit ;;
1448 V*) echo vax-dec-vms ; exit ;;
1449 esac ;;
1450 *:XENIX:*:SysV)
1451 echo i386-pc-xenix
1452 exit ;;
1453 i*86:skyos:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001454 echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001455 exit ;;
1456 i*86:rdos:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001457 echo "$UNAME_MACHINE"-pc-rdos
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001458 exit ;;
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001459 i*86:AROS:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001460 echo "$UNAME_MACHINE"-pc-aros
Theodore Ts'o3a09e962009-05-29 22:22:23 -04001461 exit ;;
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001462 x86_64:VMkernel:*:*)
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001463 echo "$UNAME_MACHINE"-unknown-esx
Theodore Ts'o8f92c4a2012-04-05 15:45:02 -07001464 exit ;;
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001465 amd64:Isilon\ OneFS:*:*)
1466 echo x86_64-unknown-onefs
1467 exit ;;
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001468 *:Unleashed:*:*)
1469 echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
1470 exit ;;
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001471esac
1472
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001473# No uname command or uname output not recognized.
1474set_cc_for_build
1475cat > "$dummy.c" <<EOF
1476#ifdef _SEQUENT_
1477#include <sys/types.h>
1478#include <sys/utsname.h>
1479#endif
1480#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1481#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1482#include <signal.h>
1483#if defined(_SIZE_T_) || defined(SIGLOST)
1484#include <sys/utsname.h>
1485#endif
1486#endif
1487#endif
1488main ()
1489{
1490#if defined (sony)
1491#if defined (MIPSEB)
1492 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1493 I don't know.... */
1494 printf ("mips-sony-bsd\n"); exit (0);
1495#else
1496#include <sys/param.h>
1497 printf ("m68k-sony-newsos%s\n",
1498#ifdef NEWSOS4
1499 "4"
1500#else
1501 ""
1502#endif
1503 ); exit (0);
1504#endif
1505#endif
1506
1507#if defined (NeXT)
1508#if !defined (__ARCHITECTURE__)
1509#define __ARCHITECTURE__ "m68k"
1510#endif
1511 int version;
1512 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1513 if (version < 4)
1514 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1515 else
1516 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1517 exit (0);
1518#endif
1519
1520#if defined (MULTIMAX) || defined (n16)
1521#if defined (UMAXV)
1522 printf ("ns32k-encore-sysv\n"); exit (0);
1523#else
1524#if defined (CMU)
1525 printf ("ns32k-encore-mach\n"); exit (0);
1526#else
1527 printf ("ns32k-encore-bsd\n"); exit (0);
1528#endif
1529#endif
1530#endif
1531
1532#if defined (__386BSD__)
1533 printf ("i386-pc-bsd\n"); exit (0);
1534#endif
1535
1536#if defined (sequent)
1537#if defined (i386)
1538 printf ("i386-sequent-dynix\n"); exit (0);
1539#endif
1540#if defined (ns32000)
1541 printf ("ns32k-sequent-dynix\n"); exit (0);
1542#endif
1543#endif
1544
1545#if defined (_SEQUENT_)
1546 struct utsname un;
1547
1548 uname(&un);
1549 if (strncmp(un.version, "V2", 2) == 0) {
1550 printf ("i386-sequent-ptx2\n"); exit (0);
1551 }
1552 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1553 printf ("i386-sequent-ptx1\n"); exit (0);
1554 }
1555 printf ("i386-sequent-ptx\n"); exit (0);
1556#endif
1557
1558#if defined (vax)
1559#if !defined (ultrix)
1560#include <sys/param.h>
1561#if defined (BSD)
1562#if BSD == 43
1563 printf ("vax-dec-bsd4.3\n"); exit (0);
1564#else
1565#if BSD == 199006
1566 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1567#else
1568 printf ("vax-dec-bsd\n"); exit (0);
1569#endif
1570#endif
1571#else
1572 printf ("vax-dec-bsd\n"); exit (0);
1573#endif
1574#else
1575#if defined(_SIZE_T_) || defined(SIGLOST)
1576 struct utsname un;
1577 uname (&un);
1578 printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1579#else
1580 printf ("vax-dec-ultrix\n"); exit (0);
1581#endif
1582#endif
1583#endif
1584#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1585#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1586#if defined(_SIZE_T_) || defined(SIGLOST)
1587 struct utsname *un;
1588 uname (&un);
1589 printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1590#else
1591 printf ("mips-dec-ultrix\n"); exit (0);
1592#endif
1593#endif
1594#endif
1595
1596#if defined (alliant) && defined (i860)
1597 printf ("i860-alliant-bsd\n"); exit (0);
1598#endif
1599
1600 exit (1);
1601}
1602EOF
1603
1604$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1605 { echo "$SYSTEM_NAME"; exit; }
1606
1607# Apollos put the system type in the environment.
1608test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1609
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001610echo "$0: unable to guess system type" >&2
1611
1612case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1613 mips:Linux | mips64:Linux)
1614 # If we got here on MIPS GNU/Linux, output extra information.
1615 cat >&2 <<EOF
1616
1617NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1618the system type. Please install a C compiler and try again.
1619EOF
1620 ;;
1621esac
1622
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001623cat >&2 <<EOF
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001624
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001625This script (version $timestamp), has failed to recognize the
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001626operating system you are using. If your script is old, overwrite *all*
1627copies of config.guess and config.sub with the latest versions from:
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001628
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001629 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
Theodore Ts'oa99d4902006-04-09 18:37:22 -04001630and
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001631 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001632
Theodore Ts'oa7c023f2016-09-01 15:34:37 -04001633If $0 has already been updated, send the following data and any
1634information you think might be pertinent to config-patches@gnu.org to
1635provide the necessary information to handle your system.
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001636
Theodore Ts'od8998862001-05-05 06:49:27 +00001637config.guess timestamp = $timestamp
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001638
1639uname -m = `(uname -m) 2>/dev/null || echo unknown`
1640uname -r = `(uname -r) 2>/dev/null || echo unknown`
1641uname -s = `(uname -s) 2>/dev/null || echo unknown`
1642uname -v = `(uname -v) 2>/dev/null || echo unknown`
1643
1644/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1645/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1646
1647hostinfo = `(hostinfo) 2>/dev/null`
1648/bin/universe = `(/bin/universe) 2>/dev/null`
1649/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1650/bin/arch = `(/bin/arch) 2>/dev/null`
1651/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1652/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1653
Theodore Ts'o2cae2562018-03-02 14:26:52 -05001654UNAME_MACHINE = "$UNAME_MACHINE"
1655UNAME_RELEASE = "$UNAME_RELEASE"
1656UNAME_SYSTEM = "$UNAME_SYSTEM"
1657UNAME_VERSION = "$UNAME_VERSION"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001658EOF
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001659
1660exit 1
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001661
1662# Local variables:
Theodore Ts'o8676d7e2020-01-01 15:16:41 -05001663# eval: (add-hook 'before-save-hook 'time-stamp)
Theodore Ts'od8998862001-05-05 06:49:27 +00001664# time-stamp-start: "timestamp='"
Theodore Ts'o197fb3a2000-07-05 15:42:23 +00001665# time-stamp-format: "%:y-%02m-%02d"
1666# time-stamp-end: "'"
1667# End: