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.
 
 
 
 
 
 

1450 lines
43 KiB

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