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.

1325 lines
38 KiB

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