comparison config.guess @ 131:84e7813d76e9

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