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.

1420 lines
42 KiB

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