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.

1645 lines
47 KiB

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