github的一些开源项目
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.

1748 lines
48 KiB

  1. #! /bin/sh
  2. # Attempt to guess a canonical system name.
  3. # Copyright 1992-2021 Free Software Foundation, Inc.
  4. # shellcheck disable=SC2006,SC2268 # see below for rationale
  5. timestamp='2021-06-03'
  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-2021 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 -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. *:Interix*:*)
  896. case $UNAME_MACHINE in
  897. x86)
  898. GUESS=i586-pc-interix$UNAME_RELEASE
  899. ;;
  900. authenticamd | genuineintel | EM64T)
  901. GUESS=x86_64-unknown-interix$UNAME_RELEASE
  902. ;;
  903. IA64)
  904. GUESS=ia64-unknown-interix$UNAME_RELEASE
  905. ;;
  906. esac ;;
  907. i*:UWIN*:*)
  908. GUESS=$UNAME_MACHINE-pc-uwin
  909. ;;
  910. amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
  911. GUESS=x86_64-pc-cygwin
  912. ;;
  913. prep*:SunOS:5.*:*)
  914. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  915. GUESS=powerpcle-unknown-solaris2$SUN_REL
  916. ;;
  917. *:GNU:*:*)
  918. # the GNU system
  919. GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
  920. GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
  921. GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
  922. ;;
  923. *:GNU/*:*:*)
  924. # other systems with GNU libc and userland
  925. GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
  926. GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  927. GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
  928. ;;
  929. *:Minix:*:*)
  930. GUESS=$UNAME_MACHINE-unknown-minix
  931. ;;
  932. aarch64:Linux:*:*)
  933. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  934. ;;
  935. aarch64_be:Linux:*:*)
  936. UNAME_MACHINE=aarch64_be
  937. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  938. ;;
  939. alpha:Linux:*:*)
  940. case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
  941. EV5) UNAME_MACHINE=alphaev5 ;;
  942. EV56) UNAME_MACHINE=alphaev56 ;;
  943. PCA56) UNAME_MACHINE=alphapca56 ;;
  944. PCA57) UNAME_MACHINE=alphapca56 ;;
  945. EV6) UNAME_MACHINE=alphaev6 ;;
  946. EV67) UNAME_MACHINE=alphaev67 ;;
  947. EV68*) UNAME_MACHINE=alphaev68 ;;
  948. esac
  949. objdump --private-headers /bin/sh | grep -q ld.so.1
  950. if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
  951. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  952. ;;
  953. arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
  954. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  955. ;;
  956. arm*:Linux:*:*)
  957. set_cc_for_build
  958. if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
  959. | grep -q __ARM_EABI__
  960. then
  961. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  962. else
  963. if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  964. | grep -q __ARM_PCS_VFP
  965. then
  966. GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
  967. else
  968. GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
  969. fi
  970. fi
  971. ;;
  972. avr32*:Linux:*:*)
  973. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  974. ;;
  975. cris:Linux:*:*)
  976. GUESS=$UNAME_MACHINE-axis-linux-$LIBC
  977. ;;
  978. crisv32:Linux:*:*)
  979. GUESS=$UNAME_MACHINE-axis-linux-$LIBC
  980. ;;
  981. e2k:Linux:*:*)
  982. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  983. ;;
  984. frv:Linux:*:*)
  985. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  986. ;;
  987. hexagon:Linux:*:*)
  988. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  989. ;;
  990. i*86:Linux:*:*)
  991. GUESS=$UNAME_MACHINE-pc-linux-$LIBC
  992. ;;
  993. ia64:Linux:*:*)
  994. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  995. ;;
  996. k1om:Linux:*:*)
  997. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  998. ;;
  999. loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
  1000. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1001. ;;
  1002. m32r*:Linux:*:*)
  1003. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1004. ;;
  1005. m68*:Linux:*:*)
  1006. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1007. ;;
  1008. mips:Linux:*:* | mips64:Linux:*:*)
  1009. set_cc_for_build
  1010. IS_GLIBC=0
  1011. test x"${LIBC}" = xgnu && IS_GLIBC=1
  1012. sed 's/^ //' << EOF > "$dummy.c"
  1013. #undef CPU
  1014. #undef mips
  1015. #undef mipsel
  1016. #undef mips64
  1017. #undef mips64el
  1018. #if ${IS_GLIBC} && defined(_ABI64)
  1019. LIBCABI=gnuabi64
  1020. #else
  1021. #if ${IS_GLIBC} && defined(_ABIN32)
  1022. LIBCABI=gnuabin32
  1023. #else
  1024. LIBCABI=${LIBC}
  1025. #endif
  1026. #endif
  1027. #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
  1028. CPU=mipsisa64r6
  1029. #else
  1030. #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
  1031. CPU=mipsisa32r6
  1032. #else
  1033. #if defined(__mips64)
  1034. CPU=mips64
  1035. #else
  1036. CPU=mips
  1037. #endif
  1038. #endif
  1039. #endif
  1040. #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  1041. MIPS_ENDIAN=el
  1042. #else
  1043. #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  1044. MIPS_ENDIAN=
  1045. #else
  1046. MIPS_ENDIAN=
  1047. #endif
  1048. #endif
  1049. EOF
  1050. cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
  1051. eval "$cc_set_vars"
  1052. test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
  1053. ;;
  1054. mips64el:Linux:*:*)
  1055. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1056. ;;
  1057. openrisc*:Linux:*:*)
  1058. GUESS=or1k-unknown-linux-$LIBC
  1059. ;;
  1060. or32:Linux:*:* | or1k*:Linux:*:*)
  1061. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1062. ;;
  1063. padre:Linux:*:*)
  1064. GUESS=sparc-unknown-linux-$LIBC
  1065. ;;
  1066. parisc64:Linux:*:* | hppa64:Linux:*:*)
  1067. GUESS=hppa64-unknown-linux-$LIBC
  1068. ;;
  1069. parisc:Linux:*:* | hppa:Linux:*:*)
  1070. # Look for CPU level
  1071. case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  1072. PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
  1073. PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
  1074. *) GUESS=hppa-unknown-linux-$LIBC ;;
  1075. esac
  1076. ;;
  1077. ppc64:Linux:*:*)
  1078. GUESS=powerpc64-unknown-linux-$LIBC
  1079. ;;
  1080. ppc:Linux:*:*)
  1081. GUESS=powerpc-unknown-linux-$LIBC
  1082. ;;
  1083. ppc64le:Linux:*:*)
  1084. GUESS=powerpc64le-unknown-linux-$LIBC
  1085. ;;
  1086. ppcle:Linux:*:*)
  1087. GUESS=powerpcle-unknown-linux-$LIBC
  1088. ;;
  1089. riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
  1090. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1091. ;;
  1092. s390:Linux:*:* | s390x:Linux:*:*)
  1093. GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
  1094. ;;
  1095. sh64*:Linux:*:*)
  1096. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1097. ;;
  1098. sh*:Linux:*:*)
  1099. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1100. ;;
  1101. sparc:Linux:*:* | sparc64:Linux:*:*)
  1102. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1103. ;;
  1104. tile*:Linux:*:*)
  1105. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1106. ;;
  1107. vax:Linux:*:*)
  1108. GUESS=$UNAME_MACHINE-dec-linux-$LIBC
  1109. ;;
  1110. x86_64:Linux:*:*)
  1111. set_cc_for_build
  1112. LIBCABI=$LIBC
  1113. if test "$CC_FOR_BUILD" != no_compiler_found; then
  1114. if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
  1115. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1116. grep IS_X32 >/dev/null
  1117. then
  1118. LIBCABI=${LIBC}x32
  1119. fi
  1120. fi
  1121. GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
  1122. ;;
  1123. xtensa*:Linux:*:*)
  1124. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1125. ;;
  1126. i*86:DYNIX/ptx:4*:*)
  1127. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  1128. # earlier versions are messed up and put the nodename in both
  1129. # sysname and nodename.
  1130. GUESS=i386-sequent-sysv4
  1131. ;;
  1132. i*86:UNIX_SV:4.2MP:2.*)
  1133. # Unixware is an offshoot of SVR4, but it has its own version
  1134. # number series starting with 2...
  1135. # I am not positive that other SVR4 systems won't match this,
  1136. # I just have to hope. -- rms.
  1137. # Use sysv4.2uw... so that sysv4* matches it.
  1138. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
  1139. ;;
  1140. i*86:OS/2:*:*)
  1141. # If we were able to find `uname', then EMX Unix compatibility
  1142. # is probably installed.
  1143. GUESS=$UNAME_MACHINE-pc-os2-emx
  1144. ;;
  1145. i*86:XTS-300:*:STOP)
  1146. GUESS=$UNAME_MACHINE-unknown-stop
  1147. ;;
  1148. i*86:atheos:*:*)
  1149. GUESS=$UNAME_MACHINE-unknown-atheos
  1150. ;;
  1151. i*86:syllable:*:*)
  1152. GUESS=$UNAME_MACHINE-pc-syllable
  1153. ;;
  1154. i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
  1155. GUESS=i386-unknown-lynxos$UNAME_RELEASE
  1156. ;;
  1157. i*86:*DOS:*:*)
  1158. GUESS=$UNAME_MACHINE-pc-msdosdjgpp
  1159. ;;
  1160. i*86:*:4.*:*)
  1161. UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
  1162. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  1163. GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
  1164. else
  1165. GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
  1166. fi
  1167. ;;
  1168. i*86:*:5:[678]*)
  1169. # UnixWare 7.x, OpenUNIX and OpenServer 6.
  1170. case `/bin/uname -X | grep "^Machine"` in
  1171. *486*) UNAME_MACHINE=i486 ;;
  1172. *Pentium) UNAME_MACHINE=i586 ;;
  1173. *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1174. esac
  1175. GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
  1176. ;;
  1177. i*86:*:3.2:*)
  1178. if test -f /usr/options/cb.name; then
  1179. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  1180. GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
  1181. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  1182. UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  1183. (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  1184. (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  1185. && UNAME_MACHINE=i586
  1186. (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  1187. && UNAME_MACHINE=i686
  1188. (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  1189. && UNAME_MACHINE=i686
  1190. GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
  1191. else
  1192. GUESS=$UNAME_MACHINE-pc-sysv32
  1193. fi
  1194. ;;
  1195. pc:*:*:*)
  1196. # Left here for compatibility:
  1197. # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1198. # the processor, so we play safe by assuming i586.
  1199. # Note: whatever this is, it MUST be the same as what config.sub
  1200. # prints for the "djgpp" host, or else GDB configure will decide that
  1201. # this is a cross-build.
  1202. GUESS=i586-pc-msdosdjgpp
  1203. ;;
  1204. Intel:Mach:3*:*)
  1205. GUESS=i386-pc-mach3
  1206. ;;
  1207. paragon:*:*:*)
  1208. GUESS=i860-intel-osf1
  1209. ;;
  1210. i860:*:4.*:*) # i860-SVR4
  1211. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  1212. GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
  1213. else # Add other i860-SVR4 vendors below as they are discovered.
  1214. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
  1215. fi
  1216. ;;
  1217. mini*:CTIX:SYS*5:*)
  1218. # "miniframe"
  1219. GUESS=m68010-convergent-sysv
  1220. ;;
  1221. mc68k:UNIX:SYSTEM5:3.51m)
  1222. GUESS=m68k-convergent-sysv
  1223. ;;
  1224. M680?0:D-NIX:5.3:*)
  1225. GUESS=m68k-diab-dnix
  1226. ;;
  1227. M68*:*:R3V[5678]*:*)
  1228. test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
  1229. 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)
  1230. OS_REL=''
  1231. test -r /etc/.relid \
  1232. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1233. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1234. && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1235. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1236. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1237. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1238. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1239. && { echo i486-ncr-sysv4; exit; } ;;
  1240. NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1241. OS_REL='.3'
  1242. test -r /etc/.relid \
  1243. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1244. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1245. && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1246. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1247. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
  1248. /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
  1249. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1250. m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1251. GUESS=m68k-unknown-lynxos$UNAME_RELEASE
  1252. ;;
  1253. mc68030:UNIX_System_V:4.*:*)
  1254. GUESS=m68k-atari-sysv4
  1255. ;;
  1256. TSUNAMI:LynxOS:2.*:*)
  1257. GUESS=sparc-unknown-lynxos$UNAME_RELEASE
  1258. ;;
  1259. rs6000:LynxOS:2.*:*)
  1260. GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
  1261. ;;
  1262. PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
  1263. GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
  1264. ;;
  1265. SM[BE]S:UNIX_SV:*:*)
  1266. GUESS=mips-dde-sysv$UNAME_RELEASE
  1267. ;;
  1268. RM*:ReliantUNIX-*:*:*)
  1269. GUESS=mips-sni-sysv4
  1270. ;;
  1271. RM*:SINIX-*:*:*)
  1272. GUESS=mips-sni-sysv4
  1273. ;;
  1274. *:SINIX-*:*:*)
  1275. if uname -p 2>/dev/null >/dev/null ; then
  1276. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1277. GUESS=$UNAME_MACHINE-sni-sysv4
  1278. else
  1279. GUESS=ns32k-sni-sysv
  1280. fi
  1281. ;;
  1282. PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1283. # says <Richard.M.Bartel@ccMail.Census.GOV>
  1284. GUESS=i586-unisys-sysv4
  1285. ;;
  1286. *:UNIX_System_V:4*:FTX*)
  1287. # From Gerald Hewes <hewes@openmarket.com>.
  1288. # How about differentiating between stratus architectures? -djm
  1289. GUESS=hppa1.1-stratus-sysv4
  1290. ;;
  1291. *:*:*:FTX*)
  1292. # From seanf@swdc.stratus.com.
  1293. GUESS=i860-stratus-sysv4
  1294. ;;
  1295. i*86:VOS:*:*)
  1296. # From Paul.Green@stratus.com.
  1297. GUESS=$UNAME_MACHINE-stratus-vos
  1298. ;;
  1299. *:VOS:*:*)
  1300. # From Paul.Green@stratus.com.
  1301. GUESS=hppa1.1-stratus-vos
  1302. ;;
  1303. mc68*:A/UX:*:*)
  1304. GUESS=m68k-apple-aux$UNAME_RELEASE
  1305. ;;
  1306. news*:NEWS-OS:6*:*)
  1307. GUESS=mips-sony-newsos6
  1308. ;;
  1309. R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1310. if test -d /usr/nec; then
  1311. GUESS=mips-nec-sysv$UNAME_RELEASE
  1312. else
  1313. GUESS=mips-unknown-sysv$UNAME_RELEASE
  1314. fi
  1315. ;;
  1316. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1317. GUESS=powerpc-be-beos
  1318. ;;
  1319. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1320. GUESS=powerpc-apple-beos
  1321. ;;
  1322. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1323. GUESS=i586-pc-beos
  1324. ;;
  1325. BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
  1326. GUESS=i586-pc-haiku
  1327. ;;
  1328. x86_64:Haiku:*:*)
  1329. GUESS=x86_64-unknown-haiku
  1330. ;;
  1331. SX-4:SUPER-UX:*:*)
  1332. GUESS=sx4-nec-superux$UNAME_RELEASE
  1333. ;;
  1334. SX-5:SUPER-UX:*:*)
  1335. GUESS=sx5-nec-superux$UNAME_RELEASE
  1336. ;;
  1337. SX-6:SUPER-UX:*:*)
  1338. GUESS=sx6-nec-superux$UNAME_RELEASE
  1339. ;;
  1340. SX-7:SUPER-UX:*:*)
  1341. GUESS=sx7-nec-superux$UNAME_RELEASE
  1342. ;;
  1343. SX-8:SUPER-UX:*:*)
  1344. GUESS=sx8-nec-superux$UNAME_RELEASE
  1345. ;;
  1346. SX-8R:SUPER-UX:*:*)
  1347. GUESS=sx8r-nec-superux$UNAME_RELEASE
  1348. ;;
  1349. SX-ACE:SUPER-UX:*:*)
  1350. GUESS=sxace-nec-superux$UNAME_RELEASE
  1351. ;;
  1352. Power*:Rhapsody:*:*)
  1353. GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
  1354. ;;
  1355. *:Rhapsody:*:*)
  1356. GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
  1357. ;;
  1358. arm64:Darwin:*:*)
  1359. GUESS=aarch64-apple-darwin$UNAME_RELEASE
  1360. ;;
  1361. *:Darwin:*:*)
  1362. UNAME_PROCESSOR=`uname -p`
  1363. case $UNAME_PROCESSOR in
  1364. unknown) UNAME_PROCESSOR=powerpc ;;
  1365. esac
  1366. if command -v xcode-select > /dev/null 2> /dev/null && \
  1367. ! xcode-select --print-path > /dev/null 2> /dev/null ; then
  1368. # Avoid executing cc if there is no toolchain installed as
  1369. # cc will be a stub that puts up a graphical alert
  1370. # prompting the user to install developer tools.
  1371. CC_FOR_BUILD=no_compiler_found
  1372. else
  1373. set_cc_for_build
  1374. fi
  1375. if test "$CC_FOR_BUILD" != no_compiler_found; then
  1376. if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1377. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1378. grep IS_64BIT_ARCH >/dev/null
  1379. then
  1380. case $UNAME_PROCESSOR in
  1381. i386) UNAME_PROCESSOR=x86_64 ;;
  1382. powerpc) UNAME_PROCESSOR=powerpc64 ;;
  1383. esac
  1384. fi
  1385. # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
  1386. if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
  1387. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1388. grep IS_PPC >/dev/null
  1389. then
  1390. UNAME_PROCESSOR=powerpc
  1391. fi
  1392. elif test "$UNAME_PROCESSOR" = i386 ; then
  1393. # uname -m returns i386 or x86_64
  1394. UNAME_PROCESSOR=$UNAME_MACHINE
  1395. fi
  1396. GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
  1397. ;;
  1398. *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1399. UNAME_PROCESSOR=`uname -p`
  1400. if test "$UNAME_PROCESSOR" = x86; then
  1401. UNAME_PROCESSOR=i386
  1402. UNAME_MACHINE=pc
  1403. fi
  1404. GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
  1405. ;;
  1406. *:QNX:*:4*)
  1407. GUESS=i386-pc-qnx
  1408. ;;
  1409. NEO-*:NONSTOP_KERNEL:*:*)
  1410. GUESS=neo-tandem-nsk$UNAME_RELEASE
  1411. ;;
  1412. NSE-*:NONSTOP_KERNEL:*:*)
  1413. GUESS=nse-tandem-nsk$UNAME_RELEASE
  1414. ;;
  1415. NSR-*:NONSTOP_KERNEL:*:*)
  1416. GUESS=nsr-tandem-nsk$UNAME_RELEASE
  1417. ;;
  1418. NSV-*:NONSTOP_KERNEL:*:*)
  1419. GUESS=nsv-tandem-nsk$UNAME_RELEASE
  1420. ;;
  1421. NSX-*:NONSTOP_KERNEL:*:*)
  1422. GUESS=nsx-tandem-nsk$UNAME_RELEASE
  1423. ;;
  1424. *:NonStop-UX:*:*)
  1425. GUESS=mips-compaq-nonstopux
  1426. ;;
  1427. BS2000:POSIX*:*:*)
  1428. GUESS=bs2000-siemens-sysv
  1429. ;;
  1430. DS/*:UNIX_System_V:*:*)
  1431. GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
  1432. ;;
  1433. *:Plan9:*:*)
  1434. # "uname -m" is not consistent, so use $cputype instead. 386
  1435. # is converted to i386 for consistency with other x86
  1436. # operating systems.
  1437. if test "${cputype-}" = 386; then
  1438. UNAME_MACHINE=i386
  1439. elif test "x${cputype-}" != x; then
  1440. UNAME_MACHINE=$cputype
  1441. fi
  1442. GUESS=$UNAME_MACHINE-unknown-plan9
  1443. ;;
  1444. *:TOPS-10:*:*)
  1445. GUESS=pdp10-unknown-tops10
  1446. ;;
  1447. *:TENEX:*:*)
  1448. GUESS=pdp10-unknown-tenex
  1449. ;;
  1450. KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
  1451. GUESS=pdp10-dec-tops20
  1452. ;;
  1453. XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
  1454. GUESS=pdp10-xkl-tops20
  1455. ;;
  1456. *:TOPS-20:*:*)
  1457. GUESS=pdp10-unknown-tops20
  1458. ;;
  1459. *:ITS:*:*)
  1460. GUESS=pdp10-unknown-its
  1461. ;;
  1462. SEI:*:*:SEIUX)
  1463. GUESS=mips-sei-seiux$UNAME_RELEASE
  1464. ;;
  1465. *:DragonFly:*:*)
  1466. DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  1467. GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
  1468. ;;
  1469. *:*VMS:*:*)
  1470. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1471. case $UNAME_MACHINE in
  1472. A*) GUESS=alpha-dec-vms ;;
  1473. I*) GUESS=ia64-dec-vms ;;
  1474. V*) GUESS=vax-dec-vms ;;
  1475. esac ;;
  1476. *:XENIX:*:SysV)
  1477. GUESS=i386-pc-xenix
  1478. ;;
  1479. i*86:skyos:*:*)
  1480. SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
  1481. GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
  1482. ;;
  1483. i*86:rdos:*:*)
  1484. GUESS=$UNAME_MACHINE-pc-rdos
  1485. ;;
  1486. *:AROS:*:*)
  1487. GUESS=$UNAME_MACHINE-unknown-aros
  1488. ;;
  1489. x86_64:VMkernel:*:*)
  1490. GUESS=$UNAME_MACHINE-unknown-esx
  1491. ;;
  1492. amd64:Isilon\ OneFS:*:*)
  1493. GUESS=x86_64-unknown-onefs
  1494. ;;
  1495. *:Unleashed:*:*)
  1496. GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
  1497. ;;
  1498. esac
  1499. # Do we have a guess based on uname results?
  1500. if test "x$GUESS" != x; then
  1501. echo "$GUESS"
  1502. exit
  1503. fi
  1504. # No uname command or uname output not recognized.
  1505. set_cc_for_build
  1506. cat > "$dummy.c" <<EOF
  1507. #ifdef _SEQUENT_
  1508. #include <sys/types.h>
  1509. #include <sys/utsname.h>
  1510. #endif
  1511. #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
  1512. #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
  1513. #include <signal.h>
  1514. #if defined(_SIZE_T_) || defined(SIGLOST)
  1515. #include <sys/utsname.h>
  1516. #endif
  1517. #endif
  1518. #endif
  1519. main ()
  1520. {
  1521. #if defined (sony)
  1522. #if defined (MIPSEB)
  1523. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1524. I don't know.... */
  1525. printf ("mips-sony-bsd\n"); exit (0);
  1526. #else
  1527. #include <sys/param.h>
  1528. printf ("m68k-sony-newsos%s\n",
  1529. #ifdef NEWSOS4
  1530. "4"
  1531. #else
  1532. ""
  1533. #endif
  1534. ); exit (0);
  1535. #endif
  1536. #endif
  1537. #if defined (NeXT)
  1538. #if !defined (__ARCHITECTURE__)
  1539. #define __ARCHITECTURE__ "m68k"
  1540. #endif
  1541. int version;
  1542. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1543. if (version < 4)
  1544. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1545. else
  1546. printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1547. exit (0);
  1548. #endif
  1549. #if defined (MULTIMAX) || defined (n16)
  1550. #if defined (UMAXV)
  1551. printf ("ns32k-encore-sysv\n"); exit (0);
  1552. #else
  1553. #if defined (CMU)
  1554. printf ("ns32k-encore-mach\n"); exit (0);
  1555. #else
  1556. printf ("ns32k-encore-bsd\n"); exit (0);
  1557. #endif
  1558. #endif
  1559. #endif
  1560. #if defined (__386BSD__)
  1561. printf ("i386-pc-bsd\n"); exit (0);
  1562. #endif
  1563. #if defined (sequent)
  1564. #if defined (i386)
  1565. printf ("i386-sequent-dynix\n"); exit (0);
  1566. #endif
  1567. #if defined (ns32000)
  1568. printf ("ns32k-sequent-dynix\n"); exit (0);
  1569. #endif
  1570. #endif
  1571. #if defined (_SEQUENT_)
  1572. struct utsname un;
  1573. uname(&un);
  1574. if (strncmp(un.version, "V2", 2) == 0) {
  1575. printf ("i386-sequent-ptx2\n"); exit (0);
  1576. }
  1577. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1578. printf ("i386-sequent-ptx1\n"); exit (0);
  1579. }
  1580. printf ("i386-sequent-ptx\n"); exit (0);
  1581. #endif
  1582. #if defined (vax)
  1583. #if !defined (ultrix)
  1584. #include <sys/param.h>
  1585. #if defined (BSD)
  1586. #if BSD == 43
  1587. printf ("vax-dec-bsd4.3\n"); exit (0);
  1588. #else
  1589. #if BSD == 199006
  1590. printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1591. #else
  1592. printf ("vax-dec-bsd\n"); exit (0);
  1593. #endif
  1594. #endif
  1595. #else
  1596. printf ("vax-dec-bsd\n"); exit (0);
  1597. #endif
  1598. #else
  1599. #if defined(_SIZE_T_) || defined(SIGLOST)
  1600. struct utsname un;
  1601. uname (&un);
  1602. printf ("vax-dec-ultrix%s\n", un.release); exit (0);
  1603. #else
  1604. printf ("vax-dec-ultrix\n"); exit (0);
  1605. #endif
  1606. #endif
  1607. #endif
  1608. #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
  1609. #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
  1610. #if defined(_SIZE_T_) || defined(SIGLOST)
  1611. struct utsname *un;
  1612. uname (&un);
  1613. printf ("mips-dec-ultrix%s\n", un.release); exit (0);
  1614. #else
  1615. printf ("mips-dec-ultrix\n"); exit (0);
  1616. #endif
  1617. #endif
  1618. #endif
  1619. #if defined (alliant) && defined (i860)
  1620. printf ("i860-alliant-bsd\n"); exit (0);
  1621. #endif
  1622. exit (1);
  1623. }
  1624. EOF
  1625. $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
  1626. { echo "$SYSTEM_NAME"; exit; }
  1627. # Apollos put the system type in the environment.
  1628. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
  1629. echo "$0: unable to guess system type" >&2
  1630. case $UNAME_MACHINE:$UNAME_SYSTEM in
  1631. mips:Linux | mips64:Linux)
  1632. # If we got here on MIPS GNU/Linux, output extra information.
  1633. cat >&2 <<EOF
  1634. NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
  1635. the system type. Please install a C compiler and try again.
  1636. EOF
  1637. ;;
  1638. esac
  1639. cat >&2 <<EOF
  1640. This script (version $timestamp), has failed to recognize the
  1641. operating system you are using. If your script is old, overwrite *all*
  1642. copies of config.guess and config.sub with the latest versions from:
  1643. https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
  1644. and
  1645. https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
  1646. EOF
  1647. our_year=`echo $timestamp | sed 's,-.*,,'`
  1648. thisyear=`date +%Y`
  1649. # shellcheck disable=SC2003
  1650. script_age=`expr "$thisyear" - "$our_year"`
  1651. if test "$script_age" -lt 3 ; then
  1652. cat >&2 <<EOF
  1653. If $0 has already been updated, send the following data and any
  1654. information you think might be pertinent to config-patches@gnu.org to
  1655. provide the necessary information to handle your system.
  1656. config.guess timestamp = $timestamp
  1657. uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1658. uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1659. uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1660. uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1661. /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1662. /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1663. hostinfo = `(hostinfo) 2>/dev/null`
  1664. /bin/universe = `(/bin/universe) 2>/dev/null`
  1665. /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1666. /bin/arch = `(/bin/arch) 2>/dev/null`
  1667. /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1668. /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1669. UNAME_MACHINE = "$UNAME_MACHINE"
  1670. UNAME_RELEASE = "$UNAME_RELEASE"
  1671. UNAME_SYSTEM = "$UNAME_SYSTEM"
  1672. UNAME_VERSION = "$UNAME_VERSION"
  1673. EOF
  1674. fi
  1675. exit 1
  1676. # Local variables:
  1677. # eval: (add-hook 'before-save-hook 'time-stamp)
  1678. # time-stamp-start: "timestamp='"
  1679. # time-stamp-format: "%:y-%02m-%02d"
  1680. # time-stamp-end: "'"
  1681. # End: