Codebase list mimetic / a5b8b6c
Import upstream version 0.9.8+git20210412.1.ebf95df Debian Janitor 2 years ago
18 changed file(s) with 2451 addition(s) and 2017 deletion(s). Raw diff Collapse all Expand all
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
4 # Inc.
5
6 timestamp='2007-07-22'
2 # Copyright 1992-2020 Free Software Foundation, Inc.
3
4 timestamp='2020-04-26'
75
86 # This file is free software; you can redistribute it and/or modify it
97 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
8 # the Free Software Foundation; either version 3 of the License, or
119 # (at your option) any later version.
1210 #
1311 # This program is distributed in the hope that it will be useful, but
1614 # General Public License for more details.
1715 #
1816 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 # 02110-1301, USA.
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
2218 #
2319 # As a special exception to the GNU General Public License, if you
2420 # distribute this file as part of a program that contains a
2521 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28
29 # Originally written by Per Bothner <per@bothner.com>.
30 # Please send patches to <config-patches@gnu.org>. Submit a context
31 # diff and a properly formatted ChangeLog entry.
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
3225 #
33 # This script attempts to guess a canonical system name similar to
34 # config.sub. If it succeeds, it prints the system name on stdout, and
35 # exits with 0. Otherwise, it exits with 1.
26 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
3627 #
37 # The plan is that this can be called by configure scripts if you
38 # don't specify an explicit build system type.
28 # You can get the latest version of this script from:
29 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
30 #
31 # Please send patches to <config-patches@gnu.org>.
32
3933
4034 me=`echo "$0" | sed -e 's,.*/,,'`
4135
4438
4539 Output the configuration name of the system \`$me' is run on.
4640
47 Operation modes:
41 Options:
4842 -h, --help print this help, then exit
4943 -t, --time-stamp print date of last modification, then exit
5044 -v, --version print version number, then exit
5549 GNU config.guess ($timestamp)
5650
5751 Originally written by Per Bothner.
58 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
59 Free Software Foundation, Inc.
52 Copyright 1992-2020 Free Software Foundation, Inc.
6053
6154 This is free software; see the source for copying conditions. There is NO
6255 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
9083 exit 1
9184 fi
9285
93 trap 'exit 1' 1 2 15
94
9586 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9687 # compiler to aid in system detection is discouraged as it requires
9788 # temporary files to be created and, as you can see below, it is a
10293
10394 # Portable tmp directory creation inspired by the Autoconf team.
10495
105 set_cc_for_build='
106 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108 : ${TMPDIR=/tmp} ;
109 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113 dummy=$tmp/dummy ;
114 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115 case $CC_FOR_BUILD,$HOST_CC,$CC in
116 ,,) echo "int x;" > $dummy.c ;
117 for c in cc gcc c89 c99 ; do
118 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119 CC_FOR_BUILD="$c"; break ;
120 fi ;
121 done ;
122 if test x"$CC_FOR_BUILD" = x ; then
123 CC_FOR_BUILD=no_compiler_found ;
124 fi
125 ;;
126 ,,*) CC_FOR_BUILD=$CC ;;
127 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128 esac ; set_cc_for_build= ;'
96 tmp=
97 # shellcheck disable=SC2172
98 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
99
100 set_cc_for_build() {
101 # prevent multiple calls if $tmp is already set
102 test "$tmp" && return 0
103 : "${TMPDIR=/tmp}"
104 # shellcheck disable=SC2039
105 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
106 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
107 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
108 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
109 dummy=$tmp/dummy
110 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
111 ,,) echo "int x;" > "$dummy.c"
112 for driver in cc gcc c89 c99 ; do
113 if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
114 CC_FOR_BUILD="$driver"
115 break
116 fi
117 done
118 if test x"$CC_FOR_BUILD" = x ; then
119 CC_FOR_BUILD=no_compiler_found
120 fi
121 ;;
122 ,,*) CC_FOR_BUILD=$CC ;;
123 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
124 esac
125 }
129126
130127 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131128 # (ghazi@noc.rutgers.edu 1994-08-24)
132 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
129 if test -f /.attbin/uname ; then
133130 PATH=$PATH:/.attbin ; export PATH
134131 fi
135132
138135 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139136 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140137
138 case "$UNAME_SYSTEM" in
139 Linux|GNU|GNU/*)
140 # If the system lacks a compiler, then just pick glibc.
141 # We could probably try harder.
142 LIBC=gnu
143
144 set_cc_for_build
145 cat <<-EOF > "$dummy.c"
146 #include <features.h>
147 #if defined(__UCLIBC__)
148 LIBC=uclibc
149 #elif defined(__dietlibc__)
150 LIBC=dietlibc
151 #else
152 LIBC=gnu
153 #endif
154 EOF
155 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
156
157 # If ldd exists, use it to detect musl libc.
158 if command -v ldd >/dev/null && \
159 ldd --version 2>&1 | grep -q ^musl
160 then
161 LIBC=musl
162 fi
163 ;;
164 esac
165
141166 # Note: order is significant - the case branches are not exclusive.
142167
143 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
168 case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
144169 *:NetBSD:*:*)
145170 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
171 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
147172 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148173 # switched to ELF, *-*-netbsd* would select the old
149174 # object file format. This provides both forward
153178 # Note: NetBSD doesn't particularly care about the vendor
154179 # portion of the name. We always set it to "unknown".
155180 sysctl="sysctl -n hw.machine_arch"
156 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158 case "${UNAME_MACHINE_ARCH}" in
181 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
182 "/sbin/$sysctl" 2>/dev/null || \
183 "/usr/sbin/$sysctl" 2>/dev/null || \
184 echo unknown)`
185 case "$UNAME_MACHINE_ARCH" in
159186 armeb) machine=armeb-unknown ;;
160187 arm*) machine=arm-unknown ;;
161188 sh3el) machine=shl-unknown ;;
162189 sh3eb) machine=sh-unknown ;;
163190 sh5el) machine=sh5le-unknown ;;
164 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
191 earmv*)
192 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
193 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
194 machine="${arch}${endian}"-unknown
195 ;;
196 *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
165197 esac
166198 # The Operating System including object format, if it has switched
167 # to ELF recently, or will in the future.
168 case "${UNAME_MACHINE_ARCH}" in
199 # to ELF recently (or will in the future) and ABI.
200 case "$UNAME_MACHINE_ARCH" in
201 earm*)
202 os=netbsdelf
203 ;;
169204 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170 eval $set_cc_for_build
205 set_cc_for_build
171206 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172 | grep __ELF__ >/dev/null
207 | grep -q __ELF__
173208 then
174209 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175210 # Return netbsd for either. FIX?
179214 fi
180215 ;;
181216 *)
182 os=netbsd
217 os=netbsd
218 ;;
219 esac
220 # Determine ABI tags.
221 case "$UNAME_MACHINE_ARCH" in
222 earm*)
223 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
224 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
183225 ;;
184226 esac
185227 # The OS release
187229 # thus, need a distinct triplet. However, they do not need
188230 # kernel version information, so it can be replaced with a
189231 # suitable tag, in the style of linux-gnu.
190 case "${UNAME_VERSION}" in
232 case "$UNAME_VERSION" in
191233 Debian*)
192234 release='-gnu'
193235 ;;
194236 *)
195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
237 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
196238 ;;
197239 esac
198240 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199241 # contains redundant information, the shorter form:
200242 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
243 echo "$machine-${os}${release}${abi-}"
244 exit ;;
245 *:Bitrig:*:*)
246 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
247 echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
202248 exit ;;
203249 *:OpenBSD:*:*)
204250 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
251 echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
252 exit ;;
253 *:LibertyBSD:*:*)
254 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
255 echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
256 exit ;;
257 *:MidnightBSD:*:*)
258 echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
206259 exit ;;
207260 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
261 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
209262 exit ;;
210263 *:SolidBSD:*:*)
211 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
264 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
265 exit ;;
266 *:OS108:*:*)
267 echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
212268 exit ;;
213269 macppc:MirBSD:*:*)
214 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
270 echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
215271 exit ;;
216272 *:MirBSD:*:*)
217 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
273 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
274 exit ;;
275 *:Sortix:*:*)
276 echo "$UNAME_MACHINE"-unknown-sortix
277 exit ;;
278 *:Twizzler:*:*)
279 echo "$UNAME_MACHINE"-unknown-twizzler
280 exit ;;
281 *:Redox:*:*)
282 echo "$UNAME_MACHINE"-unknown-redox
283 exit ;;
284 mips:OSF1:*.*)
285 echo mips-dec-osf1
218286 exit ;;
219287 alpha:OSF1:*:*)
220288 case $UNAME_RELEASE in
222290 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223291 ;;
224292 *5.*)
225 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
293 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226294 ;;
227295 esac
228296 # According to Compaq, /usr/sbin/psrinfo has been available on
232300 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233301 case "$ALPHA_CPU_TYPE" in
234302 "EV4 (21064)")
235 UNAME_MACHINE="alpha" ;;
303 UNAME_MACHINE=alpha ;;
236304 "EV4.5 (21064)")
237 UNAME_MACHINE="alpha" ;;
305 UNAME_MACHINE=alpha ;;
238306 "LCA4 (21066/21068)")
239 UNAME_MACHINE="alpha" ;;
307 UNAME_MACHINE=alpha ;;
240308 "EV5 (21164)")
241 UNAME_MACHINE="alphaev5" ;;
309 UNAME_MACHINE=alphaev5 ;;
242310 "EV5.6 (21164A)")
243 UNAME_MACHINE="alphaev56" ;;
311 UNAME_MACHINE=alphaev56 ;;
244312 "EV5.6 (21164PC)")
245 UNAME_MACHINE="alphapca56" ;;
313 UNAME_MACHINE=alphapca56 ;;
246314 "EV5.7 (21164PC)")
247 UNAME_MACHINE="alphapca57" ;;
315 UNAME_MACHINE=alphapca57 ;;
248316 "EV6 (21264)")
249 UNAME_MACHINE="alphaev6" ;;
317 UNAME_MACHINE=alphaev6 ;;
250318 "EV6.7 (21264A)")
251 UNAME_MACHINE="alphaev67" ;;
319 UNAME_MACHINE=alphaev67 ;;
252320 "EV6.8CB (21264C)")
253 UNAME_MACHINE="alphaev68" ;;
321 UNAME_MACHINE=alphaev68 ;;
254322 "EV6.8AL (21264B)")
255 UNAME_MACHINE="alphaev68" ;;
323 UNAME_MACHINE=alphaev68 ;;
256324 "EV6.8CX (21264D)")
257 UNAME_MACHINE="alphaev68" ;;
325 UNAME_MACHINE=alphaev68 ;;
258326 "EV6.9A (21264/EV69A)")
259 UNAME_MACHINE="alphaev69" ;;
327 UNAME_MACHINE=alphaev69 ;;
260328 "EV7 (21364)")
261 UNAME_MACHINE="alphaev7" ;;
329 UNAME_MACHINE=alphaev7 ;;
262330 "EV7.9 (21364A)")
263 UNAME_MACHINE="alphaev79" ;;
331 UNAME_MACHINE=alphaev79 ;;
264332 esac
265333 # A Pn.n version is a patched version.
266334 # A Vn.n version is a released version.
267335 # A Tn.n version is a released field test version.
268336 # A Xn.n version is an unreleased experimental baselevel.
269337 # 1.2 uses "1.2" for uname -r.
270 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271 exit ;;
272 Alpha\ *:Windows_NT*:*)
273 # How do we know it's Interix rather than the generic POSIX subsystem?
274 # Should we change UNAME_MACHINE based on the output of uname instead
275 # of the specific Alpha model?
276 echo alpha-pc-interix
277 exit ;;
278 21064:Windows_NT:50:3)
279 echo alpha-dec-winnt3.5
280 exit ;;
338 echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
339 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
340 exitcode=$?
341 trap '' 0
342 exit $exitcode ;;
281343 Amiga*:UNIX_System_V:4.0:*)
282344 echo m68k-unknown-sysv4
283345 exit ;;
284346 *:[Aa]miga[Oo][Ss]:*:*)
285 echo ${UNAME_MACHINE}-unknown-amigaos
347 echo "$UNAME_MACHINE"-unknown-amigaos
286348 exit ;;
287349 *:[Mm]orph[Oo][Ss]:*:*)
288 echo ${UNAME_MACHINE}-unknown-morphos
350 echo "$UNAME_MACHINE"-unknown-morphos
289351 exit ;;
290352 *:OS/390:*:*)
291353 echo i370-ibm-openedition
294356 echo s390-ibm-zvmoe
295357 exit ;;
296358 *:OS400:*:*)
297 echo powerpc-ibm-os400
359 echo powerpc-ibm-os400
298360 exit ;;
299361 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300 echo arm-acorn-riscix${UNAME_RELEASE}
301 exit ;;
302 arm:riscos:*:*|arm:RISCOS:*:*)
362 echo arm-acorn-riscix"$UNAME_RELEASE"
363 exit ;;
364 arm*:riscos:*:*|arm*:RISCOS:*:*)
303365 echo arm-unknown-riscos
304366 exit ;;
305367 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
323385 case `/usr/bin/uname -p` in
324386 sparc) echo sparc-icl-nx7; exit ;;
325387 esac ;;
388 s390x:SunOS:*:*)
389 echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
390 exit ;;
326391 sun4H:SunOS:5.*:*)
327 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
392 echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
328393 exit ;;
329394 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
330 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
395 echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
396 exit ;;
397 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
398 echo i386-pc-auroraux"$UNAME_RELEASE"
331399 exit ;;
332400 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
333 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
401 set_cc_for_build
402 SUN_ARCH=i386
403 # If there is a compiler, see if it is configured for 64-bit objects.
404 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
405 # This test works for both compilers.
406 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
407 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
408 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
409 grep IS_64BIT_ARCH >/dev/null
410 then
411 SUN_ARCH=x86_64
412 fi
413 fi
414 echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
334415 exit ;;
335416 sun4*:SunOS:6*:*)
336417 # According to config.sub, this is the proper way to canonicalize
337418 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
338419 # it's likely to be more like Solaris than SunOS4.
339 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
420 echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
340421 exit ;;
341422 sun4*:SunOS:*:*)
342423 case "`/usr/bin/arch -k`" in
345426 ;;
346427 esac
347428 # Japanese Language versions have a version number like `4.1.3-JL'.
348 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
429 echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
349430 exit ;;
350431 sun3*:SunOS:*:*)
351 echo m68k-sun-sunos${UNAME_RELEASE}
432 echo m68k-sun-sunos"$UNAME_RELEASE"
352433 exit ;;
353434 sun*:*:4.2BSD:*)
354435 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
355 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
436 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
356437 case "`/bin/arch`" in
357438 sun3)
358 echo m68k-sun-sunos${UNAME_RELEASE}
439 echo m68k-sun-sunos"$UNAME_RELEASE"
359440 ;;
360441 sun4)
361 echo sparc-sun-sunos${UNAME_RELEASE}
442 echo sparc-sun-sunos"$UNAME_RELEASE"
362443 ;;
363444 esac
364445 exit ;;
365446 aushp:SunOS:*:*)
366 echo sparc-auspex-sunos${UNAME_RELEASE}
447 echo sparc-auspex-sunos"$UNAME_RELEASE"
367448 exit ;;
368449 # The situation for MiNT is a little confusing. The machine name
369450 # can be virtually everything (everything which is not
374455 # MiNT. But MiNT is downward compatible to TOS, so this should
375456 # be no problem.
376457 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
377 echo m68k-atari-mint${UNAME_RELEASE}
458 echo m68k-atari-mint"$UNAME_RELEASE"
378459 exit ;;
379460 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
380 echo m68k-atari-mint${UNAME_RELEASE}
381 exit ;;
461 echo m68k-atari-mint"$UNAME_RELEASE"
462 exit ;;
382463 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
383 echo m68k-atari-mint${UNAME_RELEASE}
464 echo m68k-atari-mint"$UNAME_RELEASE"
384465 exit ;;
385466 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
386 echo m68k-milan-mint${UNAME_RELEASE}
387 exit ;;
467 echo m68k-milan-mint"$UNAME_RELEASE"
468 exit ;;
388469 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
389 echo m68k-hades-mint${UNAME_RELEASE}
390 exit ;;
470 echo m68k-hades-mint"$UNAME_RELEASE"
471 exit ;;
391472 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
392 echo m68k-unknown-mint${UNAME_RELEASE}
393 exit ;;
473 echo m68k-unknown-mint"$UNAME_RELEASE"
474 exit ;;
394475 m68k:machten:*:*)
395 echo m68k-apple-machten${UNAME_RELEASE}
476 echo m68k-apple-machten"$UNAME_RELEASE"
396477 exit ;;
397478 powerpc:machten:*:*)
398 echo powerpc-apple-machten${UNAME_RELEASE}
479 echo powerpc-apple-machten"$UNAME_RELEASE"
399480 exit ;;
400481 RISC*:Mach:*:*)
401482 echo mips-dec-mach_bsd4.3
402483 exit ;;
403484 RISC*:ULTRIX:*:*)
404 echo mips-dec-ultrix${UNAME_RELEASE}
485 echo mips-dec-ultrix"$UNAME_RELEASE"
405486 exit ;;
406487 VAX*:ULTRIX*:*:*)
407 echo vax-dec-ultrix${UNAME_RELEASE}
488 echo vax-dec-ultrix"$UNAME_RELEASE"
408489 exit ;;
409490 2020:CLIX:*:* | 2430:CLIX:*:*)
410 echo clipper-intergraph-clix${UNAME_RELEASE}
491 echo clipper-intergraph-clix"$UNAME_RELEASE"
411492 exit ;;
412493 mips:*:*:UMIPS | mips:*:*:RISCos)
413 eval $set_cc_for_build
414 sed 's/^ //' << EOF >$dummy.c
494 set_cc_for_build
495 sed 's/^ //' << EOF > "$dummy.c"
415496 #ifdef __cplusplus
416497 #include <stdio.h> /* for printf() prototype */
417498 int main (int argc, char *argv[]) {
420501 #endif
421502 #if defined (host_mips) && defined (MIPSEB)
422503 #if defined (SYSTYPE_SYSV)
423 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
504 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
424505 #endif
425506 #if defined (SYSTYPE_SVR4)
426 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
507 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
427508 #endif
428509 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
429 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
510 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
430511 #endif
431512 #endif
432513 exit (-1);
433514 }
434515 EOF
435 $CC_FOR_BUILD -o $dummy $dummy.c &&
436 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
437 SYSTEM_NAME=`$dummy $dummyarg` &&
516 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
517 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
518 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
438519 { echo "$SYSTEM_NAME"; exit; }
439 echo mips-mips-riscos${UNAME_RELEASE}
520 echo mips-mips-riscos"$UNAME_RELEASE"
440521 exit ;;
441522 Motorola:PowerMAX_OS:*:*)
442523 echo powerpc-motorola-powermax
460541 echo m88k-motorola-sysv3
461542 exit ;;
462543 AViiON:dgux:*:*)
463 # DG/UX returns AViiON for all architectures
464 UNAME_PROCESSOR=`/usr/bin/uname -p`
465 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
544 # DG/UX returns AViiON for all architectures
545 UNAME_PROCESSOR=`/usr/bin/uname -p`
546 if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
466547 then
467 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
468 [ ${TARGET_BINARY_INTERFACE}x = x ]
548 if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
549 [ "$TARGET_BINARY_INTERFACE"x = x ]
469550 then
470 echo m88k-dg-dgux${UNAME_RELEASE}
551 echo m88k-dg-dgux"$UNAME_RELEASE"
471552 else
472 echo m88k-dg-dguxbcs${UNAME_RELEASE}
553 echo m88k-dg-dguxbcs"$UNAME_RELEASE"
473554 fi
474555 else
475 echo i586-dg-dgux${UNAME_RELEASE}
476 fi
477 exit ;;
556 echo i586-dg-dgux"$UNAME_RELEASE"
557 fi
558 exit ;;
478559 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
479560 echo m88k-dolphin-sysv3
480561 exit ;;
489570 echo m68k-tektronix-bsd
490571 exit ;;
491572 *:IRIX*:*:*)
492 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
573 echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
493574 exit ;;
494575 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
495576 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
501582 if [ -x /usr/bin/oslevel ] ; then
502583 IBM_REV=`/usr/bin/oslevel`
503584 else
504 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
505 fi
506 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
585 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
586 fi
587 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
507588 exit ;;
508589 *:AIX:2:3)
509590 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
510 eval $set_cc_for_build
511 sed 's/^ //' << EOF >$dummy.c
591 set_cc_for_build
592 sed 's/^ //' << EOF > "$dummy.c"
512593 #include <sys/systemcfg.h>
513594
514595 main()
519600 exit(0);
520601 }
521602 EOF
522 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
603 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
523604 then
524605 echo "$SYSTEM_NAME"
525606 else
531612 echo rs6000-ibm-aix3.2
532613 fi
533614 exit ;;
534 *:AIX:*:[45])
615 *:AIX:*:[4567])
535616 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
536 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
617 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
537618 IBM_ARCH=rs6000
538619 else
539620 IBM_ARCH=powerpc
540621 fi
541 if [ -x /usr/bin/oslevel ] ; then
542 IBM_REV=`/usr/bin/oslevel`
622 if [ -x /usr/bin/lslpp ] ; then
623 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
624 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
543625 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
626 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
627 fi
628 echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
547629 exit ;;
548630 *:AIX:*:*)
549631 echo rs6000-ibm-aix
550632 exit ;;
551 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
633 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
552634 echo romp-ibm-bsd4.4
553635 exit ;;
554636 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
555 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
637 echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
556638 exit ;; # report: romp-ibm BSD 4.3
557639 *:BOSX:*:*)
558640 echo rs6000-bull-bosx
567649 echo m68k-hp-bsd4.4
568650 exit ;;
569651 9000/[34678]??:HP-UX:*:*)
570 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
571 case "${UNAME_MACHINE}" in
572 9000/31? ) HP_ARCH=m68000 ;;
573 9000/[34]?? ) HP_ARCH=m68k ;;
652 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
653 case "$UNAME_MACHINE" in
654 9000/31?) HP_ARCH=m68000 ;;
655 9000/[34]??) HP_ARCH=m68k ;;
574656 9000/[678][0-9][0-9])
575657 if [ -x /usr/bin/getconf ]; then
576658 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
577 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
578 case "${sc_cpu_version}" in
579 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
580 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
581 532) # CPU_PA_RISC2_0
582 case "${sc_kernel_bits}" in
583 32) HP_ARCH="hppa2.0n" ;;
584 64) HP_ARCH="hppa2.0w" ;;
585 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
586 esac ;;
587 esac
659 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
660 case "$sc_cpu_version" in
661 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
662 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
663 532) # CPU_PA_RISC2_0
664 case "$sc_kernel_bits" in
665 32) HP_ARCH=hppa2.0n ;;
666 64) HP_ARCH=hppa2.0w ;;
667 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
668 esac ;;
669 esac
588670 fi
589 if [ "${HP_ARCH}" = "" ]; then
590 eval $set_cc_for_build
591 sed 's/^ //' << EOF >$dummy.c
592
593 #define _HPUX_SOURCE
594 #include <stdlib.h>
595 #include <unistd.h>
596
597 int main ()
598 {
599 #if defined(_SC_KERNEL_BITS)
600 long bits = sysconf(_SC_KERNEL_BITS);
601 #endif
602 long cpu = sysconf (_SC_CPU_VERSION);
603
604 switch (cpu)
605 {
606 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
607 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
608 case CPU_PA_RISC2_0:
609 #if defined(_SC_KERNEL_BITS)
610 switch (bits)
611 {
612 case 64: puts ("hppa2.0w"); break;
613 case 32: puts ("hppa2.0n"); break;
614 default: puts ("hppa2.0"); break;
615 } break;
616 #else /* !defined(_SC_KERNEL_BITS) */
617 puts ("hppa2.0"); break;
618 #endif
619 default: puts ("hppa1.0"); break;
620 }
621 exit (0);
622 }
671 if [ "$HP_ARCH" = "" ]; then
672 set_cc_for_build
673 sed 's/^ //' << EOF > "$dummy.c"
674
675 #define _HPUX_SOURCE
676 #include <stdlib.h>
677 #include <unistd.h>
678
679 int main ()
680 {
681 #if defined(_SC_KERNEL_BITS)
682 long bits = sysconf(_SC_KERNEL_BITS);
683 #endif
684 long cpu = sysconf (_SC_CPU_VERSION);
685
686 switch (cpu)
687 {
688 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
689 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
690 case CPU_PA_RISC2_0:
691 #if defined(_SC_KERNEL_BITS)
692 switch (bits)
693 {
694 case 64: puts ("hppa2.0w"); break;
695 case 32: puts ("hppa2.0n"); break;
696 default: puts ("hppa2.0"); break;
697 } break;
698 #else /* !defined(_SC_KERNEL_BITS) */
699 puts ("hppa2.0"); break;
700 #endif
701 default: puts ("hppa1.0"); break;
702 }
703 exit (0);
704 }
623705 EOF
624 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
706 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
625707 test -z "$HP_ARCH" && HP_ARCH=hppa
626708 fi ;;
627709 esac
628 if [ ${HP_ARCH} = "hppa2.0w" ]
710 if [ "$HP_ARCH" = hppa2.0w ]
629711 then
630 eval $set_cc_for_build
712 set_cc_for_build
631713
632714 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
633715 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
638720 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
639721 # => hppa64-hp-hpux11.23
640722
641 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
642 grep __LP64__ >/dev/null
723 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
724 grep -q __LP64__
643725 then
644 HP_ARCH="hppa2.0w"
726 HP_ARCH=hppa2.0w
645727 else
646 HP_ARCH="hppa64"
728 HP_ARCH=hppa64
647729 fi
648730 fi
649 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
731 echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
650732 exit ;;
651733 ia64:HP-UX:*:*)
652 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
653 echo ia64-hp-hpux${HPUX_REV}
734 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
735 echo ia64-hp-hpux"$HPUX_REV"
654736 exit ;;
655737 3050*:HI-UX:*:*)
656 eval $set_cc_for_build
657 sed 's/^ //' << EOF >$dummy.c
738 set_cc_for_build
739 sed 's/^ //' << EOF > "$dummy.c"
658740 #include <unistd.h>
659741 int
660742 main ()
679761 exit (0);
680762 }
681763 EOF
682 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
764 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
683765 { echo "$SYSTEM_NAME"; exit; }
684766 echo unknown-hitachi-hiuxwe2
685767 exit ;;
686 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
768 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
687769 echo hppa1.1-hp-bsd
688770 exit ;;
689771 9000/8??:4.3bsd:*:*)
692774 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
693775 echo hppa1.0-hp-mpeix
694776 exit ;;
695 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
777 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
696778 echo hppa1.1-hp-osf
697779 exit ;;
698780 hp8??:OSF1:*:*)
700782 exit ;;
701783 i*86:OSF1:*:*)
702784 if [ -x /usr/sbin/sysversion ] ; then
703 echo ${UNAME_MACHINE}-unknown-osf1mk
785 echo "$UNAME_MACHINE"-unknown-osf1mk
704786 else
705 echo ${UNAME_MACHINE}-unknown-osf1
787 echo "$UNAME_MACHINE"-unknown-osf1
706788 fi
707789 exit ;;
708790 parisc*:Lites*:*:*)
710792 exit ;;
711793 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
712794 echo c1-convex-bsd
713 exit ;;
795 exit ;;
714796 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
715797 if getsysinfo -f scalar_acc
716798 then echo c32-convex-bsd
717799 else echo c2-convex-bsd
718800 fi
719 exit ;;
801 exit ;;
720802 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
721803 echo c34-convex-bsd
722 exit ;;
804 exit ;;
723805 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
724806 echo c38-convex-bsd
725 exit ;;
807 exit ;;
726808 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
727809 echo c4-convex-bsd
728 exit ;;
810 exit ;;
729811 CRAY*Y-MP:*:*:*)
730 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
812 echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
731813 exit ;;
732814 CRAY*[A-Z]90:*:*:*)
733 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
815 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
734816 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
735817 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
736818 -e 's/\.[^.]*$/.X/'
737819 exit ;;
738820 CRAY*TS:*:*:*)
739 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
821 echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
740822 exit ;;
741823 CRAY*T3E:*:*:*)
742 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
824 echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
743825 exit ;;
744826 CRAY*SV1:*:*:*)
745 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
827 echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
746828 exit ;;
747829 *:UNICOS/mp:*:*)
748 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
830 echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
749831 exit ;;
750832 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
751 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
752 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
753 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
754 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
755 exit ;;
833 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
834 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
835 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
836 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
837 exit ;;
756838 5000:UNIX_System_V:4.*:*)
757 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
758 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
759 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
839 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
840 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
841 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
760842 exit ;;
761843 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
762 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
844 echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
763845 exit ;;
764846 sparc*:BSD/OS:*:*)
765 echo sparc-unknown-bsdi${UNAME_RELEASE}
847 echo sparc-unknown-bsdi"$UNAME_RELEASE"
766848 exit ;;
767849 *:BSD/OS:*:*)
768 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
850 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
851 exit ;;
852 arm:FreeBSD:*:*)
853 UNAME_PROCESSOR=`uname -p`
854 set_cc_for_build
855 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
856 | grep -q __ARM_PCS_VFP
857 then
858 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
859 else
860 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
861 fi
769862 exit ;;
770863 *:FreeBSD:*:*)
771 case ${UNAME_MACHINE} in
772 pc98)
773 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
864 UNAME_PROCESSOR=`/usr/bin/uname -p`
865 case "$UNAME_PROCESSOR" in
774866 amd64)
775 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
776 *)
777 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
867 UNAME_PROCESSOR=x86_64 ;;
868 i386)
869 UNAME_PROCESSOR=i586 ;;
778870 esac
871 echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
779872 exit ;;
780873 i*:CYGWIN*:*)
781 echo ${UNAME_MACHINE}-pc-cygwin
874 echo "$UNAME_MACHINE"-pc-cygwin
875 exit ;;
876 *:MINGW64*:*)
877 echo "$UNAME_MACHINE"-pc-mingw64
782878 exit ;;
783879 *:MINGW*:*)
784 echo ${UNAME_MACHINE}-pc-mingw32
785 exit ;;
786 i*:windows32*:*)
787 # uname -m includes "-pc" on this system.
788 echo ${UNAME_MACHINE}-mingw32
880 echo "$UNAME_MACHINE"-pc-mingw32
881 exit ;;
882 *:MSYS*:*)
883 echo "$UNAME_MACHINE"-pc-msys
789884 exit ;;
790885 i*:PW*:*)
791 echo ${UNAME_MACHINE}-pc-pw32
792 exit ;;
793 *:Interix*:[3456]*)
794 case ${UNAME_MACHINE} in
886 echo "$UNAME_MACHINE"-pc-pw32
887 exit ;;
888 *:Interix*:*)
889 case "$UNAME_MACHINE" in
795890 x86)
796 echo i586-pc-interix${UNAME_RELEASE}
891 echo i586-pc-interix"$UNAME_RELEASE"
797892 exit ;;
798 EM64T | authenticamd)
799 echo x86_64-unknown-interix${UNAME_RELEASE}
893 authenticamd | genuineintel | EM64T)
894 echo x86_64-unknown-interix"$UNAME_RELEASE"
895 exit ;;
896 IA64)
897 echo ia64-unknown-interix"$UNAME_RELEASE"
800898 exit ;;
801899 esac ;;
802 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
803 echo i${UNAME_MACHINE}-pc-mks
804 exit ;;
805 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
806 # How do we know it's Interix rather than the generic POSIX subsystem?
807 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
808 # UNAME_MACHINE based on the output of uname instead of i386?
809 echo i586-pc-interix
810 exit ;;
811900 i*:UWIN*:*)
812 echo ${UNAME_MACHINE}-pc-uwin
901 echo "$UNAME_MACHINE"-pc-uwin
813902 exit ;;
814903 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
815 echo x86_64-unknown-cygwin
816 exit ;;
817 p*:CYGWIN*:*)
818 echo powerpcle-unknown-cygwin
904 echo x86_64-pc-cygwin
819905 exit ;;
820906 prep*:SunOS:5.*:*)
821 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
907 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
822908 exit ;;
823909 *:GNU:*:*)
824910 # the GNU system
825 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
911 echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
826912 exit ;;
827913 *:GNU/*:*:*)
828914 # other systems with GNU libc and userland
829 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
830 exit ;;
831 i*86:Minix:*:*)
832 echo ${UNAME_MACHINE}-pc-minix
833 exit ;;
834 arm*:Linux:*:*)
835 echo ${UNAME_MACHINE}-unknown-linux-gnu
836 exit ;;
837 avr32*:Linux:*:*)
838 echo ${UNAME_MACHINE}-unknown-linux-gnu
839 exit ;;
840 cris:Linux:*:*)
841 echo cris-axis-linux-gnu
842 exit ;;
843 crisv32:Linux:*:*)
844 echo crisv32-axis-linux-gnu
845 exit ;;
846 frv:Linux:*:*)
847 echo frv-unknown-linux-gnu
848 exit ;;
849 ia64:Linux:*:*)
850 echo ${UNAME_MACHINE}-unknown-linux-gnu
851 exit ;;
852 m32r*:Linux:*:*)
853 echo ${UNAME_MACHINE}-unknown-linux-gnu
854 exit ;;
855 m68*:Linux:*:*)
856 echo ${UNAME_MACHINE}-unknown-linux-gnu
857 exit ;;
858 mips:Linux:*:*)
859 eval $set_cc_for_build
860 sed 's/^ //' << EOF >$dummy.c
861 #undef CPU
862 #undef mips
863 #undef mipsel
864 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
865 CPU=mipsel
866 #else
867 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
868 CPU=mips
869 #else
870 CPU=
871 #endif
872 #endif
873 EOF
874 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
875 /^CPU/{
876 s: ::g
877 p
878 }'`"
879 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
880 ;;
881 mips64:Linux:*:*)
882 eval $set_cc_for_build
883 sed 's/^ //' << EOF >$dummy.c
884 #undef CPU
885 #undef mips64
886 #undef mips64el
887 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
888 CPU=mips64el
889 #else
890 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
891 CPU=mips64
892 #else
893 CPU=
894 #endif
895 #endif
896 EOF
897 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
898 /^CPU/{
899 s: ::g
900 p
901 }'`"
902 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
903 ;;
904 or32:Linux:*:*)
905 echo or32-unknown-linux-gnu
906 exit ;;
907 ppc:Linux:*:*)
908 echo powerpc-unknown-linux-gnu
909 exit ;;
910 ppc64:Linux:*:*)
911 echo powerpc64-unknown-linux-gnu
915 echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
916 exit ;;
917 *:Minix:*:*)
918 echo "$UNAME_MACHINE"-unknown-minix
919 exit ;;
920 aarch64:Linux:*:*)
921 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
922 exit ;;
923 aarch64_be:Linux:*:*)
924 UNAME_MACHINE=aarch64_be
925 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
912926 exit ;;
913927 alpha:Linux:*:*)
914 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
928 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
915929 EV5) UNAME_MACHINE=alphaev5 ;;
916930 EV56) UNAME_MACHINE=alphaev56 ;;
917931 PCA56) UNAME_MACHINE=alphapca56 ;;
919933 EV6) UNAME_MACHINE=alphaev6 ;;
920934 EV67) UNAME_MACHINE=alphaev67 ;;
921935 EV68*) UNAME_MACHINE=alphaev68 ;;
922 esac
923 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
924 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
925 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
936 esac
937 objdump --private-headers /bin/sh | grep -q ld.so.1
938 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
939 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
940 exit ;;
941 arc:Linux:*:* | arceb:Linux:*:*)
942 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
943 exit ;;
944 arm*:Linux:*:*)
945 set_cc_for_build
946 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
947 | grep -q __ARM_EABI__
948 then
949 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
950 else
951 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
952 | grep -q __ARM_PCS_VFP
953 then
954 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
955 else
956 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
957 fi
958 fi
959 exit ;;
960 avr32*:Linux:*:*)
961 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
962 exit ;;
963 cris:Linux:*:*)
964 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
965 exit ;;
966 crisv32:Linux:*:*)
967 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
968 exit ;;
969 e2k:Linux:*:*)
970 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
971 exit ;;
972 frv:Linux:*:*)
973 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
974 exit ;;
975 hexagon:Linux:*:*)
976 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
977 exit ;;
978 i*86:Linux:*:*)
979 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
980 exit ;;
981 ia64:Linux:*:*)
982 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
983 exit ;;
984 k1om:Linux:*:*)
985 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
986 exit ;;
987 m32r*:Linux:*:*)
988 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
989 exit ;;
990 m68*:Linux:*:*)
991 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
992 exit ;;
993 mips:Linux:*:* | mips64:Linux:*:*)
994 set_cc_for_build
995 IS_GLIBC=0
996 test x"${LIBC}" = xgnu && IS_GLIBC=1
997 sed 's/^ //' << EOF > "$dummy.c"
998 #undef CPU
999 #undef mips
1000 #undef mipsel
1001 #undef mips64
1002 #undef mips64el
1003 #if ${IS_GLIBC} && defined(_ABI64)
1004 LIBCABI=gnuabi64
1005 #else
1006 #if ${IS_GLIBC} && defined(_ABIN32)
1007 LIBCABI=gnuabin32
1008 #else
1009 LIBCABI=${LIBC}
1010 #endif
1011 #endif
1012
1013 #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1014 CPU=mipsisa64r6
1015 #else
1016 #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1017 CPU=mipsisa32r6
1018 #else
1019 #if defined(__mips64)
1020 CPU=mips64
1021 #else
1022 CPU=mips
1023 #endif
1024 #endif
1025 #endif
1026
1027 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1028 MIPS_ENDIAN=el
1029 #else
1030 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1031 MIPS_ENDIAN=
1032 #else
1033 MIPS_ENDIAN=
1034 #endif
1035 #endif
1036 EOF
1037 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
1038 test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1039 ;;
1040 mips64el:Linux:*:*)
1041 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1042 exit ;;
1043 openrisc*:Linux:*:*)
1044 echo or1k-unknown-linux-"$LIBC"
1045 exit ;;
1046 or32:Linux:*:* | or1k*:Linux:*:*)
1047 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1048 exit ;;
1049 padre:Linux:*:*)
1050 echo sparc-unknown-linux-"$LIBC"
1051 exit ;;
1052 parisc64:Linux:*:* | hppa64:Linux:*:*)
1053 echo hppa64-unknown-linux-"$LIBC"
9261054 exit ;;
9271055 parisc:Linux:*:* | hppa:Linux:*:*)
9281056 # Look for CPU level
9291057 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
930 PA7*) echo hppa1.1-unknown-linux-gnu ;;
931 PA8*) echo hppa2.0-unknown-linux-gnu ;;
932 *) echo hppa-unknown-linux-gnu ;;
1058 PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1059 PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1060 *) echo hppa-unknown-linux-"$LIBC" ;;
9331061 esac
9341062 exit ;;
935 parisc64:Linux:*:* | hppa64:Linux:*:*)
936 echo hppa64-unknown-linux-gnu
1063 ppc64:Linux:*:*)
1064 echo powerpc64-unknown-linux-"$LIBC"
1065 exit ;;
1066 ppc:Linux:*:*)
1067 echo powerpc-unknown-linux-"$LIBC"
1068 exit ;;
1069 ppc64le:Linux:*:*)
1070 echo powerpc64le-unknown-linux-"$LIBC"
1071 exit ;;
1072 ppcle:Linux:*:*)
1073 echo powerpcle-unknown-linux-"$LIBC"
1074 exit ;;
1075 riscv32:Linux:*:* | riscv64:Linux:*:*)
1076 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9371077 exit ;;
9381078 s390:Linux:*:* | s390x:Linux:*:*)
939 echo ${UNAME_MACHINE}-ibm-linux
1079 echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
9401080 exit ;;
9411081 sh64*:Linux:*:*)
942 echo ${UNAME_MACHINE}-unknown-linux-gnu
1082 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9431083 exit ;;
9441084 sh*:Linux:*:*)
945 echo ${UNAME_MACHINE}-unknown-linux-gnu
1085 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9461086 exit ;;
9471087 sparc:Linux:*:* | sparc64:Linux:*:*)
948 echo ${UNAME_MACHINE}-unknown-linux-gnu
1088 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1089 exit ;;
1090 tile*:Linux:*:*)
1091 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9491092 exit ;;
9501093 vax:Linux:*:*)
951 echo ${UNAME_MACHINE}-dec-linux-gnu
1094 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
9521095 exit ;;
9531096 x86_64:Linux:*:*)
954 echo x86_64-unknown-linux-gnu
955 exit ;;
956 xtensa:Linux:*:*)
957 echo xtensa-unknown-linux-gnu
958 exit ;;
959 i*86:Linux:*:*)
960 # The BFD linker knows what the default object file format is, so
961 # first see if it will tell us. cd to the root directory to prevent
962 # problems with other programs or directories called `ld' in the path.
963 # Set LC_ALL=C to ensure ld outputs messages in English.
964 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
965 | sed -ne '/supported targets:/!d
966 s/[ ][ ]*/ /g
967 s/.*supported targets: *//
968 s/ .*//
969 p'`
970 case "$ld_supported_targets" in
971 elf32-i386)
972 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
973 ;;
974 a.out-i386-linux)
975 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
976 exit ;;
977 coff-i386)
978 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
979 exit ;;
980 "")
981 # Either a pre-BFD a.out linker (linux-gnuoldld) or
982 # one that does not give us useful --help.
983 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
984 exit ;;
985 esac
986 # Determine whether the default compiler is a.out or elf
987 eval $set_cc_for_build
988 sed 's/^ //' << EOF >$dummy.c
989 #include <features.h>
990 #ifdef __ELF__
991 # ifdef __GLIBC__
992 # if __GLIBC__ >= 2
993 LIBC=gnu
994 # else
995 LIBC=gnulibc1
996 # endif
997 # else
998 LIBC=gnulibc1
999 # endif
1000 #else
1001 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1002 LIBC=gnu
1003 #else
1004 LIBC=gnuaout
1005 #endif
1006 #endif
1007 #ifdef __dietlibc__
1008 LIBC=dietlibc
1009 #endif
1010 EOF
1011 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1012 /^LIBC/{
1013 s: ::g
1014 p
1015 }'`"
1016 test x"${LIBC}" != x && {
1017 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1018 exit
1019 }
1020 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1021 ;;
1097 set_cc_for_build
1098 LIBCABI=$LIBC
1099 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1100 if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1101 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1102 grep IS_X32 >/dev/null
1103 then
1104 LIBCABI="$LIBC"x32
1105 fi
1106 fi
1107 echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
1108 exit ;;
1109 xtensa*:Linux:*:*)
1110 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1111 exit ;;
10221112 i*86:DYNIX/ptx:4*:*)
10231113 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10241114 # earlier versions are messed up and put the nodename in both
10261116 echo i386-sequent-sysv4
10271117 exit ;;
10281118 i*86:UNIX_SV:4.2MP:2.*)
1029 # Unixware is an offshoot of SVR4, but it has its own version
1030 # number series starting with 2...
1031 # I am not positive that other SVR4 systems won't match this,
1119 # Unixware is an offshoot of SVR4, but it has its own version
1120 # number series starting with 2...
1121 # I am not positive that other SVR4 systems won't match this,
10321122 # I just have to hope. -- rms.
1033 # Use sysv4.2uw... so that sysv4* matches it.
1034 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1123 # Use sysv4.2uw... so that sysv4* matches it.
1124 echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
10351125 exit ;;
10361126 i*86:OS/2:*:*)
10371127 # If we were able to find `uname', then EMX Unix compatibility
10381128 # is probably installed.
1039 echo ${UNAME_MACHINE}-pc-os2-emx
1129 echo "$UNAME_MACHINE"-pc-os2-emx
10401130 exit ;;
10411131 i*86:XTS-300:*:STOP)
1042 echo ${UNAME_MACHINE}-unknown-stop
1132 echo "$UNAME_MACHINE"-unknown-stop
10431133 exit ;;
10441134 i*86:atheos:*:*)
1045 echo ${UNAME_MACHINE}-unknown-atheos
1135 echo "$UNAME_MACHINE"-unknown-atheos
10461136 exit ;;
10471137 i*86:syllable:*:*)
1048 echo ${UNAME_MACHINE}-pc-syllable
1049 exit ;;
1050 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1051 echo i386-unknown-lynxos${UNAME_RELEASE}
1138 echo "$UNAME_MACHINE"-pc-syllable
1139 exit ;;
1140 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1141 echo i386-unknown-lynxos"$UNAME_RELEASE"
10521142 exit ;;
10531143 i*86:*DOS:*:*)
1054 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1055 exit ;;
1056 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1057 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1144 echo "$UNAME_MACHINE"-pc-msdosdjgpp
1145 exit ;;
1146 i*86:*:4.*:*)
1147 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
10581148 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1059 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1149 echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
10601150 else
1061 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1151 echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
10621152 fi
10631153 exit ;;
10641154 i*86:*:5:[678]*)
1065 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1155 # UnixWare 7.x, OpenUNIX and OpenServer 6.
10661156 case `/bin/uname -X | grep "^Machine"` in
10671157 *486*) UNAME_MACHINE=i486 ;;
10681158 *Pentium) UNAME_MACHINE=i586 ;;
10691159 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10701160 esac
1071 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1161 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
10721162 exit ;;
10731163 i*86:*:3.2:*)
10741164 if test -f /usr/options/cb.name; then
10751165 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1076 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1166 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
10771167 elif /bin/uname -X 2>/dev/null >/dev/null ; then
10781168 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10791169 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10831173 && UNAME_MACHINE=i686
10841174 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10851175 && UNAME_MACHINE=i686
1086 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1176 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
10871177 else
1088 echo ${UNAME_MACHINE}-pc-sysv32
1178 echo "$UNAME_MACHINE"-pc-sysv32
10891179 fi
10901180 exit ;;
10911181 pc:*:*:*)
10921182 # Left here for compatibility:
1093 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1094 # the processor, so we play safe by assuming i386.
1095 echo i386-pc-msdosdjgpp
1096 exit ;;
1183 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1184 # the processor, so we play safe by assuming i586.
1185 # Note: whatever this is, it MUST be the same as what config.sub
1186 # prints for the "djgpp" host, or else GDB configure will decide that
1187 # this is a cross-build.
1188 echo i586-pc-msdosdjgpp
1189 exit ;;
10971190 Intel:Mach:3*:*)
10981191 echo i386-pc-mach3
10991192 exit ;;
11021195 exit ;;
11031196 i860:*:4.*:*) # i860-SVR4
11041197 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1105 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1198 echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
11061199 else # Add other i860-SVR4 vendors below as they are discovered.
1107 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1200 echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
11081201 fi
11091202 exit ;;
11101203 mini*:CTIX:SYS*5:*)
11241217 test -r /etc/.relid \
11251218 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11261219 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1127 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1220 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11281221 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1129 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1222 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11301223 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1131 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1132 && { echo i486-ncr-sysv4; exit; } ;;
1224 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1225 && { echo i486-ncr-sysv4; exit; } ;;
1226 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1227 OS_REL='.3'
1228 test -r /etc/.relid \
1229 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1230 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1231 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1232 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1233 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1234 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1235 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11331236 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1134 echo m68k-unknown-lynxos${UNAME_RELEASE}
1237 echo m68k-unknown-lynxos"$UNAME_RELEASE"
11351238 exit ;;
11361239 mc68030:UNIX_System_V:4.*:*)
11371240 echo m68k-atari-sysv4
11381241 exit ;;
11391242 TSUNAMI:LynxOS:2.*:*)
1140 echo sparc-unknown-lynxos${UNAME_RELEASE}
1243 echo sparc-unknown-lynxos"$UNAME_RELEASE"
11411244 exit ;;
11421245 rs6000:LynxOS:2.*:*)
1143 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1144 exit ;;
1145 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1146 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1246 echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1247 exit ;;
1248 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1249 echo powerpc-unknown-lynxos"$UNAME_RELEASE"
11471250 exit ;;
11481251 SM[BE]S:UNIX_SV:*:*)
1149 echo mips-dde-sysv${UNAME_RELEASE}
1252 echo mips-dde-sysv"$UNAME_RELEASE"
11501253 exit ;;
11511254 RM*:ReliantUNIX-*:*:*)
11521255 echo mips-sni-sysv4
11571260 *:SINIX-*:*:*)
11581261 if uname -p 2>/dev/null >/dev/null ; then
11591262 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1160 echo ${UNAME_MACHINE}-sni-sysv4
1263 echo "$UNAME_MACHINE"-sni-sysv4
11611264 else
11621265 echo ns32k-sni-sysv
11631266 fi
11641267 exit ;;
1165 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1166 # says <Richard.M.Bartel@ccMail.Census.GOV>
1167 echo i586-unisys-sysv4
1168 exit ;;
1268 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1269 # says <Richard.M.Bartel@ccMail.Census.GOV>
1270 echo i586-unisys-sysv4
1271 exit ;;
11691272 *:UNIX_System_V:4*:FTX*)
11701273 # From Gerald Hewes <hewes@openmarket.com>.
11711274 # How about differentiating between stratus architectures? -djm
11771280 exit ;;
11781281 i*86:VOS:*:*)
11791282 # From Paul.Green@stratus.com.
1180 echo ${UNAME_MACHINE}-stratus-vos
1283 echo "$UNAME_MACHINE"-stratus-vos
11811284 exit ;;
11821285 *:VOS:*:*)
11831286 # From Paul.Green@stratus.com.
11841287 echo hppa1.1-stratus-vos
11851288 exit ;;
11861289 mc68*:A/UX:*:*)
1187 echo m68k-apple-aux${UNAME_RELEASE}
1290 echo m68k-apple-aux"$UNAME_RELEASE"
11881291 exit ;;
11891292 news*:NEWS-OS:6*:*)
11901293 echo mips-sony-newsos6
11911294 exit ;;
11921295 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
11931296 if [ -d /usr/nec ]; then
1194 echo mips-nec-sysv${UNAME_RELEASE}
1297 echo mips-nec-sysv"$UNAME_RELEASE"
11951298 else
1196 echo mips-unknown-sysv${UNAME_RELEASE}
1197 fi
1198 exit ;;
1299 echo mips-unknown-sysv"$UNAME_RELEASE"
1300 fi
1301 exit ;;
11991302 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
12001303 echo powerpc-be-beos
12011304 exit ;;
12051308 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
12061309 echo i586-pc-beos
12071310 exit ;;
1311 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1312 echo i586-pc-haiku
1313 exit ;;
1314 x86_64:Haiku:*:*)
1315 echo x86_64-unknown-haiku
1316 exit ;;
12081317 SX-4:SUPER-UX:*:*)
1209 echo sx4-nec-superux${UNAME_RELEASE}
1318 echo sx4-nec-superux"$UNAME_RELEASE"
12101319 exit ;;
12111320 SX-5:SUPER-UX:*:*)
1212 echo sx5-nec-superux${UNAME_RELEASE}
1321 echo sx5-nec-superux"$UNAME_RELEASE"
12131322 exit ;;
12141323 SX-6:SUPER-UX:*:*)
1215 echo sx6-nec-superux${UNAME_RELEASE}
1324 echo sx6-nec-superux"$UNAME_RELEASE"
12161325 exit ;;
12171326 SX-7:SUPER-UX:*:*)
1218 echo sx7-nec-superux${UNAME_RELEASE}
1327 echo sx7-nec-superux"$UNAME_RELEASE"
12191328 exit ;;
12201329 SX-8:SUPER-UX:*:*)
1221 echo sx8-nec-superux${UNAME_RELEASE}
1330 echo sx8-nec-superux"$UNAME_RELEASE"
12221331 exit ;;
12231332 SX-8R:SUPER-UX:*:*)
1224 echo sx8r-nec-superux${UNAME_RELEASE}
1333 echo sx8r-nec-superux"$UNAME_RELEASE"
1334 exit ;;
1335 SX-ACE:SUPER-UX:*:*)
1336 echo sxace-nec-superux"$UNAME_RELEASE"
12251337 exit ;;
12261338 Power*:Rhapsody:*:*)
1227 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1339 echo powerpc-apple-rhapsody"$UNAME_RELEASE"
12281340 exit ;;
12291341 *:Rhapsody:*:*)
1230 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1342 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
12311343 exit ;;
12321344 *:Darwin:*:*)
1233 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1345 UNAME_PROCESSOR=`uname -p`
12341346 case $UNAME_PROCESSOR in
12351347 unknown) UNAME_PROCESSOR=powerpc ;;
12361348 esac
1237 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1349 if command -v xcode-select > /dev/null 2> /dev/null && \
1350 ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1351 # Avoid executing cc if there is no toolchain installed as
1352 # cc will be a stub that puts up a graphical alert
1353 # prompting the user to install developer tools.
1354 CC_FOR_BUILD=no_compiler_found
1355 else
1356 set_cc_for_build
1357 fi
1358 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1359 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1360 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1361 grep IS_64BIT_ARCH >/dev/null
1362 then
1363 case $UNAME_PROCESSOR in
1364 i386) UNAME_PROCESSOR=x86_64 ;;
1365 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1366 esac
1367 fi
1368 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1369 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1370 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1371 grep IS_PPC >/dev/null
1372 then
1373 UNAME_PROCESSOR=powerpc
1374 fi
1375 elif test "$UNAME_PROCESSOR" = i386 ; then
1376 # uname -m returns i386 or x86_64
1377 UNAME_PROCESSOR=$UNAME_MACHINE
1378 fi
1379 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
12381380 exit ;;
12391381 *:procnto*:*:* | *:QNX:[0123456789]*:*)
12401382 UNAME_PROCESSOR=`uname -p`
1241 if test "$UNAME_PROCESSOR" = "x86"; then
1383 if test "$UNAME_PROCESSOR" = x86; then
12421384 UNAME_PROCESSOR=i386
12431385 UNAME_MACHINE=pc
12441386 fi
1245 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1387 echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
12461388 exit ;;
12471389 *:QNX:*:4*)
12481390 echo i386-pc-qnx
12491391 exit ;;
1250 NSE-?:NONSTOP_KERNEL:*:*)
1251 echo nse-tandem-nsk${UNAME_RELEASE}
1252 exit ;;
1253 NSR-?:NONSTOP_KERNEL:*:*)
1254 echo nsr-tandem-nsk${UNAME_RELEASE}
1392 NEO-*:NONSTOP_KERNEL:*:*)
1393 echo neo-tandem-nsk"$UNAME_RELEASE"
1394 exit ;;
1395 NSE-*:NONSTOP_KERNEL:*:*)
1396 echo nse-tandem-nsk"$UNAME_RELEASE"
1397 exit ;;
1398 NSR-*:NONSTOP_KERNEL:*:*)
1399 echo nsr-tandem-nsk"$UNAME_RELEASE"
1400 exit ;;
1401 NSV-*:NONSTOP_KERNEL:*:*)
1402 echo nsv-tandem-nsk"$UNAME_RELEASE"
1403 exit ;;
1404 NSX-*:NONSTOP_KERNEL:*:*)
1405 echo nsx-tandem-nsk"$UNAME_RELEASE"
12551406 exit ;;
12561407 *:NonStop-UX:*:*)
12571408 echo mips-compaq-nonstopux
12601411 echo bs2000-siemens-sysv
12611412 exit ;;
12621413 DS/*:UNIX_System_V:*:*)
1263 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1414 echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
12641415 exit ;;
12651416 *:Plan9:*:*)
12661417 # "uname -m" is not consistent, so use $cputype instead. 386
12671418 # is converted to i386 for consistency with other x86
12681419 # operating systems.
1269 if test "$cputype" = "386"; then
1420 # shellcheck disable=SC2154
1421 if test "$cputype" = 386; then
12701422 UNAME_MACHINE=i386
12711423 else
12721424 UNAME_MACHINE="$cputype"
12731425 fi
1274 echo ${UNAME_MACHINE}-unknown-plan9
1426 echo "$UNAME_MACHINE"-unknown-plan9
12751427 exit ;;
12761428 *:TOPS-10:*:*)
12771429 echo pdp10-unknown-tops10
12921444 echo pdp10-unknown-its
12931445 exit ;;
12941446 SEI:*:*:SEIUX)
1295 echo mips-sei-seiux${UNAME_RELEASE}
1447 echo mips-sei-seiux"$UNAME_RELEASE"
12961448 exit ;;
12971449 *:DragonFly:*:*)
1298 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1450 echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
12991451 exit ;;
13001452 *:*VMS:*:*)
1301 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1302 case "${UNAME_MACHINE}" in
1453 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1454 case "$UNAME_MACHINE" in
13031455 A*) echo alpha-dec-vms ; exit ;;
13041456 I*) echo ia64-dec-vms ; exit ;;
13051457 V*) echo vax-dec-vms ; exit ;;
13081460 echo i386-pc-xenix
13091461 exit ;;
13101462 i*86:skyos:*:*)
1311 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1463 echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
13121464 exit ;;
13131465 i*86:rdos:*:*)
1314 echo ${UNAME_MACHINE}-pc-rdos
1466 echo "$UNAME_MACHINE"-pc-rdos
1467 exit ;;
1468 i*86:AROS:*:*)
1469 echo "$UNAME_MACHINE"-pc-aros
1470 exit ;;
1471 x86_64:VMkernel:*:*)
1472 echo "$UNAME_MACHINE"-unknown-esx
1473 exit ;;
1474 amd64:Isilon\ OneFS:*:*)
1475 echo x86_64-unknown-onefs
1476 exit ;;
1477 *:Unleashed:*:*)
1478 echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
13151479 exit ;;
13161480 esac
13171481
1318 #echo '(No uname command or uname output not recognized.)' 1>&2
1319 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1320
1321 eval $set_cc_for_build
1322 cat >$dummy.c <<EOF
1482 # No uname command or uname output not recognized.
1483 set_cc_for_build
1484 cat > "$dummy.c" <<EOF
13231485 #ifdef _SEQUENT_
1324 # include <sys/types.h>
1325 # include <sys/utsname.h>
1486 #include <sys/types.h>
1487 #include <sys/utsname.h>
1488 #endif
1489 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1490 #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1491 #include <signal.h>
1492 #if defined(_SIZE_T_) || defined(SIGLOST)
1493 #include <sys/utsname.h>
1494 #endif
1495 #endif
13261496 #endif
13271497 main ()
13281498 {
13351505 #include <sys/param.h>
13361506 printf ("m68k-sony-newsos%s\n",
13371507 #ifdef NEWSOS4
1338 "4"
1508 "4"
13391509 #else
1340 ""
1341 #endif
1342 ); exit (0);
1343 #endif
1344 #endif
1345
1346 #if defined (__arm) && defined (__acorn) && defined (__unix)
1347 printf ("arm-acorn-riscix\n"); exit (0);
1348 #endif
1349
1350 #if defined (hp300) && !defined (hpux)
1351 printf ("m68k-hp-bsd\n"); exit (0);
1510 ""
1511 #endif
1512 ); exit (0);
1513 #endif
13521514 #endif
13531515
13541516 #if defined (NeXT)
13901552 #endif
13911553
13921554 #if defined (_SEQUENT_)
1393 struct utsname un;
1394
1395 uname(&un);
1396
1397 if (strncmp(un.version, "V2", 2) == 0) {
1398 printf ("i386-sequent-ptx2\n"); exit (0);
1399 }
1400 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1401 printf ("i386-sequent-ptx1\n"); exit (0);
1402 }
1403 printf ("i386-sequent-ptx\n"); exit (0);
1404
1555 struct utsname un;
1556
1557 uname(&un);
1558 if (strncmp(un.version, "V2", 2) == 0) {
1559 printf ("i386-sequent-ptx2\n"); exit (0);
1560 }
1561 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1562 printf ("i386-sequent-ptx1\n"); exit (0);
1563 }
1564 printf ("i386-sequent-ptx\n"); exit (0);
14051565 #endif
14061566
14071567 #if defined (vax)
1408 # if !defined (ultrix)
1409 # include <sys/param.h>
1410 # if defined (BSD)
1411 # if BSD == 43
1412 printf ("vax-dec-bsd4.3\n"); exit (0);
1413 # else
1414 # if BSD == 199006
1415 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1416 # else
1417 printf ("vax-dec-bsd\n"); exit (0);
1418 # endif
1419 # endif
1420 # else
1421 printf ("vax-dec-bsd\n"); exit (0);
1422 # endif
1423 # else
1424 printf ("vax-dec-ultrix\n"); exit (0);
1425 # endif
1568 #if !defined (ultrix)
1569 #include <sys/param.h>
1570 #if defined (BSD)
1571 #if BSD == 43
1572 printf ("vax-dec-bsd4.3\n"); exit (0);
1573 #else
1574 #if BSD == 199006
1575 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1576 #else
1577 printf ("vax-dec-bsd\n"); exit (0);
1578 #endif
1579 #endif
1580 #else
1581 printf ("vax-dec-bsd\n"); exit (0);
1582 #endif
1583 #else
1584 #if defined(_SIZE_T_) || defined(SIGLOST)
1585 struct utsname un;
1586 uname (&un);
1587 printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1588 #else
1589 printf ("vax-dec-ultrix\n"); exit (0);
1590 #endif
1591 #endif
1592 #endif
1593 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1594 #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1595 #if defined(_SIZE_T_) || defined(SIGLOST)
1596 struct utsname *un;
1597 uname (&un);
1598 printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1599 #else
1600 printf ("mips-dec-ultrix\n"); exit (0);
1601 #endif
1602 #endif
14261603 #endif
14271604
14281605 #if defined (alliant) && defined (i860)
14331610 }
14341611 EOF
14351612
1436 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1613 $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14371614 { echo "$SYSTEM_NAME"; exit; }
14381615
14391616 # Apollos put the system type in the environment.
1440
1441 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1442
1443 # Convex versions that predate uname can use getsysinfo(1)
1444
1445 if [ -x /usr/convex/getsysinfo ]
1446 then
1447 case `getsysinfo -f cpu_type` in
1448 c1*)
1449 echo c1-convex-bsd
1450 exit ;;
1451 c2*)
1452 if getsysinfo -f scalar_acc
1453 then echo c32-convex-bsd
1454 else echo c2-convex-bsd
1455 fi
1456 exit ;;
1457 c34*)
1458 echo c34-convex-bsd
1459 exit ;;
1460 c38*)
1461 echo c38-convex-bsd
1462 exit ;;
1463 c4*)
1464 echo c4-convex-bsd
1465 exit ;;
1466 esac
1467 fi
1617 test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1618
1619 echo "$0: unable to guess system type" >&2
1620
1621 case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1622 mips:Linux | mips64:Linux)
1623 # If we got here on MIPS GNU/Linux, output extra information.
1624 cat >&2 <<EOF
1625
1626 NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1627 the system type. Please install a C compiler and try again.
1628 EOF
1629 ;;
1630 esac
14681631
14691632 cat >&2 <<EOF
1470 $0: unable to guess system type
1471
1472 This script, last modified $timestamp, has failed to recognize
1473 the operating system you are using. It is advised that you
1474 download the most up to date version of the config scripts from
1475
1476 http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
1633
1634 This script (version $timestamp), has failed to recognize the
1635 operating system you are using. If your script is old, overwrite *all*
1636 copies of config.guess and config.sub with the latest versions from:
1637
1638 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
14771639 and
1478 http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1479
1480 If the version you run ($0) is already up to date, please
1481 send the following data and any information you think might be
1482 pertinent to <config-patches@gnu.org> in order to provide the needed
1483 information to handle your system.
1640 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1641 EOF
1642
1643 year=`echo $timestamp | sed 's,-.*,,'`
1644 # shellcheck disable=SC2003
1645 if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
1646 cat >&2 <<EOF
1647
1648 If $0 has already been updated, send the following data and any
1649 information you think might be pertinent to config-patches@gnu.org to
1650 provide the necessary information to handle your system.
14841651
14851652 config.guess timestamp = $timestamp
14861653
14991666 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
15001667 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15011668
1502 UNAME_MACHINE = ${UNAME_MACHINE}
1503 UNAME_RELEASE = ${UNAME_RELEASE}
1504 UNAME_SYSTEM = ${UNAME_SYSTEM}
1505 UNAME_VERSION = ${UNAME_VERSION}
1669 UNAME_MACHINE = "$UNAME_MACHINE"
1670 UNAME_RELEASE = "$UNAME_RELEASE"
1671 UNAME_SYSTEM = "$UNAME_SYSTEM"
1672 UNAME_VERSION = "$UNAME_VERSION"
15061673 EOF
1674 fi
15071675
15081676 exit 1
15091677
15101678 # Local variables:
1511 # eval: (add-hook 'write-file-hooks 'time-stamp)
1679 # eval: (add-hook 'before-save-hook 'time-stamp)
15121680 # time-stamp-start: "timestamp='"
15131681 # time-stamp-format: "%:y-%02m-%02d"
15141682 # time-stamp-end: "'"
+1524
-1354
config.sub less more
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
4 # Inc.
5
6 timestamp='2007-06-28'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine. It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
2 # Copyright 1992-2020 Free Software Foundation, Inc.
3
4 timestamp='2020-06-20'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
159 # (at your option) any later version.
1610 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
2115 #
2216 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 # 02110-1301, USA.
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
2618 #
2719 # As a special exception to the GNU General Public License, if you
2820 # distribute this file as part of a program that contains a
2921 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32
33 # Please send patches to <config-patches@gnu.org>. Submit a context
34 # diff and a properly formatted ChangeLog entry.
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches to <config-patches@gnu.org>.
3528 #
3629 # Configuration subroutine to validate and canonicalize a configuration type.
3730 # Supply the specified configuration type as an argument.
3831 # If it is invalid, we print an error message on stderr and exit with code 1.
3932 # Otherwise, we print the canonical config type on stdout and succeed.
33
34 # You can get the latest version of this script from:
35 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
4036
4137 # This file is supposed to be the same for all GNU packages
4238 # and recognize all the CPU types, system types and aliases
5652 me=`echo "$0" | sed -e 's,.*/,,'`
5753
5854 usage="\
59 Usage: $0 [OPTION] CPU-MFR-OPSYS
60 $0 [OPTION] ALIAS
55 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
6156
6257 Canonicalize a configuration name.
6358
64 Operation modes:
59 Options:
6560 -h, --help print this help, then exit
6661 -t, --time-stamp print date of last modification, then exit
6762 -v, --version print version number, then exit
7166 version="\
7267 GNU config.sub ($timestamp)
7368
74 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
75 Free Software Foundation, Inc.
69 Copyright 1992-2020 Free Software Foundation, Inc.
7670
7771 This is free software; see the source for copying conditions. There is NO
7872 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
9488 - ) # Use stdin as input.
9589 break ;;
9690 -* )
97 echo "$me: invalid option $1$help"
91 echo "$me: invalid option $1$help" >&2
9892 exit 1 ;;
9993
10094 *local*)
10195 # First pass through any local machine types.
102 echo $1
96 echo "$1"
10397 exit ;;
10498
10599 * )
115109 exit 1;;
116110 esac
117111
118 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
119 # Here we must recognize all the valid KERNEL-OS combinations.
120 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
121 case $maybe_os in
122 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
123 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
124 storm-chaos* | os2-emx* | rtmk-nova*)
125 os=-$maybe_os
126 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
127 ;;
128 *)
129 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
130 if [ $basic_machine != $1 ]
131 then os=`echo $1 | sed 's/.*-/-/'`
132 else os=; fi
133 ;;
112 # Split fields of configuration type
113 # shellcheck disable=SC2162
114 IFS="-" read field1 field2 field3 field4 <<EOF
115 $1
116 EOF
117
118 # Separate into logical components for further validation
119 case $1 in
120 *-*-*-*-*)
121 echo Invalid configuration \`"$1"\': more than four components >&2
122 exit 1
123 ;;
124 *-*-*-*)
125 basic_machine=$field1-$field2
126 os=$field3-$field4
127 ;;
128 *-*-*)
129 # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
130 # parts
131 maybe_os=$field2-$field3
132 case $maybe_os in
133 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
134 | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
135 | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
136 | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
137 | storm-chaos* | os2-emx* | rtmk-nova*)
138 basic_machine=$field1
139 os=$maybe_os
140 ;;
141 android-linux)
142 basic_machine=$field1-unknown
143 os=linux-android
144 ;;
145 *)
146 basic_machine=$field1-$field2
147 os=$field3
148 ;;
149 esac
150 ;;
151 *-*)
152 # A lone config we happen to match not fitting any pattern
153 case $field1-$field2 in
154 decstation-3100)
155 basic_machine=mips-dec
156 os=
157 ;;
158 *-*)
159 # Second component is usually, but not always the OS
160 case $field2 in
161 # Prevent following clause from handling this valid os
162 sun*os*)
163 basic_machine=$field1
164 os=$field2
165 ;;
166 # Manufacturers
167 dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
168 | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
169 | unicom* | ibm* | next | hp | isi* | apollo | altos* \
170 | convergent* | ncr* | news | 32* | 3600* | 3100* \
171 | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
172 | ultra | tti* | harris | dolphin | highlevel | gould \
173 | cbm | ns | masscomp | apple | axis | knuth | cray \
174 | microblaze* | sim | cisco \
175 | oki | wec | wrs | winbond)
176 basic_machine=$field1-$field2
177 os=
178 ;;
179 *)
180 basic_machine=$field1
181 os=$field2
182 ;;
183 esac
184 ;;
185 esac
186 ;;
187 *)
188 # Convert single-component short-hands not valid as part of
189 # multi-component configurations.
190 case $field1 in
191 386bsd)
192 basic_machine=i386-pc
193 os=bsd
194 ;;
195 a29khif)
196 basic_machine=a29k-amd
197 os=udi
198 ;;
199 adobe68k)
200 basic_machine=m68010-adobe
201 os=scout
202 ;;
203 alliant)
204 basic_machine=fx80-alliant
205 os=
206 ;;
207 altos | altos3068)
208 basic_machine=m68k-altos
209 os=
210 ;;
211 am29k)
212 basic_machine=a29k-none
213 os=bsd
214 ;;
215 amdahl)
216 basic_machine=580-amdahl
217 os=sysv
218 ;;
219 amiga)
220 basic_machine=m68k-unknown
221 os=
222 ;;
223 amigaos | amigados)
224 basic_machine=m68k-unknown
225 os=amigaos
226 ;;
227 amigaunix | amix)
228 basic_machine=m68k-unknown
229 os=sysv4
230 ;;
231 apollo68)
232 basic_machine=m68k-apollo
233 os=sysv
234 ;;
235 apollo68bsd)
236 basic_machine=m68k-apollo
237 os=bsd
238 ;;
239 aros)
240 basic_machine=i386-pc
241 os=aros
242 ;;
243 aux)
244 basic_machine=m68k-apple
245 os=aux
246 ;;
247 balance)
248 basic_machine=ns32k-sequent
249 os=dynix
250 ;;
251 blackfin)
252 basic_machine=bfin-unknown
253 os=linux
254 ;;
255 cegcc)
256 basic_machine=arm-unknown
257 os=cegcc
258 ;;
259 convex-c1)
260 basic_machine=c1-convex
261 os=bsd
262 ;;
263 convex-c2)
264 basic_machine=c2-convex
265 os=bsd
266 ;;
267 convex-c32)
268 basic_machine=c32-convex
269 os=bsd
270 ;;
271 convex-c34)
272 basic_machine=c34-convex
273 os=bsd
274 ;;
275 convex-c38)
276 basic_machine=c38-convex
277 os=bsd
278 ;;
279 cray)
280 basic_machine=j90-cray
281 os=unicos
282 ;;
283 crds | unos)
284 basic_machine=m68k-crds
285 os=
286 ;;
287 da30)
288 basic_machine=m68k-da30
289 os=
290 ;;
291 decstation | pmax | pmin | dec3100 | decstatn)
292 basic_machine=mips-dec
293 os=
294 ;;
295 delta88)
296 basic_machine=m88k-motorola
297 os=sysv3
298 ;;
299 dicos)
300 basic_machine=i686-pc
301 os=dicos
302 ;;
303 djgpp)
304 basic_machine=i586-pc
305 os=msdosdjgpp
306 ;;
307 ebmon29k)
308 basic_machine=a29k-amd
309 os=ebmon
310 ;;
311 es1800 | OSE68k | ose68k | ose | OSE)
312 basic_machine=m68k-ericsson
313 os=ose
314 ;;
315 gmicro)
316 basic_machine=tron-gmicro
317 os=sysv
318 ;;
319 go32)
320 basic_machine=i386-pc
321 os=go32
322 ;;
323 h8300hms)
324 basic_machine=h8300-hitachi
325 os=hms
326 ;;
327 h8300xray)
328 basic_machine=h8300-hitachi
329 os=xray
330 ;;
331 h8500hms)
332 basic_machine=h8500-hitachi
333 os=hms
334 ;;
335 harris)
336 basic_machine=m88k-harris
337 os=sysv3
338 ;;
339 hp300 | hp300hpux)
340 basic_machine=m68k-hp
341 os=hpux
342 ;;
343 hp300bsd)
344 basic_machine=m68k-hp
345 os=bsd
346 ;;
347 hppaosf)
348 basic_machine=hppa1.1-hp
349 os=osf
350 ;;
351 hppro)
352 basic_machine=hppa1.1-hp
353 os=proelf
354 ;;
355 i386mach)
356 basic_machine=i386-mach
357 os=mach
358 ;;
359 isi68 | isi)
360 basic_machine=m68k-isi
361 os=sysv
362 ;;
363 m68knommu)
364 basic_machine=m68k-unknown
365 os=linux
366 ;;
367 magnum | m3230)
368 basic_machine=mips-mips
369 os=sysv
370 ;;
371 merlin)
372 basic_machine=ns32k-utek
373 os=sysv
374 ;;
375 mingw64)
376 basic_machine=x86_64-pc
377 os=mingw64
378 ;;
379 mingw32)
380 basic_machine=i686-pc
381 os=mingw32
382 ;;
383 mingw32ce)
384 basic_machine=arm-unknown
385 os=mingw32ce
386 ;;
387 monitor)
388 basic_machine=m68k-rom68k
389 os=coff
390 ;;
391 morphos)
392 basic_machine=powerpc-unknown
393 os=morphos
394 ;;
395 moxiebox)
396 basic_machine=moxie-unknown
397 os=moxiebox
398 ;;
399 msdos)
400 basic_machine=i386-pc
401 os=msdos
402 ;;
403 msys)
404 basic_machine=i686-pc
405 os=msys
406 ;;
407 mvs)
408 basic_machine=i370-ibm
409 os=mvs
410 ;;
411 nacl)
412 basic_machine=le32-unknown
413 os=nacl
414 ;;
415 ncr3000)
416 basic_machine=i486-ncr
417 os=sysv4
418 ;;
419 netbsd386)
420 basic_machine=i386-pc
421 os=netbsd
422 ;;
423 netwinder)
424 basic_machine=armv4l-rebel
425 os=linux
426 ;;
427 news | news700 | news800 | news900)
428 basic_machine=m68k-sony
429 os=newsos
430 ;;
431 news1000)
432 basic_machine=m68030-sony
433 os=newsos
434 ;;
435 necv70)
436 basic_machine=v70-nec
437 os=sysv
438 ;;
439 nh3000)
440 basic_machine=m68k-harris
441 os=cxux
442 ;;
443 nh[45]000)
444 basic_machine=m88k-harris
445 os=cxux
446 ;;
447 nindy960)
448 basic_machine=i960-intel
449 os=nindy
450 ;;
451 mon960)
452 basic_machine=i960-intel
453 os=mon960
454 ;;
455 nonstopux)
456 basic_machine=mips-compaq
457 os=nonstopux
458 ;;
459 os400)
460 basic_machine=powerpc-ibm
461 os=os400
462 ;;
463 OSE68000 | ose68000)
464 basic_machine=m68000-ericsson
465 os=ose
466 ;;
467 os68k)
468 basic_machine=m68k-none
469 os=os68k
470 ;;
471 paragon)
472 basic_machine=i860-intel
473 os=osf
474 ;;
475 parisc)
476 basic_machine=hppa-unknown
477 os=linux
478 ;;
479 psp)
480 basic_machine=mipsallegrexel-sony
481 os=psp
482 ;;
483 pw32)
484 basic_machine=i586-unknown
485 os=pw32
486 ;;
487 rdos | rdos64)
488 basic_machine=x86_64-pc
489 os=rdos
490 ;;
491 rdos32)
492 basic_machine=i386-pc
493 os=rdos
494 ;;
495 rom68k)
496 basic_machine=m68k-rom68k
497 os=coff
498 ;;
499 sa29200)
500 basic_machine=a29k-amd
501 os=udi
502 ;;
503 sei)
504 basic_machine=mips-sei
505 os=seiux
506 ;;
507 sequent)
508 basic_machine=i386-sequent
509 os=
510 ;;
511 sps7)
512 basic_machine=m68k-bull
513 os=sysv2
514 ;;
515 st2000)
516 basic_machine=m68k-tandem
517 os=
518 ;;
519 stratus)
520 basic_machine=i860-stratus
521 os=sysv4
522 ;;
523 sun2)
524 basic_machine=m68000-sun
525 os=
526 ;;
527 sun2os3)
528 basic_machine=m68000-sun
529 os=sunos3
530 ;;
531 sun2os4)
532 basic_machine=m68000-sun
533 os=sunos4
534 ;;
535 sun3)
536 basic_machine=m68k-sun
537 os=
538 ;;
539 sun3os3)
540 basic_machine=m68k-sun
541 os=sunos3
542 ;;
543 sun3os4)
544 basic_machine=m68k-sun
545 os=sunos4
546 ;;
547 sun4)
548 basic_machine=sparc-sun
549 os=
550 ;;
551 sun4os3)
552 basic_machine=sparc-sun
553 os=sunos3
554 ;;
555 sun4os4)
556 basic_machine=sparc-sun
557 os=sunos4
558 ;;
559 sun4sol2)
560 basic_machine=sparc-sun
561 os=solaris2
562 ;;
563 sun386 | sun386i | roadrunner)
564 basic_machine=i386-sun
565 os=
566 ;;
567 sv1)
568 basic_machine=sv1-cray
569 os=unicos
570 ;;
571 symmetry)
572 basic_machine=i386-sequent
573 os=dynix
574 ;;
575 t3e)
576 basic_machine=alphaev5-cray
577 os=unicos
578 ;;
579 t90)
580 basic_machine=t90-cray
581 os=unicos
582 ;;
583 toad1)
584 basic_machine=pdp10-xkl
585 os=tops20
586 ;;
587 tpf)
588 basic_machine=s390x-ibm
589 os=tpf
590 ;;
591 udi29k)
592 basic_machine=a29k-amd
593 os=udi
594 ;;
595 ultra3)
596 basic_machine=a29k-nyu
597 os=sym1
598 ;;
599 v810 | necv810)
600 basic_machine=v810-nec
601 os=none
602 ;;
603 vaxv)
604 basic_machine=vax-dec
605 os=sysv
606 ;;
607 vms)
608 basic_machine=vax-dec
609 os=vms
610 ;;
611 vsta)
612 basic_machine=i386-pc
613 os=vsta
614 ;;
615 vxworks960)
616 basic_machine=i960-wrs
617 os=vxworks
618 ;;
619 vxworks68)
620 basic_machine=m68k-wrs
621 os=vxworks
622 ;;
623 vxworks29k)
624 basic_machine=a29k-wrs
625 os=vxworks
626 ;;
627 xbox)
628 basic_machine=i686-pc
629 os=mingw32
630 ;;
631 ymp)
632 basic_machine=ymp-cray
633 os=unicos
634 ;;
635 *)
636 basic_machine=$1
637 os=
638 ;;
639 esac
640 ;;
134641 esac
135642
136 ### Let's recognize common machines as not being operating systems so
137 ### that things like config.sub decstation-3100 work. We also
138 ### recognize some manufacturers as not being operating systems, so we
139 ### can provide default operating systems below.
140 case $os in
141 -sun*os*)
142 # Prevent following clause from handling this invalid input.
143 ;;
144 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
145 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
146 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
150 -apple | -axis | -knuth | -cray)
151 os=
152 basic_machine=$1
153 ;;
154 -sim | -cisco | -oki | -wec | -winbond)
155 os=
156 basic_machine=$1
157 ;;
158 -scout)
159 ;;
160 -wrs)
161 os=-vxworks
162 basic_machine=$1
163 ;;
164 -chorusos*)
165 os=-chorusos
166 basic_machine=$1
167 ;;
168 -chorusrdb)
169 os=-chorusrdb
170 basic_machine=$1
171 ;;
172 -hiux*)
173 os=-hiuxwe2
174 ;;
175 -sco6)
176 os=-sco5v6
177 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
178 ;;
179 -sco5)
180 os=-sco3.2v5
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco4)
184 os=-sco3.2v4
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco3.2.[4-9]*)
188 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2v[4-9]*)
192 # Don't forget version if it is 3.2v4 or newer.
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco5v6*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco*)
200 os=-sco3.2v2
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -udk*)
204 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -isc)
207 os=-isc2.2
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -clix*)
211 basic_machine=clipper-intergraph
212 ;;
213 -isc*)
214 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215 ;;
216 -lynx*)
217 os=-lynxos
218 ;;
219 -ptx*)
220 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
221 ;;
222 -windowsnt*)
223 os=`echo $os | sed -e 's/windowsnt/winnt/'`
224 ;;
225 -psos*)
226 os=-psos
227 ;;
228 -mint | -mint[0-9]*)
229 basic_machine=m68k-atari
230 os=-mint
231 ;;
232 esac
233
234 # Decode aliases for certain CPU-COMPANY combinations.
643 # Decode 1-component or ad-hoc basic machines
235644 case $basic_machine in
236 # Recognize the basic CPU types without company name.
237 # Some are omitted here because they have special meanings below.
238 1750a | 580 \
239 | a29k \
240 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
241 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
242 | am33_2.0 \
243 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
244 | bfin \
245 | c4x | clipper \
246 | d10v | d30v | dlx | dsp16xx \
247 | fido | fr30 | frv \
248 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
249 | i370 | i860 | i960 | ia64 \
250 | ip2k | iq2000 \
251 | m32c | m32r | m32rle | m68000 | m68k | m88k \
252 | maxq | mb | microblaze | mcore | mep \
253 | mips | mipsbe | mipseb | mipsel | mipsle \
254 | mips16 \
255 | mips64 | mips64el \
256 | mips64vr | mips64vrel \
257 | mips64orion | mips64orionel \
258 | mips64vr4100 | mips64vr4100el \
259 | mips64vr4300 | mips64vr4300el \
260 | mips64vr5000 | mips64vr5000el \
261 | mips64vr5900 | mips64vr5900el \
262 | mipsisa32 | mipsisa32el \
263 | mipsisa32r2 | mipsisa32r2el \
264 | mipsisa64 | mipsisa64el \
265 | mipsisa64r2 | mipsisa64r2el \
266 | mipsisa64sb1 | mipsisa64sb1el \
267 | mipsisa64sr71k | mipsisa64sr71kel \
268 | mipstx39 | mipstx39el \
269 | mn10200 | mn10300 \
270 | mt \
271 | msp430 \
272 | nios | nios2 \
273 | ns16k | ns32k \
274 | or32 \
275 | pdp10 | pdp11 | pj | pjl \
276 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
277 | pyramid \
278 | score \
279 | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
280 | sh64 | sh64le \
281 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
282 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
283 | spu | strongarm \
284 | tahoe | thumb | tic4x | tic80 | tron \
285 | v850 | v850e \
286 | we32k \
287 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
288 | z8k)
289 basic_machine=$basic_machine-unknown
290 ;;
291 m6811 | m68hc11 | m6812 | m68hc12)
292 # Motorola 68HC11/12.
293 basic_machine=$basic_machine-unknown
294 os=-none
295 ;;
296 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
297 ;;
298 ms1)
299 basic_machine=mt-unknown
300 ;;
301
645 # Here we handle the default manufacturer of certain CPU types. It is in
646 # some cases the only manufacturer, in others, it is the most popular.
647 w89k)
648 cpu=hppa1.1
649 vendor=winbond
650 ;;
651 op50n)
652 cpu=hppa1.1
653 vendor=oki
654 ;;
655 op60c)
656 cpu=hppa1.1
657 vendor=oki
658 ;;
659 ibm*)
660 cpu=i370
661 vendor=ibm
662 ;;
663 orion105)
664 cpu=clipper
665 vendor=highlevel
666 ;;
667 mac | mpw | mac-mpw)
668 cpu=m68k
669 vendor=apple
670 ;;
671 pmac | pmac-mpw)
672 cpu=powerpc
673 vendor=apple
674 ;;
675
676 # Recognize the various machine names and aliases which stand
677 # for a CPU type and a company and sometimes even an OS.
678 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
679 cpu=m68000
680 vendor=att
681 ;;
682 3b*)
683 cpu=we32k
684 vendor=att
685 ;;
686 bluegene*)
687 cpu=powerpc
688 vendor=ibm
689 os=cnk
690 ;;
691 decsystem10* | dec10*)
692 cpu=pdp10
693 vendor=dec
694 os=tops10
695 ;;
696 decsystem20* | dec20*)
697 cpu=pdp10
698 vendor=dec
699 os=tops20
700 ;;
701 delta | 3300 | motorola-3300 | motorola-delta \
702 | 3300-motorola | delta-motorola)
703 cpu=m68k
704 vendor=motorola
705 ;;
706 dpx2*)
707 cpu=m68k
708 vendor=bull
709 os=sysv3
710 ;;
711 encore | umax | mmax)
712 cpu=ns32k
713 vendor=encore
714 ;;
715 elxsi)
716 cpu=elxsi
717 vendor=elxsi
718 os=${os:-bsd}
719 ;;
720 fx2800)
721 cpu=i860
722 vendor=alliant
723 ;;
724 genix)
725 cpu=ns32k
726 vendor=ns
727 ;;
728 h3050r* | hiux*)
729 cpu=hppa1.1
730 vendor=hitachi
731 os=hiuxwe2
732 ;;
733 hp3k9[0-9][0-9] | hp9[0-9][0-9])
734 cpu=hppa1.0
735 vendor=hp
736 ;;
737 hp9k2[0-9][0-9] | hp9k31[0-9])
738 cpu=m68000
739 vendor=hp
740 ;;
741 hp9k3[2-9][0-9])
742 cpu=m68k
743 vendor=hp
744 ;;
745 hp9k6[0-9][0-9] | hp6[0-9][0-9])
746 cpu=hppa1.0
747 vendor=hp
748 ;;
749 hp9k7[0-79][0-9] | hp7[0-79][0-9])
750 cpu=hppa1.1
751 vendor=hp
752 ;;
753 hp9k78[0-9] | hp78[0-9])
754 # FIXME: really hppa2.0-hp
755 cpu=hppa1.1
756 vendor=hp
757 ;;
758 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
759 # FIXME: really hppa2.0-hp
760 cpu=hppa1.1
761 vendor=hp
762 ;;
763 hp9k8[0-9][13679] | hp8[0-9][13679])
764 cpu=hppa1.1
765 vendor=hp
766 ;;
767 hp9k8[0-9][0-9] | hp8[0-9][0-9])
768 cpu=hppa1.0
769 vendor=hp
770 ;;
771 i*86v32)
772 cpu=`echo "$1" | sed -e 's/86.*/86/'`
773 vendor=pc
774 os=sysv32
775 ;;
776 i*86v4*)
777 cpu=`echo "$1" | sed -e 's/86.*/86/'`
778 vendor=pc
779 os=sysv4
780 ;;
781 i*86v)
782 cpu=`echo "$1" | sed -e 's/86.*/86/'`
783 vendor=pc
784 os=sysv
785 ;;
786 i*86sol2)
787 cpu=`echo "$1" | sed -e 's/86.*/86/'`
788 vendor=pc
789 os=solaris2
790 ;;
791 j90 | j90-cray)
792 cpu=j90
793 vendor=cray
794 os=${os:-unicos}
795 ;;
796 iris | iris4d)
797 cpu=mips
798 vendor=sgi
799 case $os in
800 irix*)
801 ;;
802 *)
803 os=irix4
804 ;;
805 esac
806 ;;
807 miniframe)
808 cpu=m68000
809 vendor=convergent
810 ;;
811 *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
812 cpu=m68k
813 vendor=atari
814 os=mint
815 ;;
816 news-3600 | risc-news)
817 cpu=mips
818 vendor=sony
819 os=newsos
820 ;;
821 next | m*-next)
822 cpu=m68k
823 vendor=next
824 case $os in
825 openstep*)
826 ;;
827 nextstep*)
828 ;;
829 ns2*)
830 os=nextstep2
831 ;;
832 *)
833 os=nextstep3
834 ;;
835 esac
836 ;;
837 np1)
838 cpu=np1
839 vendor=gould
840 ;;
841 op50n-* | op60c-*)
842 cpu=hppa1.1
843 vendor=oki
844 os=proelf
845 ;;
846 pa-hitachi)
847 cpu=hppa1.1
848 vendor=hitachi
849 os=hiuxwe2
850 ;;
851 pbd)
852 cpu=sparc
853 vendor=tti
854 ;;
855 pbb)
856 cpu=m68k
857 vendor=tti
858 ;;
859 pc532)
860 cpu=ns32k
861 vendor=pc532
862 ;;
863 pn)
864 cpu=pn
865 vendor=gould
866 ;;
867 power)
868 cpu=power
869 vendor=ibm
870 ;;
871 ps2)
872 cpu=i386
873 vendor=ibm
874 ;;
875 rm[46]00)
876 cpu=mips
877 vendor=siemens
878 ;;
879 rtpc | rtpc-*)
880 cpu=romp
881 vendor=ibm
882 ;;
883 sde)
884 cpu=mipsisa32
885 vendor=sde
886 os=${os:-elf}
887 ;;
888 simso-wrs)
889 cpu=sparclite
890 vendor=wrs
891 os=vxworks
892 ;;
893 tower | tower-32)
894 cpu=m68k
895 vendor=ncr
896 ;;
897 vpp*|vx|vx-*)
898 cpu=f301
899 vendor=fujitsu
900 ;;
901 w65)
902 cpu=w65
903 vendor=wdc
904 ;;
905 w89k-*)
906 cpu=hppa1.1
907 vendor=winbond
908 os=proelf
909 ;;
910 none)
911 cpu=none
912 vendor=none
913 ;;
914 leon|leon[3-9])
915 cpu=sparc
916 vendor=$basic_machine
917 ;;
918 leon-*|leon[3-9]-*)
919 cpu=sparc
920 vendor=`echo "$basic_machine" | sed 's/-.*//'`
921 ;;
922
923 *-*)
924 # shellcheck disable=SC2162
925 IFS="-" read cpu vendor <<EOF
926 $basic_machine
927 EOF
928 ;;
302929 # We use `pc' rather than `unknown'
303930 # because (1) that's what they normally are, and
304931 # (2) the word "unknown" tends to confuse beginning users.
305932 i*86 | x86_64)
306 basic_machine=$basic_machine-pc
307 ;;
308 # Object if more than one company name word.
309 *-*-*)
310 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
311 exit 1
312 ;;
313 # Recognize the basic CPU types with company name.
314 580-* \
315 | a29k-* \
316 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
317 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
318 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
319 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
320 | avr-* | avr32-* \
321 | bfin-* | bs2000-* \
322 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
323 | clipper-* | craynv-* | cydra-* \
324 | d10v-* | d30v-* | dlx-* \
325 | elxsi-* \
326 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
327 | h8300-* | h8500-* \
328 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
329 | i*86-* | i860-* | i960-* | ia64-* \
330 | ip2k-* | iq2000-* \
331 | m32c-* | m32r-* | m32rle-* \
332 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
333 | m88110-* | m88k-* | maxq-* | mcore-* \
334 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
335 | mips16-* \
336 | mips64-* | mips64el-* \
337 | mips64vr-* | mips64vrel-* \
338 | mips64orion-* | mips64orionel-* \
339 | mips64vr4100-* | mips64vr4100el-* \
340 | mips64vr4300-* | mips64vr4300el-* \
341 | mips64vr5000-* | mips64vr5000el-* \
342 | mips64vr5900-* | mips64vr5900el-* \
343 | mipsisa32-* | mipsisa32el-* \
344 | mipsisa32r2-* | mipsisa32r2el-* \
345 | mipsisa64-* | mipsisa64el-* \
346 | mipsisa64r2-* | mipsisa64r2el-* \
347 | mipsisa64sb1-* | mipsisa64sb1el-* \
348 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
349 | mipstx39-* | mipstx39el-* \
350 | mmix-* \
351 | mt-* \
352 | msp430-* \
353 | nios-* | nios2-* \
354 | none-* | np1-* | ns16k-* | ns32k-* \
355 | orion-* \
356 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
357 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
358 | pyramid-* \
359 | romp-* | rs6000-* \
360 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
361 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
362 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
363 | sparclite-* \
364 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
365 | tahoe-* | thumb-* \
366 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
367 | tron-* \
368 | v850-* | v850e-* | vax-* \
369 | we32k-* \
370 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
371 | xstormy16-* | xtensa-* \
372 | ymp-* \
373 | z8k-*)
374 ;;
375 # Recognize the various machine names and aliases which stand
376 # for a CPU type and a company and sometimes even an OS.
377 386bsd)
378 basic_machine=i386-unknown
379 os=-bsd
380 ;;
381 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
382 basic_machine=m68000-att
383 ;;
384 3b*)
385 basic_machine=we32k-att
386 ;;
387 a29khif)
388 basic_machine=a29k-amd
389 os=-udi
390 ;;
391 abacus)
392 basic_machine=abacus-unknown
393 ;;
394 adobe68k)
395 basic_machine=m68010-adobe
396 os=-scout
397 ;;
398 alliant | fx80)
399 basic_machine=fx80-alliant
400 ;;
401 altos | altos3068)
402 basic_machine=m68k-altos
403 ;;
404 am29k)
405 basic_machine=a29k-none
406 os=-bsd
407 ;;
408 amd64)
409 basic_machine=x86_64-pc
410 ;;
933 cpu=$basic_machine
934 vendor=pc
935 ;;
936 # These rules are duplicated from below for sake of the special case above;
937 # i.e. things that normalized to x86 arches should also default to "pc"
938 pc98)
939 cpu=i386
940 vendor=pc
941 ;;
942 x64 | amd64)
943 cpu=x86_64
944 vendor=pc
945 ;;
946 # Recognize the basic CPU types without company name.
947 *)
948 cpu=$basic_machine
949 vendor=unknown
950 ;;
951 esac
952
953 unset -v basic_machine
954
955 # Decode basic machines in the full and proper CPU-Company form.
956 case $cpu-$vendor in
957 # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
958 # some cases the only manufacturer, in others, it is the most popular.
959 craynv-unknown)
960 vendor=cray
961 os=${os:-unicosmp}
962 ;;
963 c90-unknown | c90-cray)
964 vendor=cray
965 os=${os:-unicos}
966 ;;
967 fx80-unknown)
968 vendor=alliant
969 ;;
970 romp-unknown)
971 vendor=ibm
972 ;;
973 mmix-unknown)
974 vendor=knuth
975 ;;
976 microblaze-unknown | microblazeel-unknown)
977 vendor=xilinx
978 ;;
979 rs6000-unknown)
980 vendor=ibm
981 ;;
982 vax-unknown)
983 vendor=dec
984 ;;
985 pdp11-unknown)
986 vendor=dec
987 ;;
988 we32k-unknown)
989 vendor=att
990 ;;
991 cydra-unknown)
992 vendor=cydrome
993 ;;
994 i370-ibm*)
995 vendor=ibm
996 ;;
997 orion-unknown)
998 vendor=highlevel
999 ;;
1000 xps-unknown | xps100-unknown)
1001 cpu=xps100
1002 vendor=honeywell
1003 ;;
1004
1005 # Here we normalize CPU types with a missing or matching vendor
1006 dpx20-unknown | dpx20-bull)
1007 cpu=rs6000
1008 vendor=bull
1009 os=${os:-bosx}
1010 ;;
1011
1012 # Here we normalize CPU types irrespective of the vendor
4111013 amd64-*)
412 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
413 ;;
414 amdahl)
415 basic_machine=580-amdahl
416 os=-sysv
417 ;;
418 amiga | amiga-*)
419 basic_machine=m68k-unknown
420 ;;
421 amigaos | amigados)
422 basic_machine=m68k-unknown
423 os=-amigaos
424 ;;
425 amigaunix | amix)
426 basic_machine=m68k-unknown
427 os=-sysv4
428 ;;
429 apollo68)
430 basic_machine=m68k-apollo
431 os=-sysv
432 ;;
433 apollo68bsd)
434 basic_machine=m68k-apollo
435 os=-bsd
436 ;;
437 aux)
438 basic_machine=m68k-apple
439 os=-aux
440 ;;
441 balance)
442 basic_machine=ns32k-sequent
443 os=-dynix
444 ;;
445 c90)
446 basic_machine=c90-cray
447 os=-unicos
448 ;;
449 convex-c1)
450 basic_machine=c1-convex
451 os=-bsd
452 ;;
453 convex-c2)
454 basic_machine=c2-convex
455 os=-bsd
456 ;;
457 convex-c32)
458 basic_machine=c32-convex
459 os=-bsd
460 ;;
461 convex-c34)
462 basic_machine=c34-convex
463 os=-bsd
464 ;;
465 convex-c38)
466 basic_machine=c38-convex
467 os=-bsd
468 ;;
469 cray | j90)
470 basic_machine=j90-cray
471 os=-unicos
472 ;;
473 craynv)
474 basic_machine=craynv-cray
475 os=-unicosmp
476 ;;
477 cr16)
478 basic_machine=cr16-unknown
479 os=-elf
480 ;;
481 crds | unos)
482 basic_machine=m68k-crds
483 ;;
484 crisv32 | crisv32-* | etraxfs*)
485 basic_machine=crisv32-axis
486 ;;
487 cris | cris-* | etrax*)
488 basic_machine=cris-axis
489 ;;
490 crx)
491 basic_machine=crx-unknown
492 os=-elf
493 ;;
494 da30 | da30-*)
495 basic_machine=m68k-da30
496 ;;
497 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
498 basic_machine=mips-dec
499 ;;
500 decsystem10* | dec10*)
501 basic_machine=pdp10-dec
502 os=-tops10
503 ;;
504 decsystem20* | dec20*)
505 basic_machine=pdp10-dec
506 os=-tops20
507 ;;
508 delta | 3300 | motorola-3300 | motorola-delta \
509 | 3300-motorola | delta-motorola)
510 basic_machine=m68k-motorola
511 ;;
512 delta88)
513 basic_machine=m88k-motorola
514 os=-sysv3
515 ;;
516 djgpp)
517 basic_machine=i586-pc
518 os=-msdosdjgpp
519 ;;
520 dpx20 | dpx20-*)
521 basic_machine=rs6000-bull
522 os=-bosx
523 ;;
524 dpx2* | dpx2*-bull)
525 basic_machine=m68k-bull
526 os=-sysv3
527 ;;
528 ebmon29k)
529 basic_machine=a29k-amd
530 os=-ebmon
531 ;;
532 elxsi)
533 basic_machine=elxsi-elxsi
534 os=-bsd
535 ;;
536 encore | umax | mmax)
537 basic_machine=ns32k-encore
538 ;;
539 es1800 | OSE68k | ose68k | ose | OSE)
540 basic_machine=m68k-ericsson
541 os=-ose
542 ;;
543 fx2800)
544 basic_machine=i860-alliant
545 ;;
546 genix)
547 basic_machine=ns32k-ns
548 ;;
549 gmicro)
550 basic_machine=tron-gmicro
551 os=-sysv
552 ;;
553 go32)
554 basic_machine=i386-pc
555 os=-go32
556 ;;
557 h3050r* | hiux*)
558 basic_machine=hppa1.1-hitachi
559 os=-hiuxwe2
560 ;;
561 h8300hms)
562 basic_machine=h8300-hitachi
563 os=-hms
564 ;;
565 h8300xray)
566 basic_machine=h8300-hitachi
567 os=-xray
568 ;;
569 h8500hms)
570 basic_machine=h8500-hitachi
571 os=-hms
572 ;;
573 harris)
574 basic_machine=m88k-harris
575 os=-sysv3
576 ;;
577 hp300-*)
578 basic_machine=m68k-hp
579 ;;
580 hp300bsd)
581 basic_machine=m68k-hp
582 os=-bsd
583 ;;
584 hp300hpux)
585 basic_machine=m68k-hp
586 os=-hpux
587 ;;
588 hp3k9[0-9][0-9] | hp9[0-9][0-9])
589 basic_machine=hppa1.0-hp
590 ;;
591 hp9k2[0-9][0-9] | hp9k31[0-9])
592 basic_machine=m68000-hp
593 ;;
594 hp9k3[2-9][0-9])
595 basic_machine=m68k-hp
596 ;;
597 hp9k6[0-9][0-9] | hp6[0-9][0-9])
598 basic_machine=hppa1.0-hp
599 ;;
600 hp9k7[0-79][0-9] | hp7[0-79][0-9])
601 basic_machine=hppa1.1-hp
602 ;;
603 hp9k78[0-9] | hp78[0-9])
604 # FIXME: really hppa2.0-hp
605 basic_machine=hppa1.1-hp
606 ;;
607 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
608 # FIXME: really hppa2.0-hp
609 basic_machine=hppa1.1-hp
610 ;;
611 hp9k8[0-9][13679] | hp8[0-9][13679])
612 basic_machine=hppa1.1-hp
613 ;;
614 hp9k8[0-9][0-9] | hp8[0-9][0-9])
615 basic_machine=hppa1.0-hp
616 ;;
617 hppa-next)
618 os=-nextstep3
619 ;;
620 hppaosf)
621 basic_machine=hppa1.1-hp
622 os=-osf
623 ;;
624 hppro)
625 basic_machine=hppa1.1-hp
626 os=-proelf
627 ;;
628 i370-ibm* | ibm*)
629 basic_machine=i370-ibm
630 ;;
631 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
632 i*86v32)
633 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
634 os=-sysv32
635 ;;
636 i*86v4*)
637 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
638 os=-sysv4
639 ;;
640 i*86v)
641 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
642 os=-sysv
643 ;;
644 i*86sol2)
645 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
646 os=-solaris2
647 ;;
648 i386mach)
649 basic_machine=i386-mach
650 os=-mach
651 ;;
652 i386-vsta | vsta)
653 basic_machine=i386-unknown
654 os=-vsta
655 ;;
656 iris | iris4d)
657 basic_machine=mips-sgi
658 case $os in
659 -irix*)
1014 cpu=x86_64
1015 ;;
1016 blackfin-*)
1017 cpu=bfin
1018 os=linux
1019 ;;
1020 c54x-*)
1021 cpu=tic54x
1022 ;;
1023 c55x-*)
1024 cpu=tic55x
1025 ;;
1026 c6x-*)
1027 cpu=tic6x
1028 ;;
1029 e500v[12]-*)
1030 cpu=powerpc
1031 os=$os"spe"
1032 ;;
1033 mips3*-*)
1034 cpu=mips64
1035 ;;
1036 ms1-*)
1037 cpu=mt
1038 ;;
1039 m68knommu-*)
1040 cpu=m68k
1041 os=linux
1042 ;;
1043 m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
1044 cpu=s12z
1045 ;;
1046 openrisc-*)
1047 cpu=or32
1048 ;;
1049 parisc-*)
1050 cpu=hppa
1051 os=linux
1052 ;;
1053 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1054 cpu=i586
1055 ;;
1056 pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
1057 cpu=i686
1058 ;;
1059 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1060 cpu=i686
1061 ;;
1062 pentium4-*)
1063 cpu=i786
1064 ;;
1065 pc98-*)
1066 cpu=i386
1067 ;;
1068 ppc-* | ppcbe-*)
1069 cpu=powerpc
1070 ;;
1071 ppcle-* | powerpclittle-*)
1072 cpu=powerpcle
1073 ;;
1074 ppc64-*)
1075 cpu=powerpc64
1076 ;;
1077 ppc64le-* | powerpc64little-*)
1078 cpu=powerpc64le
1079 ;;
1080 sb1-*)
1081 cpu=mipsisa64sb1
1082 ;;
1083 sb1el-*)
1084 cpu=mipsisa64sb1el
1085 ;;
1086 sh5e[lb]-*)
1087 cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1088 ;;
1089 spur-*)
1090 cpu=spur
1091 ;;
1092 strongarm-* | thumb-*)
1093 cpu=arm
1094 ;;
1095 tx39-*)
1096 cpu=mipstx39
1097 ;;
1098 tx39el-*)
1099 cpu=mipstx39el
1100 ;;
1101 x64-*)
1102 cpu=x86_64
1103 ;;
1104 xscale-* | xscalee[bl]-*)
1105 cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1106 ;;
1107
1108 # Recognize the canonical CPU Types that limit and/or modify the
1109 # company names they are paired with.
1110 cr16-*)
1111 os=${os:-elf}
1112 ;;
1113 crisv32-* | etraxfs*-*)
1114 cpu=crisv32
1115 vendor=axis
1116 ;;
1117 cris-* | etrax*-*)
1118 cpu=cris
1119 vendor=axis
1120 ;;
1121 crx-*)
1122 os=${os:-elf}
1123 ;;
1124 neo-tandem)
1125 cpu=neo
1126 vendor=tandem
1127 ;;
1128 nse-tandem)
1129 cpu=nse
1130 vendor=tandem
1131 ;;
1132 nsr-tandem)
1133 cpu=nsr
1134 vendor=tandem
1135 ;;
1136 nsv-tandem)
1137 cpu=nsv
1138 vendor=tandem
1139 ;;
1140 nsx-tandem)
1141 cpu=nsx
1142 vendor=tandem
1143 ;;
1144 mipsallegrexel-sony)
1145 cpu=mipsallegrexel
1146 vendor=sony
1147 ;;
1148 tile*-*)
1149 os=${os:-linux-gnu}
1150 ;;
1151
1152 *)
1153 # Recognize the canonical CPU types that are allowed with any
1154 # company name.
1155 case $cpu in
1156 1750a | 580 \
1157 | a29k \
1158 | aarch64 | aarch64_be \
1159 | abacus \
1160 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1161 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1162 | alphapca5[67] | alpha64pca5[67] \
1163 | am33_2.0 \
1164 | amdgcn \
1165 | arc | arceb \
1166 | arm | arm[lb]e | arme[lb] | armv* \
1167 | avr | avr32 \
1168 | asmjs \
1169 | ba \
1170 | be32 | be64 \
1171 | bfin | bpf | bs2000 \
1172 | c[123]* | c30 | [cjt]90 | c4x \
1173 | c8051 | clipper | craynv | csky | cydra \
1174 | d10v | d30v | dlx | dsp16xx \
1175 | e2k | elxsi | epiphany \
1176 | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1177 | h8300 | h8500 \
1178 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1179 | hexagon \
1180 | i370 | i*86 | i860 | i960 | ia16 | ia64 \
1181 | ip2k | iq2000 \
1182 | k1om \
1183 | le32 | le64 \
1184 | lm32 \
1185 | m32c | m32r | m32rle \
1186 | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1187 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1188 | m88110 | m88k | maxq | mb | mcore | mep | metag \
1189 | microblaze | microblazeel \
1190 | mips | mipsbe | mipseb | mipsel | mipsle \
1191 | mips16 \
1192 | mips64 | mips64eb | mips64el \
1193 | mips64octeon | mips64octeonel \
1194 | mips64orion | mips64orionel \
1195 | mips64r5900 | mips64r5900el \
1196 | mips64vr | mips64vrel \
1197 | mips64vr4100 | mips64vr4100el \
1198 | mips64vr4300 | mips64vr4300el \
1199 | mips64vr5000 | mips64vr5000el \
1200 | mips64vr5900 | mips64vr5900el \
1201 | mipsisa32 | mipsisa32el \
1202 | mipsisa32r2 | mipsisa32r2el \
1203 | mipsisa32r6 | mipsisa32r6el \
1204 | mipsisa64 | mipsisa64el \
1205 | mipsisa64r2 | mipsisa64r2el \
1206 | mipsisa64r6 | mipsisa64r6el \
1207 | mipsisa64sb1 | mipsisa64sb1el \
1208 | mipsisa64sr71k | mipsisa64sr71kel \
1209 | mipsr5900 | mipsr5900el \
1210 | mipstx39 | mipstx39el \
1211 | mmix \
1212 | mn10200 | mn10300 \
1213 | moxie \
1214 | mt \
1215 | msp430 \
1216 | nds32 | nds32le | nds32be \
1217 | nfp \
1218 | nios | nios2 | nios2eb | nios2el \
1219 | none | np1 | ns16k | ns32k | nvptx \
1220 | open8 \
1221 | or1k* \
1222 | or32 \
1223 | orion \
1224 | picochip \
1225 | pdp10 | pdp11 | pj | pjl | pn | power \
1226 | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1227 | pru \
1228 | pyramid \
1229 | riscv | riscv32 | riscv64 \
1230 | rl78 | romp | rs6000 | rx \
1231 | s390 | s390x \
1232 | score \
1233 | sh | shl \
1234 | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1235 | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1236 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1237 | sparclite \
1238 | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
1239 | spu \
1240 | tahoe \
1241 | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1242 | tron \
1243 | ubicom32 \
1244 | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1245 | vax \
1246 | visium \
1247 | w65 \
1248 | wasm32 | wasm64 \
1249 | we32k \
1250 | x86 | x86_64 | xc16x | xgate | xps100 \
1251 | xstormy16 | xtensa* \
1252 | ymp \
1253 | z8k | z80)
1254 ;;
1255
1256 *)
1257 echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
1258 exit 1
1259 ;;
1260 esac
1261 ;;
1262 esac
1263
1264 # Here we canonicalize certain aliases for manufacturers.
1265 case $vendor in
1266 digital*)
1267 vendor=dec
1268 ;;
1269 commodore*)
1270 vendor=cbm
1271 ;;
1272 *)
1273 ;;
1274 esac
1275
1276 # Decode manufacturer-specific aliases for certain operating systems.
1277
1278 if [ x$os != x ]
1279 then
1280 case $os in
1281 # First match some system type aliases that might get confused
1282 # with valid system types.
1283 # solaris* is a basic system type, with this one exception.
1284 auroraux)
1285 os=auroraux
1286 ;;
1287 bluegene*)
1288 os=cnk
1289 ;;
1290 solaris1 | solaris1.*)
1291 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1292 ;;
1293 solaris)
1294 os=solaris2
1295 ;;
1296 unixware*)
1297 os=sysv4.2uw
1298 ;;
1299 gnu/linux*)
1300 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1301 ;;
1302 # es1800 is here to avoid being matched by es* (a different OS)
1303 es1800*)
1304 os=ose
1305 ;;
1306 # Some version numbers need modification
1307 chorusos*)
1308 os=chorusos
1309 ;;
1310 isc)
1311 os=isc2.2
1312 ;;
1313 sco6)
1314 os=sco5v6
1315 ;;
1316 sco5)
1317 os=sco3.2v5
1318 ;;
1319 sco4)
1320 os=sco3.2v4
1321 ;;
1322 sco3.2.[4-9]*)
1323 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1324 ;;
1325 sco3.2v[4-9]* | sco5v6*)
1326 # Don't forget version if it is 3.2v4 or newer.
1327 ;;
1328 scout)
1329 # Don't match below
1330 ;;
1331 sco*)
1332 os=sco3.2v2
1333 ;;
1334 psos*)
1335 os=psos
1336 ;;
1337 # Now accept the basic system types.
1338 # The portable systems comes first.
1339 # Each alternative MUST end in a * to match a version number.
1340 # sysv* is not here because it comes later, after sysvr4.
1341 gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1342 | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
1343 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1344 | sym* | kopensolaris* | plan9* \
1345 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1346 | aos* | aros* | cloudabi* | sortix* | twizzler* \
1347 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1348 | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1349 | knetbsd* | mirbsd* | netbsd* \
1350 | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
1351 | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
1352 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1353 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1354 | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
1355 | chorusrdb* | cegcc* | glidix* \
1356 | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1357 | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
1358 | linux-newlib* | linux-musl* | linux-uclibc* \
1359 | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1360 | interix* | uwin* | mks* | rhapsody* | darwin* \
1361 | openstep* | oskit* | conix* | pw32* | nonstopux* \
1362 | storm-chaos* | tops10* | tenex* | tops20* | its* \
1363 | os2* | vos* | palmos* | uclinux* | nucleus* \
1364 | morphos* | superux* | rtmk* | windiss* \
1365 | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1366 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1367 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1368 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1369 | nsk* | powerunix* | genode*)
1370 # Remember, each alternative MUST END IN *, to match a version number.
1371 ;;
1372 qnx*)
1373 case $cpu in
1374 x86 | i*86)
6601375 ;;
6611376 *)
662 os=-irix4
1377 os=nto-$os
6631378 ;;
6641379 esac
6651380 ;;
666 isi68 | isi)
667 basic_machine=m68k-isi
668 os=-sysv
669 ;;
670 m88k-omron*)
671 basic_machine=m88k-omron
672 ;;
673 magnum | m3230)
674 basic_machine=mips-mips
675 os=-sysv
676 ;;
677 merlin)
678 basic_machine=ns32k-utek
679 os=-sysv
680 ;;
681 mingw32)
682 basic_machine=i386-pc
683 os=-mingw32
684 ;;
685 mingw32ce)
686 basic_machine=arm-unknown
687 os=-mingw32ce
688 ;;
689 miniframe)
690 basic_machine=m68000-convergent
691 ;;
692 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
693 basic_machine=m68k-atari
694 os=-mint
695 ;;
696 mips3*-*)
697 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
698 ;;
699 mips3*)
700 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
701 ;;
702 monitor)
703 basic_machine=m68k-rom68k
704 os=-coff
705 ;;
706 morphos)
707 basic_machine=powerpc-unknown
708 os=-morphos
709 ;;
710 msdos)
711 basic_machine=i386-pc
712 os=-msdos
713 ;;
714 ms1-*)
715 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
716 ;;
717 mvs)
718 basic_machine=i370-ibm
719 os=-mvs
720 ;;
721 ncr3000)
722 basic_machine=i486-ncr
723 os=-sysv4
724 ;;
725 netbsd386)
726 basic_machine=i386-unknown
727 os=-netbsd
728 ;;
729 netwinder)
730 basic_machine=armv4l-rebel
731 os=-linux
732 ;;
733 news | news700 | news800 | news900)
734 basic_machine=m68k-sony
735 os=-newsos
736 ;;
737 news1000)
738 basic_machine=m68030-sony
739 os=-newsos
740 ;;
741 news-3600 | risc-news)
742 basic_machine=mips-sony
743 os=-newsos
744 ;;
745 necv70)
746 basic_machine=v70-nec
747 os=-sysv
748 ;;
749 next | m*-next )
750 basic_machine=m68k-next
751 case $os in
752 -nextstep* )
753 ;;
754 -ns2*)
755 os=-nextstep2
1381 hiux*)
1382 os=hiuxwe2
1383 ;;
1384 nto-qnx*)
1385 ;;
1386 nto*)
1387 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1388 ;;
1389 sim | xray | os68k* | v88r* \
1390 | windows* | osx | abug | netware* | os9* \
1391 | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
1392 ;;
1393 linux-dietlibc)
1394 os=linux-dietlibc
1395 ;;
1396 linux*)
1397 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1398 ;;
1399 lynx*178)
1400 os=lynxos178
1401 ;;
1402 lynx*5)
1403 os=lynxos5
1404 ;;
1405 lynx*)
1406 os=lynxos
1407 ;;
1408 mac*)
1409 os=`echo "$os" | sed -e 's|mac|macos|'`
1410 ;;
1411 opened*)
1412 os=openedition
1413 ;;
1414 os400*)
1415 os=os400
1416 ;;
1417 sunos5*)
1418 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1419 ;;
1420 sunos6*)
1421 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1422 ;;
1423 wince*)
1424 os=wince
1425 ;;
1426 utek*)
1427 os=bsd
1428 ;;
1429 dynix*)
1430 os=bsd
1431 ;;
1432 acis*)
1433 os=aos
1434 ;;
1435 atheos*)
1436 os=atheos
1437 ;;
1438 syllable*)
1439 os=syllable
1440 ;;
1441 386bsd)
1442 os=bsd
1443 ;;
1444 ctix* | uts*)
1445 os=sysv
1446 ;;
1447 nova*)
1448 os=rtmk-nova
1449 ;;
1450 ns2)
1451 os=nextstep2
1452 ;;
1453 # Preserve the version number of sinix5.
1454 sinix5.*)
1455 os=`echo $os | sed -e 's|sinix|sysv|'`
1456 ;;
1457 sinix*)
1458 os=sysv4
1459 ;;
1460 tpf*)
1461 os=tpf
1462 ;;
1463 triton*)
1464 os=sysv3
1465 ;;
1466 oss*)
1467 os=sysv3
1468 ;;
1469 svr4*)
1470 os=sysv4
1471 ;;
1472 svr3)
1473 os=sysv3
1474 ;;
1475 sysvr4)
1476 os=sysv4
1477 ;;
1478 # This must come after sysvr4.
1479 sysv*)
1480 ;;
1481 ose*)
1482 os=ose
1483 ;;
1484 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1485 os=mint
1486 ;;
1487 zvmoe)
1488 os=zvmoe
1489 ;;
1490 dicos*)
1491 os=dicos
1492 ;;
1493 pikeos*)
1494 # Until real need of OS specific support for
1495 # particular features comes up, bare metal
1496 # configurations are quite functional.
1497 case $cpu in
1498 arm*)
1499 os=eabi
7561500 ;;
7571501 *)
758 os=-nextstep3
1502 os=elf
7591503 ;;
7601504 esac
7611505 ;;
762 nh3000)
763 basic_machine=m68k-harris
764 os=-cxux
765 ;;
766 nh[45]000)
767 basic_machine=m88k-harris
768 os=-cxux
769 ;;
770 nindy960)
771 basic_machine=i960-intel
772 os=-nindy
773 ;;
774 mon960)
775 basic_machine=i960-intel
776 os=-mon960
777 ;;
778 nonstopux)
779 basic_machine=mips-compaq
780 os=-nonstopux
781 ;;
782 np1)
783 basic_machine=np1-gould
784 ;;
785 nsr-tandem)
786 basic_machine=nsr-tandem
787 ;;
788 op50n-* | op60c-*)
789 basic_machine=hppa1.1-oki
790 os=-proelf
791 ;;
792 openrisc | openrisc-*)
793 basic_machine=or32-unknown
794 ;;
795 os400)
796 basic_machine=powerpc-ibm
797 os=-os400
798 ;;
799 OSE68000 | ose68000)
800 basic_machine=m68000-ericsson
801 os=-ose
802 ;;
803 os68k)
804 basic_machine=m68k-none
805 os=-os68k
806 ;;
807 pa-hitachi)
808 basic_machine=hppa1.1-hitachi
809 os=-hiuxwe2
810 ;;
811 paragon)
812 basic_machine=i860-intel
813 os=-osf
814 ;;
815 pbd)
816 basic_machine=sparc-tti
817 ;;
818 pbb)
819 basic_machine=m68k-tti
820 ;;
821 pc532 | pc532-*)
822 basic_machine=ns32k-pc532
823 ;;
824 pc98)
825 basic_machine=i386-pc
826 ;;
827 pc98-*)
828 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
829 ;;
830 pentium | p5 | k5 | k6 | nexgen | viac3)
831 basic_machine=i586-pc
832 ;;
833 pentiumpro | p6 | 6x86 | athlon | athlon_*)
834 basic_machine=i686-pc
835 ;;
836 pentiumii | pentium2 | pentiumiii | pentium3)
837 basic_machine=i686-pc
838 ;;
839 pentium4)
840 basic_machine=i786-pc
841 ;;
842 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
843 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
844 ;;
845 pentiumpro-* | p6-* | 6x86-* | athlon-*)
846 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
847 ;;
848 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
849 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
850 ;;
851 pentium4-*)
852 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
853 ;;
854 pn)
855 basic_machine=pn-gould
856 ;;
857 power) basic_machine=power-ibm
858 ;;
859 ppc) basic_machine=powerpc-unknown
860 ;;
861 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
862 ;;
863 ppcle | powerpclittle | ppc-le | powerpc-little)
864 basic_machine=powerpcle-unknown
865 ;;
866 ppcle-* | powerpclittle-*)
867 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
868 ;;
869 ppc64) basic_machine=powerpc64-unknown
870 ;;
871 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
872 ;;
873 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
874 basic_machine=powerpc64le-unknown
875 ;;
876 ppc64le-* | powerpc64little-*)
877 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
878 ;;
879 ps2)
880 basic_machine=i386-ibm
881 ;;
882 pw32)
883 basic_machine=i586-unknown
884 os=-pw32
885 ;;
886 rdos)
887 basic_machine=i386-pc
888 os=-rdos
889 ;;
890 rom68k)
891 basic_machine=m68k-rom68k
892 os=-coff
893 ;;
894 rm[46]00)
895 basic_machine=mips-siemens
896 ;;
897 rtpc | rtpc-*)
898 basic_machine=romp-ibm
899 ;;
900 s390 | s390-*)
901 basic_machine=s390-ibm
902 ;;
903 s390x | s390x-*)
904 basic_machine=s390x-ibm
905 ;;
906 sa29200)
907 basic_machine=a29k-amd
908 os=-udi
909 ;;
910 sb1)
911 basic_machine=mipsisa64sb1-unknown
912 ;;
913 sb1el)
914 basic_machine=mipsisa64sb1el-unknown
915 ;;
916 sde)
917 basic_machine=mipsisa32-sde
918 os=-elf
919 ;;
920 sei)
921 basic_machine=mips-sei
922 os=-seiux
923 ;;
924 sequent)
925 basic_machine=i386-sequent
926 ;;
927 sh)
928 basic_machine=sh-hitachi
929 os=-hms
930 ;;
931 sh5el)
932 basic_machine=sh5le-unknown
933 ;;
934 sh64)
935 basic_machine=sh64-unknown
936 ;;
937 sparclite-wrs | simso-wrs)
938 basic_machine=sparclite-wrs
939 os=-vxworks
940 ;;
941 sps7)
942 basic_machine=m68k-bull
943 os=-sysv2
944 ;;
945 spur)
946 basic_machine=spur-unknown
947 ;;
948 st2000)
949 basic_machine=m68k-tandem
950 ;;
951 stratus)
952 basic_machine=i860-stratus
953 os=-sysv4
954 ;;
955 sun2)
956 basic_machine=m68000-sun
957 ;;
958 sun2os3)
959 basic_machine=m68000-sun
960 os=-sunos3
961 ;;
962 sun2os4)
963 basic_machine=m68000-sun
964 os=-sunos4
965 ;;
966 sun3os3)
967 basic_machine=m68k-sun
968 os=-sunos3
969 ;;
970 sun3os4)
971 basic_machine=m68k-sun
972 os=-sunos4
973 ;;
974 sun4os3)
975 basic_machine=sparc-sun
976 os=-sunos3
977 ;;
978 sun4os4)
979 basic_machine=sparc-sun
980 os=-sunos4
981 ;;
982 sun4sol2)
983 basic_machine=sparc-sun
984 os=-solaris2
985 ;;
986 sun3 | sun3-*)
987 basic_machine=m68k-sun
988 ;;
989 sun4)
990 basic_machine=sparc-sun
991 ;;
992 sun386 | sun386i | roadrunner)
993 basic_machine=i386-sun
994 ;;
995 sv1)
996 basic_machine=sv1-cray
997 os=-unicos
998 ;;
999 symmetry)
1000 basic_machine=i386-sequent
1001 os=-dynix
1002 ;;
1003 t3e)
1004 basic_machine=alphaev5-cray
1005 os=-unicos
1006 ;;
1007 t90)
1008 basic_machine=t90-cray
1009 os=-unicos
1010 ;;
1011 tic54x | c54x*)
1012 basic_machine=tic54x-unknown
1013 os=-coff
1014 ;;
1015 tic55x | c55x*)
1016 basic_machine=tic55x-unknown
1017 os=-coff
1018 ;;
1019 tic6x | c6x*)
1020 basic_machine=tic6x-unknown
1021 os=-coff
1022 ;;
1023 tx39)
1024 basic_machine=mipstx39-unknown
1025 ;;
1026 tx39el)
1027 basic_machine=mipstx39el-unknown
1028 ;;
1029 toad1)
1030 basic_machine=pdp10-xkl
1031 os=-tops20
1032 ;;
1033 tower | tower-32)
1034 basic_machine=m68k-ncr
1035 ;;
1036 tpf)
1037 basic_machine=s390x-ibm
1038 os=-tpf
1039 ;;
1040 udi29k)
1041 basic_machine=a29k-amd
1042 os=-udi
1043 ;;
1044 ultra3)
1045 basic_machine=a29k-nyu
1046 os=-sym1
1047 ;;
1048 v810 | necv810)
1049 basic_machine=v810-nec
1050 os=-none
1051 ;;
1052 vaxv)
1053 basic_machine=vax-dec
1054 os=-sysv
1055 ;;
1056 vms)
1057 basic_machine=vax-dec
1058 os=-vms
1059 ;;
1060 vpp*|vx|vx-*)
1061 basic_machine=f301-fujitsu
1062 ;;
1063 vxworks960)
1064 basic_machine=i960-wrs
1065 os=-vxworks
1066 ;;
1067 vxworks68)
1068 basic_machine=m68k-wrs
1069 os=-vxworks
1070 ;;
1071 vxworks29k)
1072 basic_machine=a29k-wrs
1073 os=-vxworks
1074 ;;
1075 w65*)
1076 basic_machine=w65-wdc
1077 os=-none
1078 ;;
1079 w89k-*)
1080 basic_machine=hppa1.1-winbond
1081 os=-proelf
1082 ;;
1083 xbox)
1084 basic_machine=i686-pc
1085 os=-mingw32
1086 ;;
1087 xps | xps100)
1088 basic_machine=xps100-honeywell
1089 ;;
1090 ymp)
1091 basic_machine=ymp-cray
1092 os=-unicos
1093 ;;
1094 z8k-*-coff)
1095 basic_machine=z8k-unknown
1096 os=-sim
1506 nacl*)
1507 ;;
1508 ios)
1509 ;;
1510 psp)
10971511 ;;
10981512 none)
1099 basic_machine=none-none
1100 os=-none
1101 ;;
1102
1103 # Here we handle the default manufacturer of certain CPU types. It is in
1104 # some cases the only manufacturer, in others, it is the most popular.
1105 w89k)
1106 basic_machine=hppa1.1-winbond
1107 ;;
1108 op50n)
1109 basic_machine=hppa1.1-oki
1110 ;;
1111 op60c)
1112 basic_machine=hppa1.1-oki
1113 ;;
1114 romp)
1115 basic_machine=romp-ibm
1116 ;;
1117 mmix)
1118 basic_machine=mmix-knuth
1119 ;;
1120 rs6000)
1121 basic_machine=rs6000-ibm
1122 ;;
1123 vax)
1124 basic_machine=vax-dec
1125 ;;
1126 pdp10)
1127 # there are many clones, so DEC is not a safe bet
1128 basic_machine=pdp10-unknown
1129 ;;
1130 pdp11)
1131 basic_machine=pdp11-dec
1132 ;;
1133 we32k)
1134 basic_machine=we32k-att
1135 ;;
1136 sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1137 basic_machine=sh-unknown
1138 ;;
1139 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1140 basic_machine=sparc-sun
1141 ;;
1142 cydra)
1143 basic_machine=cydra-cydrome
1144 ;;
1145 orion)
1146 basic_machine=orion-highlevel
1147 ;;
1148 orion105)
1149 basic_machine=clipper-highlevel
1150 ;;
1151 mac | mpw | mac-mpw)
1152 basic_machine=m68k-apple
1153 ;;
1154 pmac | pmac-mpw)
1155 basic_machine=powerpc-apple
1156 ;;
1157 *-unknown)
1158 # Make sure to match an already-canonicalized machine name.
1513 ;;
1514 *-eabi)
11591515 ;;
11601516 *)
1161 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1162 exit 1
1163 ;;
1164 esac
1165
1166 # Here we canonicalize certain aliases for manufacturers.
1167 case $basic_machine in
1168 *-digital*)
1169 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1170 ;;
1171 *-commodore*)
1172 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1173 ;;
1174 *)
1175 ;;
1176 esac
1177
1178 # Decode manufacturer-specific aliases for certain operating systems.
1179
1180 if [ x"$os" != x"" ]
1181 then
1182 case $os in
1183 # First match some system type aliases
1184 # that might get confused with valid system types.
1185 # -solaris* is a basic system type, with this one exception.
1186 -solaris1 | -solaris1.*)
1187 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1188 ;;
1189 -solaris)
1190 os=-solaris2
1191 ;;
1192 -svr4*)
1193 os=-sysv4
1194 ;;
1195 -unixware*)
1196 os=-sysv4.2uw
1197 ;;
1198 -gnu/linux*)
1199 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1200 ;;
1201 # First accept the basic system types.
1202 # The portable systems comes first.
1203 # Each alternative MUST END IN A *, to match a version number.
1204 # -sysv* is not here because it comes later, after sysvr4.
1205 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1206 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1207 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1208 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1209 | -aos* \
1210 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1211 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1212 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1213 | -openbsd* | -solidbsd* \
1214 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1215 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1216 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1217 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1218 | -chorusos* | -chorusrdb* \
1219 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1220 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1221 | -uxpv* | -beos* | -mpeix* | -udk* \
1222 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1223 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1224 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1225 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1226 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1227 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1228 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1229 # Remember, each alternative MUST END IN *, to match a version number.
1230 ;;
1231 -qnx*)
1232 case $basic_machine in
1233 x86-* | i*86-*)
1234 ;;
1235 *)
1236 os=-nto$os
1237 ;;
1238 esac
1239 ;;
1240 -nto-qnx*)
1241 ;;
1242 -nto*)
1243 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1244 ;;
1245 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1246 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1247 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1248 ;;
1249 -mac*)
1250 os=`echo $os | sed -e 's|mac|macos|'`
1251 ;;
1252 -linux-dietlibc)
1253 os=-linux-dietlibc
1254 ;;
1255 -linux*)
1256 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1257 ;;
1258 -sunos5*)
1259 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1260 ;;
1261 -sunos6*)
1262 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1263 ;;
1264 -opened*)
1265 os=-openedition
1266 ;;
1267 -os400*)
1268 os=-os400
1269 ;;
1270 -wince*)
1271 os=-wince
1272 ;;
1273 -osfrose*)
1274 os=-osfrose
1275 ;;
1276 -osf*)
1277 os=-osf
1278 ;;
1279 -utek*)
1280 os=-bsd
1281 ;;
1282 -dynix*)
1283 os=-bsd
1284 ;;
1285 -acis*)
1286 os=-aos
1287 ;;
1288 -atheos*)
1289 os=-atheos
1290 ;;
1291 -syllable*)
1292 os=-syllable
1293 ;;
1294 -386bsd)
1295 os=-bsd
1296 ;;
1297 -ctix* | -uts*)
1298 os=-sysv
1299 ;;
1300 -nova*)
1301 os=-rtmk-nova
1302 ;;
1303 -ns2 )
1304 os=-nextstep2
1305 ;;
1306 -nsk*)
1307 os=-nsk
1308 ;;
1309 # Preserve the version number of sinix5.
1310 -sinix5.*)
1311 os=`echo $os | sed -e 's|sinix|sysv|'`
1312 ;;
1313 -sinix*)
1314 os=-sysv4
1315 ;;
1316 -tpf*)
1317 os=-tpf
1318 ;;
1319 -triton*)
1320 os=-sysv3
1321 ;;
1322 -oss*)
1323 os=-sysv3
1324 ;;
1325 -svr4)
1326 os=-sysv4
1327 ;;
1328 -svr3)
1329 os=-sysv3
1330 ;;
1331 -sysvr4)
1332 os=-sysv4
1333 ;;
1334 # This must come after -sysvr4.
1335 -sysv*)
1336 ;;
1337 -ose*)
1338 os=-ose
1339 ;;
1340 -es1800*)
1341 os=-ose
1342 ;;
1343 -xenix)
1344 os=-xenix
1345 ;;
1346 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1347 os=-mint
1348 ;;
1349 -aros*)
1350 os=-aros
1351 ;;
1352 -kaos*)
1353 os=-kaos
1354 ;;
1355 -zvmoe)
1356 os=-zvmoe
1357 ;;
1358 -none)
1359 ;;
1360 *)
1361 # Get rid of the `-' at the beginning of $os.
1362 os=`echo $os | sed 's/[^-]*-//'`
1363 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1517 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
13641518 exit 1
13651519 ;;
13661520 esac
13761530 # will signal an error saying that MANUFACTURER isn't an operating
13771531 # system, and we'll never get to this point.
13781532
1379 case $basic_machine in
1380 score-*)
1381 os=-elf
1382 ;;
1383 spu-*)
1384 os=-elf
1533 case $cpu-$vendor in
1534 score-*)
1535 os=elf
1536 ;;
1537 spu-*)
1538 os=elf
13851539 ;;
13861540 *-acorn)
1387 os=-riscix1.2
1541 os=riscix1.2
13881542 ;;
13891543 arm*-rebel)
1390 os=-linux
1544 os=linux
13911545 ;;
13921546 arm*-semi)
1393 os=-aout
1394 ;;
1395 c4x-* | tic4x-*)
1396 os=-coff
1547 os=aout
1548 ;;
1549 c4x-* | tic4x-*)
1550 os=coff
1551 ;;
1552 c8051-*)
1553 os=elf
1554 ;;
1555 clipper-intergraph)
1556 os=clix
1557 ;;
1558 hexagon-*)
1559 os=elf
1560 ;;
1561 tic54x-*)
1562 os=coff
1563 ;;
1564 tic55x-*)
1565 os=coff
1566 ;;
1567 tic6x-*)
1568 os=coff
13971569 ;;
13981570 # This must come before the *-dec entry.
13991571 pdp10-*)
1400 os=-tops20
1572 os=tops20
14011573 ;;
14021574 pdp11-*)
1403 os=-none
1575 os=none
14041576 ;;
14051577 *-dec | vax-*)
1406 os=-ultrix4.2
1578 os=ultrix4.2
14071579 ;;
14081580 m68*-apollo)
1409 os=-domain
1581 os=domain
14101582 ;;
14111583 i386-sun)
1412 os=-sunos4.0.2
1584 os=sunos4.0.2
14131585 ;;
14141586 m68000-sun)
1415 os=-sunos3
1416 # This also exists in the configure program, but was not the
1417 # default.
1418 # os=-sunos4
1587 os=sunos3
14191588 ;;
14201589 m68*-cisco)
1421 os=-aout
1422 ;;
1423 mep-*)
1424 os=-elf
1590 os=aout
1591 ;;
1592 mep-*)
1593 os=elf
14251594 ;;
14261595 mips*-cisco)
1427 os=-elf
1596 os=elf
14281597 ;;
14291598 mips*-*)
1430 os=-elf
1599 os=elf
14311600 ;;
14321601 or32-*)
1433 os=-coff
1602 os=coff
14341603 ;;
14351604 *-tti) # must be before sparc entry or we get the wrong os.
1436 os=-sysv3
1605 os=sysv3
14371606 ;;
14381607 sparc-* | *-sun)
1439 os=-sunos4.1.1
1608 os=sunos4.1.1
1609 ;;
1610 pru-*)
1611 os=elf
14401612 ;;
14411613 *-be)
1442 os=-beos
1443 ;;
1444 *-haiku)
1445 os=-haiku
1614 os=beos
14461615 ;;
14471616 *-ibm)
1448 os=-aix
1449 ;;
1450 *-knuth)
1451 os=-mmixware
1617 os=aix
1618 ;;
1619 *-knuth)
1620 os=mmixware
14521621 ;;
14531622 *-wec)
1454 os=-proelf
1623 os=proelf
14551624 ;;
14561625 *-winbond)
1457 os=-proelf
1626 os=proelf
14581627 ;;
14591628 *-oki)
1460 os=-proelf
1629 os=proelf
14611630 ;;
14621631 *-hp)
1463 os=-hpux
1632 os=hpux
14641633 ;;
14651634 *-hitachi)
1466 os=-hiux
1635 os=hiux
14671636 ;;
14681637 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1469 os=-sysv
1638 os=sysv
14701639 ;;
14711640 *-cbm)
1472 os=-amigaos
1641 os=amigaos
14731642 ;;
14741643 *-dg)
1475 os=-dgux
1644 os=dgux
14761645 ;;
14771646 *-dolphin)
1478 os=-sysv3
1647 os=sysv3
14791648 ;;
14801649 m68k-ccur)
1481 os=-rtu
1650 os=rtu
14821651 ;;
14831652 m88k-omron*)
1484 os=-luna
1485 ;;
1486 *-next )
1487 os=-nextstep
1653 os=luna
1654 ;;
1655 *-next)
1656 os=nextstep
14881657 ;;
14891658 *-sequent)
1490 os=-ptx
1659 os=ptx
14911660 ;;
14921661 *-crds)
1493 os=-unos
1662 os=unos
14941663 ;;
14951664 *-ns)
1496 os=-genix
1665 os=genix
14971666 ;;
14981667 i370-*)
1499 os=-mvs
1500 ;;
1501 *-next)
1502 os=-nextstep3
1668 os=mvs
15031669 ;;
15041670 *-gould)
1505 os=-sysv
1671 os=sysv
15061672 ;;
15071673 *-highlevel)
1508 os=-bsd
1674 os=bsd
15091675 ;;
15101676 *-encore)
1511 os=-bsd
1677 os=bsd
15121678 ;;
15131679 *-sgi)
1514 os=-irix
1680 os=irix
15151681 ;;
15161682 *-siemens)
1517 os=-sysv4
1683 os=sysv4
15181684 ;;
15191685 *-masscomp)
1520 os=-rtu
1686 os=rtu
15211687 ;;
15221688 f30[01]-fujitsu | f700-fujitsu)
1523 os=-uxpv
1689 os=uxpv
15241690 ;;
15251691 *-rom68k)
1526 os=-coff
1692 os=coff
15271693 ;;
15281694 *-*bug)
1529 os=-coff
1695 os=coff
15301696 ;;
15311697 *-apple)
1532 os=-macos
1698 os=macos
15331699 ;;
15341700 *-atari*)
1535 os=-mint
1701 os=mint
1702 ;;
1703 *-wrs)
1704 os=vxworks
15361705 ;;
15371706 *)
1538 os=-none
1707 os=none
15391708 ;;
15401709 esac
15411710 fi
15421711
15431712 # Here we handle the case where we know the os, and the CPU type, but not the
15441713 # manufacturer. We pick the logical manufacturer.
1545 vendor=unknown
1546 case $basic_machine in
1547 *-unknown)
1714 case $vendor in
1715 unknown)
15481716 case $os in
1549 -riscix*)
1717 riscix*)
15501718 vendor=acorn
15511719 ;;
1552 -sunos*)
1720 sunos*)
15531721 vendor=sun
15541722 ;;
1555 -aix*)
1723 cnk*|-aix*)
15561724 vendor=ibm
15571725 ;;
1558 -beos*)
1726 beos*)
15591727 vendor=be
15601728 ;;
1561 -hpux*)
1729 hpux*)
15621730 vendor=hp
15631731 ;;
1564 -mpeix*)
1732 mpeix*)
15651733 vendor=hp
15661734 ;;
1567 -hiux*)
1735 hiux*)
15681736 vendor=hitachi
15691737 ;;
1570 -unos*)
1738 unos*)
15711739 vendor=crds
15721740 ;;
1573 -dgux*)
1741 dgux*)
15741742 vendor=dg
15751743 ;;
1576 -luna*)
1744 luna*)
15771745 vendor=omron
15781746 ;;
1579 -genix*)
1747 genix*)
15801748 vendor=ns
15811749 ;;
1582 -mvs* | -opened*)
1750 clix*)
1751 vendor=intergraph
1752 ;;
1753 mvs* | opened*)
15831754 vendor=ibm
15841755 ;;
1585 -os400*)
1756 os400*)
15861757 vendor=ibm
15871758 ;;
1588 -ptx*)
1759 ptx*)
15891760 vendor=sequent
15901761 ;;
1591 -tpf*)
1762 tpf*)
15921763 vendor=ibm
15931764 ;;
1594 -vxsim* | -vxworks* | -windiss*)
1765 vxsim* | vxworks* | windiss*)
15951766 vendor=wrs
15961767 ;;
1597 -aux*)
1768 aux*)
15981769 vendor=apple
15991770 ;;
1600 -hms*)
1771 hms*)
16011772 vendor=hitachi
16021773 ;;
1603 -mpw* | -macos*)
1774 mpw* | macos*)
16041775 vendor=apple
16051776 ;;
1606 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1777 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
16071778 vendor=atari
16081779 ;;
1609 -vos*)
1780 vos*)
16101781 vendor=stratus
16111782 ;;
16121783 esac
1613 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
16141784 ;;
16151785 esac
16161786
1617 echo $basic_machine$os
1787 echo "$cpu-$vendor-$os"
16181788 exit
16191789
16201790 # Local variables:
1621 # eval: (add-hook 'write-file-hooks 'time-stamp)
1791 # eval: (add-hook 'before-save-hook 'time-stamp)
16221792 # time-stamp-start: "timestamp='"
16231793 # time-stamp-format: "%:y-%02m-%02d"
16241794 # time-stamp-end: "'"
871871 docdir
872872 oldincludedir
873873 includedir
874 runstatedir
874875 localstatedir
875876 sharedstatedir
876877 sysconfdir
958959 sysconfdir='${prefix}/etc'
959960 sharedstatedir='${prefix}/com'
960961 localstatedir='${prefix}/var'
962 runstatedir='${localstatedir}/run'
961963 includedir='${prefix}/include'
962964 oldincludedir='/usr/include'
963965 docdir='${datarootdir}/doc/${PACKAGE}'
12101212 | -silent | --silent | --silen | --sile | --sil)
12111213 silent=yes ;;
12121214
1215 -runstatedir | --runstatedir | --runstatedi | --runstated \
1216 | --runstate | --runstat | --runsta | --runst | --runs \
1217 | --run | --ru | --r)
1218 ac_prev=runstatedir ;;
1219 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1220 | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1221 | --run=* | --ru=* | --r=*)
1222 runstatedir=$ac_optarg ;;
1223
12131224 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
12141225 ac_prev=sbindir ;;
12151226 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
13471358 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
13481359 datadir sysconfdir sharedstatedir localstatedir includedir \
13491360 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1350 libdir localedir mandir
1361 libdir localedir mandir runstatedir
13511362 do
13521363 eval ac_val=\$$ac_var
13531364 # Remove trailing slashes.
15001511 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
15011512 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
15021513 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1514 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
15031515 --libdir=DIR object code libraries [EPREFIX/lib]
15041516 --includedir=DIR C header files [PREFIX/include]
15051517 --oldincludedir=DIR C header files for non-gcc [/usr/include]
47694781 else
47704782 lt_cv_nm_interface="BSD nm"
47714783 echo "int some_variable = 0;" > conftest.$ac_ext
4772 (eval echo "\"\$as_me:4773: $ac_compile\"" >&5)
4784 (eval echo "\"\$as_me:4785: $ac_compile\"" >&5)
47734785 (eval "$ac_compile" 2>conftest.err)
47744786 cat conftest.err >&5
4775 (eval echo "\"\$as_me:4776: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4787 (eval echo "\"\$as_me:4788: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
47764788 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
47774789 cat conftest.err >&5
4778 (eval echo "\"\$as_me:4779: output\"" >&5)
4790 (eval echo "\"\$as_me:4791: output\"" >&5)
47794791 cat conftest.out >&5
47804792 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
47814793 lt_cv_nm_interface="MS dumpbin"
59815993 ;;
59825994 *-*-irix6*)
59835995 # Find out which ABI we are using.
5984 echo '#line 5985 "configure"' > conftest.$ac_ext
5996 echo '#line 5997 "configure"' > conftest.$ac_ext
59855997 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
59865998 (eval $ac_compile) 2>&5
59875999 ac_status=$?
75067518 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
75077519 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
75087520 -e 's:$: $lt_compiler_flag:'`
7509 (eval echo "\"\$as_me:7510: $lt_compile\"" >&5)
7521 (eval echo "\"\$as_me:7522: $lt_compile\"" >&5)
75107522 (eval "$lt_compile" 2>conftest.err)
75117523 ac_status=$?
75127524 cat conftest.err >&5
7513 echo "$as_me:7514: \$? = $ac_status" >&5
7525 echo "$as_me:7526: \$? = $ac_status" >&5
75147526 if (exit $ac_status) && test -s "$ac_outfile"; then
75157527 # The compiler can only warn and ignore the option if not recognized
75167528 # So say no if there are warnings other than the usual output.
78457857 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
78467858 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
78477859 -e 's:$: $lt_compiler_flag:'`
7848 (eval echo "\"\$as_me:7849: $lt_compile\"" >&5)
7860 (eval echo "\"\$as_me:7861: $lt_compile\"" >&5)
78497861 (eval "$lt_compile" 2>conftest.err)
78507862 ac_status=$?
78517863 cat conftest.err >&5
7852 echo "$as_me:7853: \$? = $ac_status" >&5
7864 echo "$as_me:7865: \$? = $ac_status" >&5
78537865 if (exit $ac_status) && test -s "$ac_outfile"; then
78547866 # The compiler can only warn and ignore the option if not recognized
78557867 # So say no if there are warnings other than the usual output.
79507962 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
79517963 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
79527964 -e 's:$: $lt_compiler_flag:'`
7953 (eval echo "\"\$as_me:7954: $lt_compile\"" >&5)
7965 (eval echo "\"\$as_me:7966: $lt_compile\"" >&5)
79547966 (eval "$lt_compile" 2>out/conftest.err)
79557967 ac_status=$?
79567968 cat out/conftest.err >&5
7957 echo "$as_me:7958: \$? = $ac_status" >&5
7969 echo "$as_me:7970: \$? = $ac_status" >&5
79587970 if (exit $ac_status) && test -s out/conftest2.$ac_objext
79597971 then
79607972 # The compiler can only warn and ignore the option if not recognized
80058017 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
80068018 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
80078019 -e 's:$: $lt_compiler_flag:'`
8008 (eval echo "\"\$as_me:8009: $lt_compile\"" >&5)
8020 (eval echo "\"\$as_me:8021: $lt_compile\"" >&5)
80098021 (eval "$lt_compile" 2>out/conftest.err)
80108022 ac_status=$?
80118023 cat out/conftest.err >&5
8012 echo "$as_me:8013: \$? = $ac_status" >&5
8024 echo "$as_me:8025: \$? = $ac_status" >&5
80138025 if (exit $ac_status) && test -s out/conftest2.$ac_objext
80148026 then
80158027 # The compiler can only warn and ignore the option if not recognized
1038810400 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1038910401 lt_status=$lt_dlunknown
1039010402 cat > conftest.$ac_ext <<_LT_EOF
10391 #line 10392 "configure"
10403 #line 10404 "configure"
1039210404 #include "confdefs.h"
1039310405
1039410406 #if HAVE_DLFCN_H
1048410496 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1048510497 lt_status=$lt_dlunknown
1048610498 cat > conftest.$ac_ext <<_LT_EOF
10487 #line 10488 "configure"
10499 #line 10500 "configure"
1048810500 #include "confdefs.h"
1048910501
1049010502 #if HAVE_DLFCN_H
1089110903 if (*(data + i) != *(data3 + i))
1089210904 return 14;
1089310905 close (fd);
10906 free (data);
10907 free (data3);
1089410908 return 0;
1089510909 }
1089610910 _ACEOF
1358413598 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1358513599 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1358613600 -e 's:$: $lt_compiler_flag:'`
13587 (eval echo "\"\$as_me:13588: $lt_compile\"" >&5)
13601 (eval echo "\"\$as_me:13602: $lt_compile\"" >&5)
1358813602 (eval "$lt_compile" 2>conftest.err)
1358913603 ac_status=$?
1359013604 cat conftest.err >&5
13591 echo "$as_me:13592: \$? = $ac_status" >&5
13605 echo "$as_me:13606: \$? = $ac_status" >&5
1359213606 if (exit $ac_status) && test -s "$ac_outfile"; then
1359313607 # The compiler can only warn and ignore the option if not recognized
1359413608 # So say no if there are warnings other than the usual output.
1368313697 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1368413698 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1368513699 -e 's:$: $lt_compiler_flag:'`
13686 (eval echo "\"\$as_me:13687: $lt_compile\"" >&5)
13700 (eval echo "\"\$as_me:13701: $lt_compile\"" >&5)
1368713701 (eval "$lt_compile" 2>out/conftest.err)
1368813702 ac_status=$?
1368913703 cat out/conftest.err >&5
13690 echo "$as_me:13691: \$? = $ac_status" >&5
13704 echo "$as_me:13705: \$? = $ac_status" >&5
1369113705 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1369213706 then
1369313707 # The compiler can only warn and ignore the option if not recognized
1373513749 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1373613750 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1373713751 -e 's:$: $lt_compiler_flag:'`
13738 (eval echo "\"\$as_me:13739: $lt_compile\"" >&5)
13752 (eval echo "\"\$as_me:13753: $lt_compile\"" >&5)
1373913753 (eval "$lt_compile" 2>out/conftest.err)
1374013754 ac_status=$?
1374113755 cat out/conftest.err >&5
13742 echo "$as_me:13743: \$? = $ac_status" >&5
13756 echo "$as_me:13757: \$? = $ac_status" >&5
1374313757 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1374413758 then
1374513759 # The compiler can only warn and ignore the option if not recognized
00 #include <getopt.h>
11 #include <iostream>
2 #include <cstdlib>
3 #include <cstring>
42 #include "mm.h"
53 #include "cmdline.h"
64
1212 "abcdefghijklmnopqrstuvwxyz"
1313 "0123456789+/=";
1414
15 const char Base64::sDecTable[] = {
15 const signed char Base64::sDecTable[] = {
1616 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
1717 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
1818 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
1919 enum { default_maxlen = 76 };
2020 enum { eq_sign = 100 };
2121 static const char sEncTable[];
22 static const char sDecTable[];
22 static const signed char sDecTable[];
2323 static const int sDecTableSz;
2424 public:
2525 class Encoder; class Decoder;
8080 */
8181 struct Lf2CrLf: public unbuffered_codec, public chainable_codec<Lf2CrLf>
8282 {
83 Lf2CrLf()
84 : m_prev('\0')
85 {
86 }
8387 template<typename OutIt>
8488 void process(char c, OutIt& out)
8589 {
8690 enum { LF = 0xA, CR = 0xD };
87 if(c == LF)
91 if(c == LF && m_prev != CR)
8892 {
8993 *out = CR; ++out;
9094 *out = LF; ++out;
91 } else
95 } else {
9296 *out = c; ++out;
97 }
98 m_prev = c;
9399 }
94100 const char* name() const
95101 {
96102 return "Lf2CrLf";
97103 }
104 private:
105 char m_prev;
98106 };
99107
100108 /// Inserts a new line if the input line is too long
5353 * Parse istream and build entity based on content
5454 */
5555 MimeEntity(std::istream&);
56
57 MimeEntity(const MimeEntity&) = delete;
58 MimeEntity& operator=(const MimeEntity&) = delete;
5659
5760 virtual ~MimeEntity();
5861
5656 bool MMFile::map()
5757 {
5858 m_beg = (char*) mmap(0, m_st.st_size, PROT_READ, MAP_SHARED,m_fd,0);
59 if(m_beg > 0)
59 if(m_beg != MAP_FAILED)
6060 {
6161 m_end = m_beg + m_st.st_size;
6262 #if HAVE_MADVISE
717717 if(block_sz)
718718 {
719719 Iterator p = base + block_sz;
720 char a = *--p, b = *--p;
721 if(isnl(a,b))
720 char a = *--p;
721 if(block_sz>=2 && isnl(a,*--p))
722722 block_sz -= 2;
723723 else if(isnl(a))
724724 block_sz--;
5656 blanks = 0;
5757 } else if(*p == ' ') {
5858 blanks++;
59 } else if(p != text.end()-1 && *p == '\\' && *(p+1) == '"') {
60 p++;
5961 }
6062 }
6163 if( (p-beg) != blanks)// not a only-blanks-string
9595 }
9696 }
9797 // trailing ';' missing
98 push_back(Mailbox(string(start, p-1)));
98 if(start <= (p-1))
99 push_back(Mailbox(string(start, p-1)));
99100 }
100101
101102 string Group::name(int bCanonical) const
3939 {
4040 rs = m_label + " <";
4141 if(hasRoute)
42 rs = m_route+ ":";
42 rs += m_route+ ":";
4343 }
4444
4545 rs += m_mailbox + "@" + m_domain;
6060 // the string::erase or/and we cannot cache begin() end()
6161
6262 int t = input.length() -1;
63 if(input[t] == '>')
63 while(t && input[t] == ' ')
64 t--;
65
66 if(t > 0 && input[t] == '>')
6467 {
6568 bool in_dquote = false, in_comment = false;
6669 int endoff = t - 1;
2323 idx++;
2424 if(idx)
2525 input.erase(0, idx);
26
27 if(input.empty())
28 return input;
29
2630 // removes trailing spaces
2731 idx = input.length() - 1;
2832 while(input[idx] == ' ')
2933 idx--;
30 input.erase(idx, input.length() - ++idx);
34 input.erase(1 + idx, string::npos);
3135 // removes rfc822 comments and non-required spaces
3236 bool in_dquote = false, has_brack = false;
3337 int in_par = 0, in_brack = 0, par_last;
1414
1515 void test_codec::one()
1616 {
17 ToUpperCase tue;
18 MaxLineLen mll(44);
19 Base64::Encoder b64e;
20 QP::Encoder qpe;
2117 Base64::Decoder b64d;
2218 string o;
2319 string s("YWJjZGUBZmdoaQJsbW5vA3BxcgRzdHUFdno=");
2420 code(s.begin(),s.end(), b64d , back_inserter(o));
2521 }
2622
23 void test_codec::lf2crlf()
24 {
25 Lf2CrLf l2cl;
26 string src("a\nb\r\nc\n\n");
27 string exp("a\r\nb\r\nc\r\n\r\n");
28 string got;
29 code(src.begin(), src.end(), l2cl , back_inserter(got));
30 TEST_ASSERT_EQUALS_P(exp, got);
2731 }
32
33 void test_codec::toUpper()
34 {
35 ToUpperCase tue;
36 string src("abc=\n");
37 string exp("ABC=\n");
38 string got;
39 code(src.begin(), src.end(), tue , back_inserter(got));
40 TEST_ASSERT_EQUALS_P(exp, got);
41 }
42
43 void test_codec::toLower()
44 {
45 ToLowerCase tle;
46 string src("ABC=\n");
47 string exp("abc=\n");
48 string got;
49 code(src.begin(), src.end(), tle , back_inserter(got));
50 TEST_ASSERT_EQUALS_P(exp, got);
51 }
52
53 void test_codec::maxLine()
54 {
55 MaxLineLen mll(4);
56 string src("abcdefghij");
57 string exp("abcd\r\nefgh\r\nij");
58 string got;
59 code(src.begin(), src.end(), mll , back_inserter(got));
60 TEST_ASSERT_EQUALS_P(exp, got);
61 }
62
63 }
99 struct TEST_CLASS( test_codec )
1010 {
1111 void TEST_FUNCTION( one );
12 void TEST_FUNCTION( lf2crlf );
13 void TEST_FUNCTION( toUpper );
14 void TEST_FUNCTION( toLower);
15 void TEST_FUNCTION( maxLine );
1216 };
1317
1418 }
8383 { "<e(boom). (boo)d@mail.com>", "e.d", "mail.com", "", "" },
8484 { "Bella Ragga <e(boom). (boo)d@mail.com>", "e.d",
8585 "mail.com", "Bella Ragga", "" },
86 { "<e@mail.com> ", "e", "mail.com", "", "" },
8687 { 0,0,0,0,0 }
8788 };
8889 // test parser
153154 b.set("group label: ;");
154155 TEST_ASSERT(b.isGroup());
155156
157 b.set("undisclosed-recipient:");
158 TEST_ASSERT(b.isGroup());
159
160 }
161
162 void testRfc822::testAddressList()
163 {
164 const char* str1 = "\"rcpt1\" <rcpt1@mail.com>";
165 const char* str2 = "\"\\\"rcpt2, abc\\\"\" <rcpt2@mail.com>";
166 const char* str3 = "rcpt3 <rcpt3@mail.com>";
167 const char* delimiter = ",";
168
169 AddressList aList(string(str1) + delimiter + str2 + delimiter + str3);
170 /*
171 AddressList::const_iterator bit(aList.begin()), eit(aList.end());
172 for(; bit != eit; ++bit)
173 {
174 cout << *bit << endl;
175 }
176 */
177 TEST_ASSERT_EQUALS_P(aList.size(), 3);
156178 }
157179
158180
99 struct TEST_CLASS( testRfc822 )
1010 {
1111 void TEST_FUNCTION( testAddress );
12 void TEST_FUNCTION( testAddressList );
1213 void TEST_FUNCTION( testMailbox );
1314 void TEST_FUNCTION( testGroup );
1415 };