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.

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