Team Fortress 2 Source Code as on 22/4/2020
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.

1501 lines
44 KiB

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