Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1498 lines
43KB

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