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.

1415 lines
41 KiB

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