Counter Strike : Global Offensive Source Code
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.

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