Portable build framework for OpenNTPD
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.

1454 lines
43 KiB

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