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.

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