🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1803 lines
49 KiB

  1. #! /bin/sh
  2. # Attempt to guess a canonical system name.
  3. # Copyright 1992-2023 Free Software Foundation, Inc.
  4. # shellcheck disable=SC2006,SC2268 # see below for rationale
  5. timestamp='2023-07-20'
  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
  9. # (at your option) any later version.
  10. #
  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.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, see <https://www.gnu.org/licenses/>.
  18. #
  19. # As a special exception to the GNU General Public License, if you
  20. # distribute this file as part of a program that contains a
  21. # configuration script generated by Autoconf, you may include it under
  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. # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
  27. #
  28. # You can get the latest version of this script from:
  29. # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
  30. #
  31. # Please send patches to <config-patches@gnu.org>.
  32. # The "shellcheck disable" line above the timestamp inhibits complaints
  33. # about features and limitations of the classic Bourne shell that were
  34. # superseded or lifted in POSIX. However, this script identifies a wide
  35. # variety of pre-POSIX systems that do not have POSIX shells at all, and
  36. # even some reasonably current systems (Solaris 10 as case-in-point) still
  37. # have a pre-POSIX /bin/sh.
  38. me=`echo "$0" | sed -e 's,.*/,,'`
  39. usage="\
  40. Usage: $0 [OPTION]
  41. Output the configuration name of the system '$me' is run on.
  42. Options:
  43. -h, --help print this help, then exit
  44. -t, --time-stamp print date of last modification, then exit
  45. -v, --version print version number, then exit
  46. Report bugs and patches to <config-patches@gnu.org>."
  47. version="\
  48. GNU config.guess ($timestamp)
  49. Originally written by Per Bothner.
  50. Copyright 1992-2023 Free Software Foundation, Inc.
  51. This is free software; see the source for copying conditions. There is NO
  52. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  53. help="
  54. Try '$me --help' for more information."
  55. # Parse command line
  56. while test $# -gt 0 ; do
  57. case $1 in
  58. --time-stamp | --time* | -t )
  59. echo "$timestamp" ; exit ;;
  60. --version | -v )
  61. echo "$version" ; exit ;;
  62. --help | --h* | -h )
  63. echo "$usage"; exit ;;
  64. -- ) # Stop option processing
  65. shift; break ;;
  66. - ) # Use stdin as input.
  67. break ;;
  68. -* )
  69. echo "$me: invalid option $1$help" >&2
  70. exit 1 ;;
  71. * )
  72. break ;;
  73. esac
  74. done
  75. if test $# != 0; then
  76. echo "$me: too many arguments$help" >&2
  77. exit 1
  78. fi
  79. # Just in case it came from the environment.
  80. GUESS=
  81. # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
  82. # compiler to aid in system detection is discouraged as it requires
  83. # temporary files to be created and, as you can see below, it is a
  84. # headache to deal with in a portable fashion.
  85. # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
  86. # use 'HOST_CC' if defined, but it is deprecated.
  87. # Portable tmp directory creation inspired by the Autoconf team.
  88. tmp=
  89. # shellcheck disable=SC2172
  90. trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
  91. set_cc_for_build() {
  92. # prevent multiple calls if $tmp is already set
  93. test "$tmp" && return 0
  94. : "${TMPDIR=/tmp}"
  95. # shellcheck disable=SC2039,SC3028
  96. { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  97. { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
  98. { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  99. { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
  100. dummy=$tmp/dummy
  101. case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
  102. ,,) echo "int x;" > "$dummy.c"
  103. for driver in cc gcc c89 c99 ; do
  104. if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
  105. CC_FOR_BUILD=$driver
  106. break
  107. fi
  108. done
  109. if test x"$CC_FOR_BUILD" = x ; then
  110. CC_FOR_BUILD=no_compiler_found
  111. fi
  112. ;;
  113. ,,*) CC_FOR_BUILD=$CC ;;
  114. ,*,*) CC_FOR_BUILD=$HOST_CC ;;
  115. esac
  116. }
  117. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  118. # (ghazi@noc.rutgers.edu 1994-08-24)
  119. if test -f /.attbin/uname ; then
  120. PATH=$PATH:/.attbin ; export PATH
  121. fi
  122. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  123. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  124. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  125. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  126. case $UNAME_SYSTEM in
  127. Linux|GNU|GNU/*)
  128. LIBC=unknown
  129. set_cc_for_build
  130. cat <<-EOF > "$dummy.c"
  131. #include <features.h>
  132. #if defined(__UCLIBC__)
  133. LIBC=uclibc
  134. #elif defined(__dietlibc__)
  135. LIBC=dietlibc
  136. #elif defined(__GLIBC__)
  137. LIBC=gnu
  138. #else
  139. #include <stdarg.h>
  140. /* First heuristic to detect musl libc. */
  141. #ifdef __DEFINED_va_list
  142. LIBC=musl
  143. #endif
  144. #endif
  145. EOF
  146. cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
  147. eval "$cc_set_libc"
  148. # Second heuristic to detect musl libc.
  149. if [ "$LIBC" = unknown ] &&
  150. command -v ldd >/dev/null &&
  151. ldd --version 2>&1 | grep -q ^musl; then
  152. LIBC=musl
  153. fi
  154. # If the system lacks a compiler, then just pick glibc.
  155. # We could probably try harder.
  156. if [ "$LIBC" = unknown ]; then
  157. LIBC=gnu
  158. fi
  159. ;;
  160. esac
  161. # Note: order is significant - the case branches are not exclusive.
  162. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
  163. *:NetBSD:*:*)
  164. # NetBSD (nbsd) targets should (where applicable) match one or
  165. # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
  166. # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
  167. # switched to ELF, *-*-netbsd* would select the old
  168. # object file format. This provides both forward
  169. # compatibility and a consistent mechanism for selecting the
  170. # object file format.
  171. #
  172. # Note: NetBSD doesn't particularly care about the vendor
  173. # portion of the name. We always set it to "unknown".
  174. UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
  175. /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
  176. /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
  177. echo unknown)`
  178. case $UNAME_MACHINE_ARCH in
  179. aarch64eb) machine=aarch64_be-unknown ;;
  180. armeb) machine=armeb-unknown ;;
  181. arm*) machine=arm-unknown ;;
  182. sh3el) machine=shl-unknown ;;
  183. sh3eb) machine=sh-unknown ;;
  184. sh5el) machine=sh5le-unknown ;;
  185. earmv*)
  186. arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
  187. endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
  188. machine=${arch}${endian}-unknown
  189. ;;
  190. *) machine=$UNAME_MACHINE_ARCH-unknown ;;
  191. esac
  192. # The Operating System including object format, if it has switched
  193. # to ELF recently (or will in the future) and ABI.
  194. case $UNAME_MACHINE_ARCH in
  195. earm*)
  196. os=netbsdelf
  197. ;;
  198. arm*|i386|m68k|ns32k|sh3*|sparc|vax)
  199. set_cc_for_build
  200. if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  201. | grep -q __ELF__
  202. then
  203. # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  204. # Return netbsd for either. FIX?
  205. os=netbsd
  206. else
  207. os=netbsdelf
  208. fi
  209. ;;
  210. *)
  211. os=netbsd
  212. ;;
  213. esac
  214. # Determine ABI tags.
  215. case $UNAME_MACHINE_ARCH in
  216. earm*)
  217. expr='s/^earmv[0-9]/-eabi/;s/eb$//'
  218. abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
  219. ;;
  220. esac
  221. # The OS release
  222. # Debian GNU/NetBSD machines have a different userland, and
  223. # thus, need a distinct triplet. However, they do not need
  224. # kernel version information, so it can be replaced with a
  225. # suitable tag, in the style of linux-gnu.
  226. case $UNAME_VERSION in
  227. Debian*)
  228. release='-gnu'
  229. ;;
  230. *)
  231. release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
  232. ;;
  233. esac
  234. # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  235. # contains redundant information, the shorter form:
  236. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  237. GUESS=$machine-${os}${release}${abi-}
  238. ;;
  239. *:Bitrig:*:*)
  240. UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
  241. GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
  242. ;;
  243. *:OpenBSD:*:*)
  244. UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
  245. GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
  246. ;;
  247. *:SecBSD:*:*)
  248. UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
  249. GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
  250. ;;
  251. *:LibertyBSD:*:*)
  252. UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
  253. GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
  254. ;;
  255. *:MidnightBSD:*:*)
  256. GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
  257. ;;
  258. *:ekkoBSD:*:*)
  259. GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
  260. ;;
  261. *:SolidBSD:*:*)
  262. GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
  263. ;;
  264. *:OS108:*:*)
  265. GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
  266. ;;
  267. macppc:MirBSD:*:*)
  268. GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
  269. ;;
  270. *:MirBSD:*:*)
  271. GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
  272. ;;
  273. *:Sortix:*:*)
  274. GUESS=$UNAME_MACHINE-unknown-sortix
  275. ;;
  276. *:Twizzler:*:*)
  277. GUESS=$UNAME_MACHINE-unknown-twizzler
  278. ;;
  279. *:Redox:*:*)
  280. GUESS=$UNAME_MACHINE-unknown-redox
  281. ;;
  282. mips:OSF1:*.*)
  283. GUESS=mips-dec-osf1
  284. ;;
  285. alpha:OSF1:*:*)
  286. # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
  287. trap '' 0
  288. case $UNAME_RELEASE in
  289. *4.0)
  290. UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  291. ;;
  292. *5.*)
  293. UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
  294. ;;
  295. esac
  296. # According to Compaq, /usr/sbin/psrinfo has been available on
  297. # OSF/1 and Tru64 systems produced since 1995. I hope that
  298. # covers most systems running today. This code pipes the CPU
  299. # types through head -n 1, so we only detect the type of CPU 0.
  300. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
  301. case $ALPHA_CPU_TYPE in
  302. "EV4 (21064)")
  303. UNAME_MACHINE=alpha ;;
  304. "EV4.5 (21064)")
  305. UNAME_MACHINE=alpha ;;
  306. "LCA4 (21066/21068)")
  307. UNAME_MACHINE=alpha ;;
  308. "EV5 (21164)")
  309. UNAME_MACHINE=alphaev5 ;;
  310. "EV5.6 (21164A)")
  311. UNAME_MACHINE=alphaev56 ;;
  312. "EV5.6 (21164PC)")
  313. UNAME_MACHINE=alphapca56 ;;
  314. "EV5.7 (21164PC)")
  315. UNAME_MACHINE=alphapca57 ;;
  316. "EV6 (21264)")
  317. UNAME_MACHINE=alphaev6 ;;
  318. "EV6.7 (21264A)")
  319. UNAME_MACHINE=alphaev67 ;;
  320. "EV6.8CB (21264C)")
  321. UNAME_MACHINE=alphaev68 ;;
  322. "EV6.8AL (21264B)")
  323. UNAME_MACHINE=alphaev68 ;;
  324. "EV6.8CX (21264D)")
  325. UNAME_MACHINE=alphaev68 ;;
  326. "EV6.9A (21264/EV69A)")
  327. UNAME_MACHINE=alphaev69 ;;
  328. "EV7 (21364)")
  329. UNAME_MACHINE=alphaev7 ;;
  330. "EV7.9 (21364A)")
  331. UNAME_MACHINE=alphaev79 ;;
  332. esac
  333. # A Pn.n version is a patched version.
  334. # A Vn.n version is a released version.
  335. # A Tn.n version is a released field test version.
  336. # A Xn.n version is an unreleased experimental baselevel.
  337. # 1.2 uses "1.2" for uname -r.
  338. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
  339. GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
  340. ;;
  341. Amiga*:UNIX_System_V:4.0:*)
  342. GUESS=m68k-unknown-sysv4
  343. ;;
  344. *:[Aa]miga[Oo][Ss]:*:*)
  345. GUESS=$UNAME_MACHINE-unknown-amigaos
  346. ;;
  347. *:[Mm]orph[Oo][Ss]:*:*)
  348. GUESS=$UNAME_MACHINE-unknown-morphos
  349. ;;
  350. *:OS/390:*:*)
  351. GUESS=i370-ibm-openedition
  352. ;;
  353. *:z/VM:*:*)
  354. GUESS=s390-ibm-zvmoe
  355. ;;
  356. *:OS400:*:*)
  357. GUESS=powerpc-ibm-os400
  358. ;;
  359. arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  360. GUESS=arm-acorn-riscix$UNAME_RELEASE
  361. ;;
  362. arm*:riscos:*:*|arm*:RISCOS:*:*)
  363. GUESS=arm-unknown-riscos
  364. ;;
  365. SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
  366. GUESS=hppa1.1-hitachi-hiuxmpp
  367. ;;
  368. Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  369. # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  370. case `(/bin/universe) 2>/dev/null` in
  371. att) GUESS=pyramid-pyramid-sysv3 ;;
  372. *) GUESS=pyramid-pyramid-bsd ;;
  373. esac
  374. ;;
  375. NILE*:*:*:dcosx)
  376. GUESS=pyramid-pyramid-svr4
  377. ;;
  378. DRS?6000:unix:4.0:6*)
  379. GUESS=sparc-icl-nx6
  380. ;;
  381. DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
  382. case `/usr/bin/uname -p` in
  383. sparc) GUESS=sparc-icl-nx7 ;;
  384. esac
  385. ;;
  386. s390x:SunOS:*:*)
  387. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  388. GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
  389. ;;
  390. sun4H:SunOS:5.*:*)
  391. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  392. GUESS=sparc-hal-solaris2$SUN_REL
  393. ;;
  394. sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  395. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  396. GUESS=sparc-sun-solaris2$SUN_REL
  397. ;;
  398. i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
  399. GUESS=i386-pc-auroraux$UNAME_RELEASE
  400. ;;
  401. i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
  402. set_cc_for_build
  403. SUN_ARCH=i386
  404. # If there is a compiler, see if it is configured for 64-bit objects.
  405. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
  406. # This test works for both compilers.
  407. if test "$CC_FOR_BUILD" != no_compiler_found; then
  408. if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
  409. (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
  410. grep IS_64BIT_ARCH >/dev/null
  411. then
  412. SUN_ARCH=x86_64
  413. fi
  414. fi
  415. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  416. GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
  417. ;;
  418. sun4*:SunOS:6*:*)
  419. # According to config.sub, this is the proper way to canonicalize
  420. # SunOS6. Hard to guess exactly what SunOS6 will be like, but
  421. # it's likely to be more like Solaris than SunOS4.
  422. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  423. GUESS=sparc-sun-solaris3$SUN_REL
  424. ;;
  425. sun4*:SunOS:*:*)
  426. case `/usr/bin/arch -k` in
  427. Series*|S4*)
  428. UNAME_RELEASE=`uname -v`
  429. ;;
  430. esac
  431. # Japanese Language versions have a version number like '4.1.3-JL'.
  432. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
  433. GUESS=sparc-sun-sunos$SUN_REL
  434. ;;
  435. sun3*:SunOS:*:*)
  436. GUESS=m68k-sun-sunos$UNAME_RELEASE
  437. ;;
  438. sun*:*:4.2BSD:*)
  439. UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  440. test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
  441. case `/bin/arch` in
  442. sun3)
  443. GUESS=m68k-sun-sunos$UNAME_RELEASE
  444. ;;
  445. sun4)
  446. GUESS=sparc-sun-sunos$UNAME_RELEASE
  447. ;;
  448. esac
  449. ;;
  450. aushp:SunOS:*:*)
  451. GUESS=sparc-auspex-sunos$UNAME_RELEASE
  452. ;;
  453. # The situation for MiNT is a little confusing. The machine name
  454. # can be virtually everything (everything which is not
  455. # "atarist" or "atariste" at least should have a processor
  456. # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
  457. # to the lowercase version "mint" (or "freemint"). Finally
  458. # the system name "TOS" denotes a system which is actually not
  459. # MiNT. But MiNT is downward compatible to TOS, so this should
  460. # be no problem.
  461. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  462. GUESS=m68k-atari-mint$UNAME_RELEASE
  463. ;;
  464. atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  465. GUESS=m68k-atari-mint$UNAME_RELEASE
  466. ;;
  467. *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  468. GUESS=m68k-atari-mint$UNAME_RELEASE
  469. ;;
  470. milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  471. GUESS=m68k-milan-mint$UNAME_RELEASE
  472. ;;
  473. hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  474. GUESS=m68k-hades-mint$UNAME_RELEASE
  475. ;;
  476. *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  477. GUESS=m68k-unknown-mint$UNAME_RELEASE
  478. ;;
  479. m68k:machten:*:*)
  480. GUESS=m68k-apple-machten$UNAME_RELEASE
  481. ;;
  482. powerpc:machten:*:*)
  483. GUESS=powerpc-apple-machten$UNAME_RELEASE
  484. ;;
  485. RISC*:Mach:*:*)
  486. GUESS=mips-dec-mach_bsd4.3
  487. ;;
  488. RISC*:ULTRIX:*:*)
  489. GUESS=mips-dec-ultrix$UNAME_RELEASE
  490. ;;
  491. VAX*:ULTRIX*:*:*)
  492. GUESS=vax-dec-ultrix$UNAME_RELEASE
  493. ;;
  494. 2020:CLIX:*:* | 2430:CLIX:*:*)
  495. GUESS=clipper-intergraph-clix$UNAME_RELEASE
  496. ;;
  497. mips:*:*:UMIPS | mips:*:*:RISCos)
  498. set_cc_for_build
  499. sed 's/^ //' << EOF > "$dummy.c"
  500. #ifdef __cplusplus
  501. #include <stdio.h> /* for printf() prototype */
  502. int main (int argc, char *argv[]) {
  503. #else
  504. int main (argc, argv) int argc; char *argv[]; {
  505. #endif
  506. #if defined (host_mips) && defined (MIPSEB)
  507. #if defined (SYSTYPE_SYSV)
  508. printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
  509. #endif
  510. #if defined (SYSTYPE_SVR4)
  511. printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
  512. #endif
  513. #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  514. printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
  515. #endif
  516. #endif
  517. exit (-1);
  518. }
  519. EOF
  520. $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
  521. dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
  522. SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
  523. { echo "$SYSTEM_NAME"; exit; }
  524. GUESS=mips-mips-riscos$UNAME_RELEASE
  525. ;;
  526. Motorola:PowerMAX_OS:*:*)
  527. GUESS=powerpc-motorola-powermax
  528. ;;
  529. Motorola:*:4.3:PL8-*)
  530. GUESS=powerpc-harris-powermax
  531. ;;
  532. Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
  533. GUESS=powerpc-harris-powermax
  534. ;;
  535. Night_Hawk:Power_UNIX:*:*)
  536. GUESS=powerpc-harris-powerunix
  537. ;;
  538. m88k:CX/UX:7*:*)
  539. GUESS=m88k-harris-cxux7
  540. ;;
  541. m88k:*:4*:R4*)
  542. GUESS=m88k-motorola-sysv4
  543. ;;
  544. m88k:*:3*:R3*)
  545. GUESS=m88k-motorola-sysv3
  546. ;;
  547. AViiON:dgux:*:*)
  548. # DG/UX returns AViiON for all architectures
  549. UNAME_PROCESSOR=`/usr/bin/uname -p`
  550. if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
  551. then
  552. if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
  553. test "$TARGET_BINARY_INTERFACE"x = x
  554. then
  555. GUESS=m88k-dg-dgux$UNAME_RELEASE
  556. else
  557. GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
  558. fi
  559. else
  560. GUESS=i586-dg-dgux$UNAME_RELEASE
  561. fi
  562. ;;
  563. M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  564. GUESS=m88k-dolphin-sysv3
  565. ;;
  566. M88*:*:R3*:*)
  567. # Delta 88k system running SVR3
  568. GUESS=m88k-motorola-sysv3
  569. ;;
  570. XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  571. GUESS=m88k-tektronix-sysv3
  572. ;;
  573. Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  574. GUESS=m68k-tektronix-bsd
  575. ;;
  576. *:IRIX*:*:*)
  577. IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
  578. GUESS=mips-sgi-irix$IRIX_REL
  579. ;;
  580. ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  581. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
  582. ;; # Note that: echo "'`uname -s`'" gives 'AIX '
  583. i*86:AIX:*:*)
  584. GUESS=i386-ibm-aix
  585. ;;
  586. ia64:AIX:*:*)
  587. if test -x /usr/bin/oslevel ; then
  588. IBM_REV=`/usr/bin/oslevel`
  589. else
  590. IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
  591. fi
  592. GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
  593. ;;
  594. *:AIX:2:3)
  595. if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  596. set_cc_for_build
  597. sed 's/^ //' << EOF > "$dummy.c"
  598. #include <sys/systemcfg.h>
  599. main()
  600. {
  601. if (!__power_pc())
  602. exit(1);
  603. puts("powerpc-ibm-aix3.2.5");
  604. exit(0);
  605. }
  606. EOF
  607. if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
  608. then
  609. GUESS=$SYSTEM_NAME
  610. else
  611. GUESS=rs6000-ibm-aix3.2.5
  612. fi
  613. elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  614. GUESS=rs6000-ibm-aix3.2.4
  615. else
  616. GUESS=rs6000-ibm-aix3.2
  617. fi
  618. ;;
  619. *:AIX:*:[4567])
  620. IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  621. if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
  622. IBM_ARCH=rs6000
  623. else
  624. IBM_ARCH=powerpc
  625. fi
  626. if test -x /usr/bin/lslpp ; then
  627. IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
  628. awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
  629. else
  630. IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
  631. fi
  632. GUESS=$IBM_ARCH-ibm-aix$IBM_REV
  633. ;;
  634. *:AIX:*:*)
  635. GUESS=rs6000-ibm-aix
  636. ;;
  637. ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
  638. GUESS=romp-ibm-bsd4.4
  639. ;;
  640. ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
  641. GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
  642. ;; # report: romp-ibm BSD 4.3
  643. *:BOSX:*:*)
  644. GUESS=rs6000-bull-bosx
  645. ;;
  646. DPX/2?00:B.O.S.:*:*)
  647. GUESS=m68k-bull-sysv3
  648. ;;
  649. 9000/[34]??:4.3bsd:1.*:*)
  650. GUESS=m68k-hp-bsd
  651. ;;
  652. hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  653. GUESS=m68k-hp-bsd4.4
  654. ;;
  655. 9000/[34678]??:HP-UX:*:*)
  656. HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
  657. case $UNAME_MACHINE in
  658. 9000/31?) HP_ARCH=m68000 ;;
  659. 9000/[34]??) HP_ARCH=m68k ;;
  660. 9000/[678][0-9][0-9])
  661. if test -x /usr/bin/getconf; then
  662. sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  663. sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  664. case $sc_cpu_version in
  665. 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
  666. 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
  667. 532) # CPU_PA_RISC2_0
  668. case $sc_kernel_bits in
  669. 32) HP_ARCH=hppa2.0n ;;
  670. 64) HP_ARCH=hppa2.0w ;;
  671. '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
  672. esac ;;
  673. esac
  674. fi
  675. if test "$HP_ARCH" = ""; then
  676. set_cc_for_build
  677. sed 's/^ //' << EOF > "$dummy.c"
  678. #define _HPUX_SOURCE
  679. #include <stdlib.h>
  680. #include <unistd.h>
  681. int main ()
  682. {
  683. #if defined(_SC_KERNEL_BITS)
  684. long bits = sysconf(_SC_KERNEL_BITS);
  685. #endif
  686. long cpu = sysconf (_SC_CPU_VERSION);
  687. switch (cpu)
  688. {
  689. case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  690. case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  691. case CPU_PA_RISC2_0:
  692. #if defined(_SC_KERNEL_BITS)
  693. switch (bits)
  694. {
  695. case 64: puts ("hppa2.0w"); break;
  696. case 32: puts ("hppa2.0n"); break;
  697. default: puts ("hppa2.0"); break;
  698. } break;
  699. #else /* !defined(_SC_KERNEL_BITS) */
  700. puts ("hppa2.0"); break;
  701. #endif
  702. default: puts ("hppa1.0"); break;
  703. }
  704. exit (0);
  705. }
  706. EOF
  707. (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
  708. test -z "$HP_ARCH" && HP_ARCH=hppa
  709. fi ;;
  710. esac
  711. if test "$HP_ARCH" = hppa2.0w
  712. then
  713. set_cc_for_build
  714. # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
  715. # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
  716. # generating 64-bit code. GNU and HP use different nomenclature:
  717. #
  718. # $ CC_FOR_BUILD=cc ./config.guess
  719. # => hppa2.0w-hp-hpux11.23
  720. # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
  721. # => hppa64-hp-hpux11.23
  722. if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
  723. grep -q __LP64__
  724. then
  725. HP_ARCH=hppa2.0w
  726. else
  727. HP_ARCH=hppa64
  728. fi
  729. fi
  730. GUESS=$HP_ARCH-hp-hpux$HPUX_REV
  731. ;;
  732. ia64:HP-UX:*:*)
  733. HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
  734. GUESS=ia64-hp-hpux$HPUX_REV
  735. ;;
  736. 3050*:HI-UX:*:*)
  737. set_cc_for_build
  738. sed 's/^ //' << EOF > "$dummy.c"
  739. #include <unistd.h>
  740. int
  741. main ()
  742. {
  743. long cpu = sysconf (_SC_CPU_VERSION);
  744. /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  745. true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  746. results, however. */
  747. if (CPU_IS_PA_RISC (cpu))
  748. {
  749. switch (cpu)
  750. {
  751. case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  752. case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  753. case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  754. default: puts ("hppa-hitachi-hiuxwe2"); break;
  755. }
  756. }
  757. else if (CPU_IS_HP_MC68K (cpu))
  758. puts ("m68k-hitachi-hiuxwe2");
  759. else puts ("unknown-hitachi-hiuxwe2");
  760. exit (0);
  761. }
  762. EOF
  763. $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
  764. { echo "$SYSTEM_NAME"; exit; }
  765. GUESS=unknown-hitachi-hiuxwe2
  766. ;;
  767. 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
  768. GUESS=hppa1.1-hp-bsd
  769. ;;
  770. 9000/8??:4.3bsd:*:*)
  771. GUESS=hppa1.0-hp-bsd
  772. ;;
  773. *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  774. GUESS=hppa1.0-hp-mpeix
  775. ;;
  776. hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
  777. GUESS=hppa1.1-hp-osf
  778. ;;
  779. hp8??:OSF1:*:*)
  780. GUESS=hppa1.0-hp-osf
  781. ;;
  782. i*86:OSF1:*:*)
  783. if test -x /usr/sbin/sysversion ; then
  784. GUESS=$UNAME_MACHINE-unknown-osf1mk
  785. else
  786. GUESS=$UNAME_MACHINE-unknown-osf1
  787. fi
  788. ;;
  789. parisc*:Lites*:*:*)
  790. GUESS=hppa1.1-hp-lites
  791. ;;
  792. C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  793. GUESS=c1-convex-bsd
  794. ;;
  795. C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  796. if getsysinfo -f scalar_acc
  797. then echo c32-convex-bsd
  798. else echo c2-convex-bsd
  799. fi
  800. exit ;;
  801. C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  802. GUESS=c34-convex-bsd
  803. ;;
  804. C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  805. GUESS=c38-convex-bsd
  806. ;;
  807. C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  808. GUESS=c4-convex-bsd
  809. ;;
  810. CRAY*Y-MP:*:*:*)
  811. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  812. GUESS=ymp-cray-unicos$CRAY_REL
  813. ;;
  814. CRAY*[A-Z]90:*:*:*)
  815. echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
  816. | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  817. -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  818. -e 's/\.[^.]*$/.X/'
  819. exit ;;
  820. CRAY*TS:*:*:*)
  821. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  822. GUESS=t90-cray-unicos$CRAY_REL
  823. ;;
  824. CRAY*T3E:*:*:*)
  825. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  826. GUESS=alphaev5-cray-unicosmk$CRAY_REL
  827. ;;
  828. CRAY*SV1:*:*:*)
  829. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  830. GUESS=sv1-cray-unicos$CRAY_REL
  831. ;;
  832. *:UNICOS/mp:*:*)
  833. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  834. GUESS=craynv-cray-unicosmp$CRAY_REL
  835. ;;
  836. F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  837. FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
  838. FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
  839. FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
  840. GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
  841. ;;
  842. 5000:UNIX_System_V:4.*:*)
  843. FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
  844. FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
  845. GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
  846. ;;
  847. i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  848. GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
  849. ;;
  850. sparc*:BSD/OS:*:*)
  851. GUESS=sparc-unknown-bsdi$UNAME_RELEASE
  852. ;;
  853. *:BSD/OS:*:*)
  854. GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
  855. ;;
  856. arm:FreeBSD:*:*)
  857. UNAME_PROCESSOR=`uname -p`
  858. set_cc_for_build
  859. if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  860. | grep -q __ARM_PCS_VFP
  861. then
  862. FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  863. GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
  864. else
  865. FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  866. GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
  867. fi
  868. ;;
  869. *:FreeBSD:*:*)
  870. UNAME_PROCESSOR=`/usr/bin/uname -p`
  871. case $UNAME_PROCESSOR in
  872. amd64)
  873. UNAME_PROCESSOR=x86_64 ;;
  874. i386)
  875. UNAME_PROCESSOR=i586 ;;
  876. esac
  877. FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  878. GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
  879. ;;
  880. i*:CYGWIN*:*)
  881. GUESS=$UNAME_MACHINE-pc-cygwin
  882. ;;
  883. *:MINGW64*:*)
  884. GUESS=$UNAME_MACHINE-pc-mingw64
  885. ;;
  886. *:MINGW*:*)
  887. GUESS=$UNAME_MACHINE-pc-mingw32
  888. ;;
  889. *:MSYS*:*)
  890. GUESS=$UNAME_MACHINE-pc-msys
  891. ;;
  892. i*:PW*:*)
  893. GUESS=$UNAME_MACHINE-pc-pw32
  894. ;;
  895. *:SerenityOS:*:*)
  896. GUESS=$UNAME_MACHINE-pc-serenity
  897. ;;
  898. *:Interix*:*)
  899. case $UNAME_MACHINE in
  900. x86)
  901. GUESS=i586-pc-interix$UNAME_RELEASE
  902. ;;
  903. authenticamd | genuineintel | EM64T)
  904. GUESS=x86_64-unknown-interix$UNAME_RELEASE
  905. ;;
  906. IA64)
  907. GUESS=ia64-unknown-interix$UNAME_RELEASE
  908. ;;
  909. esac ;;
  910. i*:UWIN*:*)
  911. GUESS=$UNAME_MACHINE-pc-uwin
  912. ;;
  913. amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
  914. GUESS=x86_64-pc-cygwin
  915. ;;
  916. prep*:SunOS:5.*:*)
  917. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  918. GUESS=powerpcle-unknown-solaris2$SUN_REL
  919. ;;
  920. *:GNU:*:*)
  921. # the GNU system
  922. GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
  923. GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
  924. GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
  925. ;;
  926. *:GNU/*:*:*)
  927. # other systems with GNU libc and userland
  928. GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
  929. GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  930. GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
  931. ;;
  932. x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
  933. GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
  934. ;;
  935. *:[Mm]anagarm:*:*)
  936. GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
  937. ;;
  938. *:Minix:*:*)
  939. GUESS=$UNAME_MACHINE-unknown-minix
  940. ;;
  941. aarch64:Linux:*:*)
  942. set_cc_for_build
  943. CPU=$UNAME_MACHINE
  944. LIBCABI=$LIBC
  945. if test "$CC_FOR_BUILD" != no_compiler_found; then
  946. ABI=64
  947. sed 's/^ //' << EOF > "$dummy.c"
  948. #ifdef __ARM_EABI__
  949. #ifdef __ARM_PCS_VFP
  950. ABI=eabihf
  951. #else
  952. ABI=eabi
  953. #endif
  954. #endif
  955. EOF
  956. cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
  957. eval "$cc_set_abi"
  958. case $ABI in
  959. eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
  960. esac
  961. fi
  962. GUESS=$CPU-unknown-linux-$LIBCABI
  963. ;;
  964. aarch64_be:Linux:*:*)
  965. UNAME_MACHINE=aarch64_be
  966. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  967. ;;
  968. alpha:Linux:*:*)
  969. case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
  970. EV5) UNAME_MACHINE=alphaev5 ;;
  971. EV56) UNAME_MACHINE=alphaev56 ;;
  972. PCA56) UNAME_MACHINE=alphapca56 ;;
  973. PCA57) UNAME_MACHINE=alphapca56 ;;
  974. EV6) UNAME_MACHINE=alphaev6 ;;
  975. EV67) UNAME_MACHINE=alphaev67 ;;
  976. EV68*) UNAME_MACHINE=alphaev68 ;;
  977. esac
  978. objdump --private-headers /bin/sh | grep -q ld.so.1
  979. if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
  980. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  981. ;;
  982. arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
  983. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  984. ;;
  985. arm*:Linux:*:*)
  986. set_cc_for_build
  987. if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
  988. | grep -q __ARM_EABI__
  989. then
  990. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  991. else
  992. if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  993. | grep -q __ARM_PCS_VFP
  994. then
  995. GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
  996. else
  997. GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
  998. fi
  999. fi
  1000. ;;
  1001. avr32*:Linux:*:*)
  1002. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1003. ;;
  1004. cris:Linux:*:*)
  1005. GUESS=$UNAME_MACHINE-axis-linux-$LIBC
  1006. ;;
  1007. crisv32:Linux:*:*)
  1008. GUESS=$UNAME_MACHINE-axis-linux-$LIBC
  1009. ;;
  1010. e2k:Linux:*:*)
  1011. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1012. ;;
  1013. frv:Linux:*:*)
  1014. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1015. ;;
  1016. hexagon:Linux:*:*)
  1017. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1018. ;;
  1019. i*86:Linux:*:*)
  1020. GUESS=$UNAME_MACHINE-pc-linux-$LIBC
  1021. ;;
  1022. ia64:Linux:*:*)
  1023. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1024. ;;
  1025. k1om:Linux:*:*)
  1026. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1027. ;;
  1028. kvx:Linux:*:*)
  1029. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1030. ;;
  1031. kvx:cos:*:*)
  1032. GUESS=$UNAME_MACHINE-unknown-cos
  1033. ;;
  1034. kvx:mbr:*:*)
  1035. GUESS=$UNAME_MACHINE-unknown-mbr
  1036. ;;
  1037. loongarch32:Linux:*:* | loongarch64:Linux:*:*)
  1038. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1039. ;;
  1040. m32r*:Linux:*:*)
  1041. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1042. ;;
  1043. m68*:Linux:*:*)
  1044. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1045. ;;
  1046. mips:Linux:*:* | mips64:Linux:*:*)
  1047. set_cc_for_build
  1048. IS_GLIBC=0
  1049. test x"${LIBC}" = xgnu && IS_GLIBC=1
  1050. sed 's/^ //' << EOF > "$dummy.c"
  1051. #undef CPU
  1052. #undef mips
  1053. #undef mipsel
  1054. #undef mips64
  1055. #undef mips64el
  1056. #if ${IS_GLIBC} && defined(_ABI64)
  1057. LIBCABI=gnuabi64
  1058. #else
  1059. #if ${IS_GLIBC} && defined(_ABIN32)
  1060. LIBCABI=gnuabin32
  1061. #else
  1062. LIBCABI=${LIBC}
  1063. #endif
  1064. #endif
  1065. #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
  1066. CPU=mipsisa64r6
  1067. #else
  1068. #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
  1069. CPU=mipsisa32r6
  1070. #else
  1071. #if defined(__mips64)
  1072. CPU=mips64
  1073. #else
  1074. CPU=mips
  1075. #endif
  1076. #endif
  1077. #endif
  1078. #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  1079. MIPS_ENDIAN=el
  1080. #else
  1081. #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  1082. MIPS_ENDIAN=
  1083. #else
  1084. MIPS_ENDIAN=
  1085. #endif
  1086. #endif
  1087. EOF
  1088. cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
  1089. eval "$cc_set_vars"
  1090. test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
  1091. ;;
  1092. mips64el:Linux:*:*)
  1093. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1094. ;;
  1095. openrisc*:Linux:*:*)
  1096. GUESS=or1k-unknown-linux-$LIBC
  1097. ;;
  1098. or32:Linux:*:* | or1k*:Linux:*:*)
  1099. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1100. ;;
  1101. padre:Linux:*:*)
  1102. GUESS=sparc-unknown-linux-$LIBC
  1103. ;;
  1104. parisc64:Linux:*:* | hppa64:Linux:*:*)
  1105. GUESS=hppa64-unknown-linux-$LIBC
  1106. ;;
  1107. parisc:Linux:*:* | hppa:Linux:*:*)
  1108. # Look for CPU level
  1109. case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  1110. PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
  1111. PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
  1112. *) GUESS=hppa-unknown-linux-$LIBC ;;
  1113. esac
  1114. ;;
  1115. ppc64:Linux:*:*)
  1116. GUESS=powerpc64-unknown-linux-$LIBC
  1117. ;;
  1118. ppc:Linux:*:*)
  1119. GUESS=powerpc-unknown-linux-$LIBC
  1120. ;;
  1121. ppc64le:Linux:*:*)
  1122. GUESS=powerpc64le-unknown-linux-$LIBC
  1123. ;;
  1124. ppcle:Linux:*:*)
  1125. GUESS=powerpcle-unknown-linux-$LIBC
  1126. ;;
  1127. riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
  1128. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1129. ;;
  1130. s390:Linux:*:* | s390x:Linux:*:*)
  1131. GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
  1132. ;;
  1133. sh64*:Linux:*:*)
  1134. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1135. ;;
  1136. sh*:Linux:*:*)
  1137. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1138. ;;
  1139. sparc:Linux:*:* | sparc64:Linux:*:*)
  1140. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1141. ;;
  1142. tile*:Linux:*:*)
  1143. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1144. ;;
  1145. vax:Linux:*:*)
  1146. GUESS=$UNAME_MACHINE-dec-linux-$LIBC
  1147. ;;
  1148. x86_64:Linux:*:*)
  1149. set_cc_for_build
  1150. CPU=$UNAME_MACHINE
  1151. LIBCABI=$LIBC
  1152. if test "$CC_FOR_BUILD" != no_compiler_found; then
  1153. ABI=64
  1154. sed 's/^ //' << EOF > "$dummy.c"
  1155. #ifdef __i386__
  1156. ABI=x86
  1157. #else
  1158. #ifdef __ILP32__
  1159. ABI=x32
  1160. #endif
  1161. #endif
  1162. EOF
  1163. cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
  1164. eval "$cc_set_abi"
  1165. case $ABI in
  1166. x86) CPU=i686 ;;
  1167. x32) LIBCABI=${LIBC}x32 ;;
  1168. esac
  1169. fi
  1170. GUESS=$CPU-pc-linux-$LIBCABI
  1171. ;;
  1172. xtensa*:Linux:*:*)
  1173. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1174. ;;
  1175. i*86:DYNIX/ptx:4*:*)
  1176. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  1177. # earlier versions are messed up and put the nodename in both
  1178. # sysname and nodename.
  1179. GUESS=i386-sequent-sysv4
  1180. ;;
  1181. i*86:UNIX_SV:4.2MP:2.*)
  1182. # Unixware is an offshoot of SVR4, but it has its own version
  1183. # number series starting with 2...
  1184. # I am not positive that other SVR4 systems won't match this,
  1185. # I just have to hope. -- rms.
  1186. # Use sysv4.2uw... so that sysv4* matches it.
  1187. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
  1188. ;;
  1189. i*86:OS/2:*:*)
  1190. # If we were able to find 'uname', then EMX Unix compatibility
  1191. # is probably installed.
  1192. GUESS=$UNAME_MACHINE-pc-os2-emx
  1193. ;;
  1194. i*86:XTS-300:*:STOP)
  1195. GUESS=$UNAME_MACHINE-unknown-stop
  1196. ;;
  1197. i*86:atheos:*:*)
  1198. GUESS=$UNAME_MACHINE-unknown-atheos
  1199. ;;
  1200. i*86:syllable:*:*)
  1201. GUESS=$UNAME_MACHINE-pc-syllable
  1202. ;;
  1203. i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
  1204. GUESS=i386-unknown-lynxos$UNAME_RELEASE
  1205. ;;
  1206. i*86:*DOS:*:*)
  1207. GUESS=$UNAME_MACHINE-pc-msdosdjgpp
  1208. ;;
  1209. i*86:*:4.*:*)
  1210. UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
  1211. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  1212. GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
  1213. else
  1214. GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
  1215. fi
  1216. ;;
  1217. i*86:*:5:[678]*)
  1218. # UnixWare 7.x, OpenUNIX and OpenServer 6.
  1219. case `/bin/uname -X | grep "^Machine"` in
  1220. *486*) UNAME_MACHINE=i486 ;;
  1221. *Pentium) UNAME_MACHINE=i586 ;;
  1222. *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1223. esac
  1224. GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
  1225. ;;
  1226. i*86:*:3.2:*)
  1227. if test -f /usr/options/cb.name; then
  1228. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  1229. GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
  1230. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  1231. UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  1232. (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  1233. (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  1234. && UNAME_MACHINE=i586
  1235. (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  1236. && UNAME_MACHINE=i686
  1237. (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  1238. && UNAME_MACHINE=i686
  1239. GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
  1240. else
  1241. GUESS=$UNAME_MACHINE-pc-sysv32
  1242. fi
  1243. ;;
  1244. pc:*:*:*)
  1245. # Left here for compatibility:
  1246. # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1247. # the processor, so we play safe by assuming i586.
  1248. # Note: whatever this is, it MUST be the same as what config.sub
  1249. # prints for the "djgpp" host, or else GDB configure will decide that
  1250. # this is a cross-build.
  1251. GUESS=i586-pc-msdosdjgpp
  1252. ;;
  1253. Intel:Mach:3*:*)
  1254. GUESS=i386-pc-mach3
  1255. ;;
  1256. paragon:*:*:*)
  1257. GUESS=i860-intel-osf1
  1258. ;;
  1259. i860:*:4.*:*) # i860-SVR4
  1260. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  1261. GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
  1262. else # Add other i860-SVR4 vendors below as they are discovered.
  1263. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
  1264. fi
  1265. ;;
  1266. mini*:CTIX:SYS*5:*)
  1267. # "miniframe"
  1268. GUESS=m68010-convergent-sysv
  1269. ;;
  1270. mc68k:UNIX:SYSTEM5:3.51m)
  1271. GUESS=m68k-convergent-sysv
  1272. ;;
  1273. M680?0:D-NIX:5.3:*)
  1274. GUESS=m68k-diab-dnix
  1275. ;;
  1276. M68*:*:R3V[5678]*:*)
  1277. test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
  1278. 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
  1279. OS_REL=''
  1280. test -r /etc/.relid \
  1281. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1282. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1283. && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1284. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1285. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1286. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1287. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1288. && { echo i486-ncr-sysv4; exit; } ;;
  1289. NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1290. OS_REL='.3'
  1291. test -r /etc/.relid \
  1292. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1293. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1294. && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1295. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1296. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
  1297. /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
  1298. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1299. m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1300. GUESS=m68k-unknown-lynxos$UNAME_RELEASE
  1301. ;;
  1302. mc68030:UNIX_System_V:4.*:*)
  1303. GUESS=m68k-atari-sysv4
  1304. ;;
  1305. TSUNAMI:LynxOS:2.*:*)
  1306. GUESS=sparc-unknown-lynxos$UNAME_RELEASE
  1307. ;;
  1308. rs6000:LynxOS:2.*:*)
  1309. GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
  1310. ;;
  1311. PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
  1312. GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
  1313. ;;
  1314. SM[BE]S:UNIX_SV:*:*)
  1315. GUESS=mips-dde-sysv$UNAME_RELEASE
  1316. ;;
  1317. RM*:ReliantUNIX-*:*:*)
  1318. GUESS=mips-sni-sysv4
  1319. ;;
  1320. RM*:SINIX-*:*:*)
  1321. GUESS=mips-sni-sysv4
  1322. ;;
  1323. *:SINIX-*:*:*)
  1324. if uname -p 2>/dev/null >/dev/null ; then
  1325. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1326. GUESS=$UNAME_MACHINE-sni-sysv4
  1327. else
  1328. GUESS=ns32k-sni-sysv
  1329. fi
  1330. ;;
  1331. PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
  1332. # says <Richard.M.Bartel@ccMail.Census.GOV>
  1333. GUESS=i586-unisys-sysv4
  1334. ;;
  1335. *:UNIX_System_V:4*:FTX*)
  1336. # From Gerald Hewes <hewes@openmarket.com>.
  1337. # How about differentiating between stratus architectures? -djm
  1338. GUESS=hppa1.1-stratus-sysv4
  1339. ;;
  1340. *:*:*:FTX*)
  1341. # From seanf@swdc.stratus.com.
  1342. GUESS=i860-stratus-sysv4
  1343. ;;
  1344. i*86:VOS:*:*)
  1345. # From Paul.Green@stratus.com.
  1346. GUESS=$UNAME_MACHINE-stratus-vos
  1347. ;;
  1348. *:VOS:*:*)
  1349. # From Paul.Green@stratus.com.
  1350. GUESS=hppa1.1-stratus-vos
  1351. ;;
  1352. mc68*:A/UX:*:*)
  1353. GUESS=m68k-apple-aux$UNAME_RELEASE
  1354. ;;
  1355. news*:NEWS-OS:6*:*)
  1356. GUESS=mips-sony-newsos6
  1357. ;;
  1358. R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1359. if test -d /usr/nec; then
  1360. GUESS=mips-nec-sysv$UNAME_RELEASE
  1361. else
  1362. GUESS=mips-unknown-sysv$UNAME_RELEASE
  1363. fi
  1364. ;;
  1365. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1366. GUESS=powerpc-be-beos
  1367. ;;
  1368. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1369. GUESS=powerpc-apple-beos
  1370. ;;
  1371. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1372. GUESS=i586-pc-beos
  1373. ;;
  1374. BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
  1375. GUESS=i586-pc-haiku
  1376. ;;
  1377. ppc:Haiku:*:*) # Haiku running on Apple PowerPC
  1378. GUESS=powerpc-apple-haiku
  1379. ;;
  1380. *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
  1381. GUESS=$UNAME_MACHINE-unknown-haiku
  1382. ;;
  1383. SX-4:SUPER-UX:*:*)
  1384. GUESS=sx4-nec-superux$UNAME_RELEASE
  1385. ;;
  1386. SX-5:SUPER-UX:*:*)
  1387. GUESS=sx5-nec-superux$UNAME_RELEASE
  1388. ;;
  1389. SX-6:SUPER-UX:*:*)
  1390. GUESS=sx6-nec-superux$UNAME_RELEASE
  1391. ;;
  1392. SX-7:SUPER-UX:*:*)
  1393. GUESS=sx7-nec-superux$UNAME_RELEASE
  1394. ;;
  1395. SX-8:SUPER-UX:*:*)
  1396. GUESS=sx8-nec-superux$UNAME_RELEASE
  1397. ;;
  1398. SX-8R:SUPER-UX:*:*)
  1399. GUESS=sx8r-nec-superux$UNAME_RELEASE
  1400. ;;
  1401. SX-ACE:SUPER-UX:*:*)
  1402. GUESS=sxace-nec-superux$UNAME_RELEASE
  1403. ;;
  1404. Power*:Rhapsody:*:*)
  1405. GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
  1406. ;;
  1407. *:Rhapsody:*:*)
  1408. GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
  1409. ;;
  1410. arm64:Darwin:*:*)
  1411. GUESS=aarch64-apple-darwin$UNAME_RELEASE
  1412. ;;
  1413. *:Darwin:*:*)
  1414. UNAME_PROCESSOR=`uname -p`
  1415. case $UNAME_PROCESSOR in
  1416. unknown) UNAME_PROCESSOR=powerpc ;;
  1417. esac
  1418. if command -v xcode-select > /dev/null 2> /dev/null && \
  1419. ! xcode-select --print-path > /dev/null 2> /dev/null ; then
  1420. # Avoid executing cc if there is no toolchain installed as
  1421. # cc will be a stub that puts up a graphical alert
  1422. # prompting the user to install developer tools.
  1423. CC_FOR_BUILD=no_compiler_found
  1424. else
  1425. set_cc_for_build
  1426. fi
  1427. if test "$CC_FOR_BUILD" != no_compiler_found; then
  1428. if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1429. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1430. grep IS_64BIT_ARCH >/dev/null
  1431. then
  1432. case $UNAME_PROCESSOR in
  1433. i386) UNAME_PROCESSOR=x86_64 ;;
  1434. powerpc) UNAME_PROCESSOR=powerpc64 ;;
  1435. esac
  1436. fi
  1437. # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
  1438. if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
  1439. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1440. grep IS_PPC >/dev/null
  1441. then
  1442. UNAME_PROCESSOR=powerpc
  1443. fi
  1444. elif test "$UNAME_PROCESSOR" = i386 ; then
  1445. # uname -m returns i386 or x86_64
  1446. UNAME_PROCESSOR=$UNAME_MACHINE
  1447. fi
  1448. GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
  1449. ;;
  1450. *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1451. UNAME_PROCESSOR=`uname -p`
  1452. if test "$UNAME_PROCESSOR" = x86; then
  1453. UNAME_PROCESSOR=i386
  1454. UNAME_MACHINE=pc
  1455. fi
  1456. GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
  1457. ;;
  1458. *:QNX:*:4*)
  1459. GUESS=i386-pc-qnx
  1460. ;;
  1461. NEO-*:NONSTOP_KERNEL:*:*)
  1462. GUESS=neo-tandem-nsk$UNAME_RELEASE
  1463. ;;
  1464. NSE-*:NONSTOP_KERNEL:*:*)
  1465. GUESS=nse-tandem-nsk$UNAME_RELEASE
  1466. ;;
  1467. NSR-*:NONSTOP_KERNEL:*:*)
  1468. GUESS=nsr-tandem-nsk$UNAME_RELEASE
  1469. ;;
  1470. NSV-*:NONSTOP_KERNEL:*:*)
  1471. GUESS=nsv-tandem-nsk$UNAME_RELEASE
  1472. ;;
  1473. NSX-*:NONSTOP_KERNEL:*:*)
  1474. GUESS=nsx-tandem-nsk$UNAME_RELEASE
  1475. ;;
  1476. *:NonStop-UX:*:*)
  1477. GUESS=mips-compaq-nonstopux
  1478. ;;
  1479. BS2000:POSIX*:*:*)
  1480. GUESS=bs2000-siemens-sysv
  1481. ;;
  1482. DS/*:UNIX_System_V:*:*)
  1483. GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
  1484. ;;
  1485. *:Plan9:*:*)
  1486. # "uname -m" is not consistent, so use $cputype instead. 386
  1487. # is converted to i386 for consistency with other x86
  1488. # operating systems.
  1489. if test "${cputype-}" = 386; then
  1490. UNAME_MACHINE=i386
  1491. elif test "x${cputype-}" != x; then
  1492. UNAME_MACHINE=$cputype
  1493. fi
  1494. GUESS=$UNAME_MACHINE-unknown-plan9
  1495. ;;
  1496. *:TOPS-10:*:*)
  1497. GUESS=pdp10-unknown-tops10
  1498. ;;
  1499. *:TENEX:*:*)
  1500. GUESS=pdp10-unknown-tenex
  1501. ;;
  1502. KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
  1503. GUESS=pdp10-dec-tops20
  1504. ;;
  1505. XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
  1506. GUESS=pdp10-xkl-tops20
  1507. ;;
  1508. *:TOPS-20:*:*)
  1509. GUESS=pdp10-unknown-tops20
  1510. ;;
  1511. *:ITS:*:*)
  1512. GUESS=pdp10-unknown-its
  1513. ;;
  1514. SEI:*:*:SEIUX)
  1515. GUESS=mips-sei-seiux$UNAME_RELEASE
  1516. ;;
  1517. *:DragonFly:*:*)
  1518. DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  1519. GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
  1520. ;;
  1521. *:*VMS:*:*)
  1522. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1523. case $UNAME_MACHINE in
  1524. A*) GUESS=alpha-dec-vms ;;
  1525. I*) GUESS=ia64-dec-vms ;;
  1526. V*) GUESS=vax-dec-vms ;;
  1527. esac ;;
  1528. *:XENIX:*:SysV)
  1529. GUESS=i386-pc-xenix
  1530. ;;
  1531. i*86:skyos:*:*)
  1532. SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
  1533. GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
  1534. ;;
  1535. i*86:rdos:*:*)
  1536. GUESS=$UNAME_MACHINE-pc-rdos
  1537. ;;
  1538. i*86:Fiwix:*:*)
  1539. GUESS=$UNAME_MACHINE-pc-fiwix
  1540. ;;
  1541. *:AROS:*:*)
  1542. GUESS=$UNAME_MACHINE-unknown-aros
  1543. ;;
  1544. x86_64:VMkernel:*:*)
  1545. GUESS=$UNAME_MACHINE-unknown-esx
  1546. ;;
  1547. amd64:Isilon\ OneFS:*:*)
  1548. GUESS=x86_64-unknown-onefs
  1549. ;;
  1550. *:Unleashed:*:*)
  1551. GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
  1552. ;;
  1553. esac
  1554. # Do we have a guess based on uname results?
  1555. if test "x$GUESS" != x; then
  1556. echo "$GUESS"
  1557. exit
  1558. fi
  1559. # No uname command or uname output not recognized.
  1560. set_cc_for_build
  1561. cat > "$dummy.c" <<EOF
  1562. #ifdef _SEQUENT_
  1563. #include <sys/types.h>
  1564. #include <sys/utsname.h>
  1565. #endif
  1566. #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
  1567. #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
  1568. #include <signal.h>
  1569. #if defined(_SIZE_T_) || defined(SIGLOST)
  1570. #include <sys/utsname.h>
  1571. #endif
  1572. #endif
  1573. #endif
  1574. main ()
  1575. {
  1576. #if defined (sony)
  1577. #if defined (MIPSEB)
  1578. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1579. I don't know.... */
  1580. printf ("mips-sony-bsd\n"); exit (0);
  1581. #else
  1582. #include <sys/param.h>
  1583. printf ("m68k-sony-newsos%s\n",
  1584. #ifdef NEWSOS4
  1585. "4"
  1586. #else
  1587. ""
  1588. #endif
  1589. ); exit (0);
  1590. #endif
  1591. #endif
  1592. #if defined (NeXT)
  1593. #if !defined (__ARCHITECTURE__)
  1594. #define __ARCHITECTURE__ "m68k"
  1595. #endif
  1596. int version;
  1597. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1598. if (version < 4)
  1599. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1600. else
  1601. printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1602. exit (0);
  1603. #endif
  1604. #if defined (MULTIMAX) || defined (n16)
  1605. #if defined (UMAXV)
  1606. printf ("ns32k-encore-sysv\n"); exit (0);
  1607. #else
  1608. #if defined (CMU)
  1609. printf ("ns32k-encore-mach\n"); exit (0);
  1610. #else
  1611. printf ("ns32k-encore-bsd\n"); exit (0);
  1612. #endif
  1613. #endif
  1614. #endif
  1615. #if defined (__386BSD__)
  1616. printf ("i386-pc-bsd\n"); exit (0);
  1617. #endif
  1618. #if defined (sequent)
  1619. #if defined (i386)
  1620. printf ("i386-sequent-dynix\n"); exit (0);
  1621. #endif
  1622. #if defined (ns32000)
  1623. printf ("ns32k-sequent-dynix\n"); exit (0);
  1624. #endif
  1625. #endif
  1626. #if defined (_SEQUENT_)
  1627. struct utsname un;
  1628. uname(&un);
  1629. if (strncmp(un.version, "V2", 2) == 0) {
  1630. printf ("i386-sequent-ptx2\n"); exit (0);
  1631. }
  1632. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1633. printf ("i386-sequent-ptx1\n"); exit (0);
  1634. }
  1635. printf ("i386-sequent-ptx\n"); exit (0);
  1636. #endif
  1637. #if defined (vax)
  1638. #if !defined (ultrix)
  1639. #include <sys/param.h>
  1640. #if defined (BSD)
  1641. #if BSD == 43
  1642. printf ("vax-dec-bsd4.3\n"); exit (0);
  1643. #else
  1644. #if BSD == 199006
  1645. printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1646. #else
  1647. printf ("vax-dec-bsd\n"); exit (0);
  1648. #endif
  1649. #endif
  1650. #else
  1651. printf ("vax-dec-bsd\n"); exit (0);
  1652. #endif
  1653. #else
  1654. #if defined(_SIZE_T_) || defined(SIGLOST)
  1655. struct utsname un;
  1656. uname (&un);
  1657. printf ("vax-dec-ultrix%s\n", un.release); exit (0);
  1658. #else
  1659. printf ("vax-dec-ultrix\n"); exit (0);
  1660. #endif
  1661. #endif
  1662. #endif
  1663. #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
  1664. #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
  1665. #if defined(_SIZE_T_) || defined(SIGLOST)
  1666. struct utsname *un;
  1667. uname (&un);
  1668. printf ("mips-dec-ultrix%s\n", un.release); exit (0);
  1669. #else
  1670. printf ("mips-dec-ultrix\n"); exit (0);
  1671. #endif
  1672. #endif
  1673. #endif
  1674. #if defined (alliant) && defined (i860)
  1675. printf ("i860-alliant-bsd\n"); exit (0);
  1676. #endif
  1677. exit (1);
  1678. }
  1679. EOF
  1680. $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
  1681. { echo "$SYSTEM_NAME"; exit; }
  1682. # Apollos put the system type in the environment.
  1683. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
  1684. echo "$0: unable to guess system type" >&2
  1685. case $UNAME_MACHINE:$UNAME_SYSTEM in
  1686. mips:Linux | mips64:Linux)
  1687. # If we got here on MIPS GNU/Linux, output extra information.
  1688. cat >&2 <<EOF
  1689. NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
  1690. the system type. Please install a C compiler and try again.
  1691. EOF
  1692. ;;
  1693. esac
  1694. cat >&2 <<EOF
  1695. This script (version $timestamp), has failed to recognize the
  1696. operating system you are using. If your script is old, overwrite *all*
  1697. copies of config.guess and config.sub with the latest versions from:
  1698. https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
  1699. and
  1700. https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
  1701. EOF
  1702. our_year=`echo $timestamp | sed 's,-.*,,'`
  1703. thisyear=`date +%Y`
  1704. # shellcheck disable=SC2003
  1705. script_age=`expr "$thisyear" - "$our_year"`
  1706. if test "$script_age" -lt 3 ; then
  1707. cat >&2 <<EOF
  1708. If $0 has already been updated, send the following data and any
  1709. information you think might be pertinent to config-patches@gnu.org to
  1710. provide the necessary information to handle your system.
  1711. config.guess timestamp = $timestamp
  1712. uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1713. uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1714. uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1715. uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1716. /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1717. /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1718. hostinfo = `(hostinfo) 2>/dev/null`
  1719. /bin/universe = `(/bin/universe) 2>/dev/null`
  1720. /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1721. /bin/arch = `(/bin/arch) 2>/dev/null`
  1722. /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1723. /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1724. UNAME_MACHINE = "$UNAME_MACHINE"
  1725. UNAME_RELEASE = "$UNAME_RELEASE"
  1726. UNAME_SYSTEM = "$UNAME_SYSTEM"
  1727. UNAME_VERSION = "$UNAME_VERSION"
  1728. EOF
  1729. fi
  1730. exit 1
  1731. # Local variables:
  1732. # eval: (add-hook 'before-save-hook 'time-stamp)
  1733. # time-stamp-start: "timestamp='"
  1734. # time-stamp-format: "%:y-%02m-%02d"
  1735. # time-stamp-end: "'"
  1736. # End: