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.

1270 lines
34 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
  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-05-30'
  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-cbm ;;
  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-cbm-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*:Windows_NT*:* | Pentium*:Windows_NT*:*)
  651. # How do we know it's Interix rather than the generic POSIX subsystem?
  652. # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
  653. # UNAME_MACHINE based on the output of uname instead of i386?
  654. echo i386-pc-interix
  655. exit 0 ;;
  656. i*:UWIN*:*)
  657. echo ${UNAME_MACHINE}-pc-uwin
  658. exit 0 ;;
  659. p*:CYGWIN*:*)
  660. echo powerpcle-unknown-cygwin
  661. exit 0 ;;
  662. prep*:SunOS:5.*:*)
  663. echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  664. exit 0 ;;
  665. *:GNU:*:*)
  666. echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  667. exit 0 ;;
  668. *:Linux:*:*)
  669. # The BFD linker knows what the default object file format is, so
  670. # first see if it will tell us. cd to the root directory to prevent
  671. # problems with other programs or directories called `ld' in the path.
  672. ld_help_string=`cd /; ld --help 2>&1`
  673. ld_supported_emulations=`echo $ld_help_string \
  674. | sed -ne '/supported emulations:/!d
  675. s/[ ][ ]*/ /g
  676. s/.*supported emulations: *//
  677. s/ .*//
  678. p'`
  679. case "$ld_supported_emulations" in
  680. *ia64)
  681. echo "${UNAME_MACHINE}-unknown-linux"
  682. exit 0
  683. ;;
  684. i?86linux)
  685. echo "${UNAME_MACHINE}-pc-linux-gnuaout"
  686. exit 0
  687. ;;
  688. elf_i?86)
  689. echo "${UNAME_MACHINE}-pc-linux"
  690. exit 0
  691. ;;
  692. i?86coff)
  693. echo "${UNAME_MACHINE}-pc-linux-gnucoff"
  694. exit 0
  695. ;;
  696. sparclinux)
  697. echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
  698. exit 0
  699. ;;
  700. armlinux)
  701. echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
  702. exit 0
  703. ;;
  704. elf32arm*)
  705. echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
  706. exit 0
  707. ;;
  708. armelf_linux*)
  709. echo "${UNAME_MACHINE}-unknown-linux-gnu"
  710. exit 0
  711. ;;
  712. m68klinux)
  713. echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
  714. exit 0
  715. ;;
  716. elf32ppc | elf32ppclinux)
  717. # Determine Lib Version
  718. cat >$dummy.c <<EOF
  719. #include <features.h>
  720. #if defined(__GLIBC__)
  721. extern char __libc_version[];
  722. extern char __libc_release[];
  723. #endif
  724. main(argc, argv)
  725. int argc;
  726. char *argv[];
  727. {
  728. #if defined(__GLIBC__)
  729. printf("%s %s\n", __libc_version, __libc_release);
  730. #else
  731. printf("unkown\n");
  732. #endif
  733. return 0;
  734. }
  735. EOF
  736. LIBC=""
  737. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
  738. if test "$?" = 0 ; then
  739. ./$dummy | grep 1\.99 > /dev/null
  740. if test "$?" = 0 ; then
  741. LIBC="libc1"
  742. fi
  743. fi
  744. rm -f $dummy.c $dummy
  745. echo powerpc-unknown-linux-gnu${LIBC}
  746. exit 0
  747. ;;
  748. shelf_linux)
  749. echo "${UNAME_MACHINE}-unknown-linux-gnu"
  750. exit 0
  751. ;;
  752. esac
  753. if test "${UNAME_MACHINE}" = "alpha" ; then
  754. cat <<EOF >$dummy.s
  755. .data
  756. \$Lformat:
  757. .byte 37,100,45,37,120,10,0 # "%d-%x\n"
  758. .text
  759. .globl main
  760. .align 4
  761. .ent main
  762. main:
  763. .frame \$30,16,\$26,0
  764. ldgp \$29,0(\$27)
  765. .prologue 1
  766. .long 0x47e03d80 # implver \$0
  767. lda \$2,-1
  768. .long 0x47e20c21 # amask \$2,\$1
  769. lda \$16,\$Lformat
  770. mov \$0,\$17
  771. not \$1,\$18
  772. jsr \$26,printf
  773. ldgp \$29,0(\$26)
  774. mov 0,\$16
  775. jsr \$26,exit
  776. .end main
  777. EOF
  778. LIBC=""
  779. $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
  780. if test "$?" = 0 ; then
  781. case `./$dummy` in
  782. 0-0)
  783. UNAME_MACHINE="alpha"
  784. ;;
  785. 1-0)
  786. UNAME_MACHINE="alphaev5"
  787. ;;
  788. 1-1)
  789. UNAME_MACHINE="alphaev56"
  790. ;;
  791. 1-101)
  792. UNAME_MACHINE="alphapca56"
  793. ;;
  794. 2-303)
  795. UNAME_MACHINE="alphaev6"
  796. ;;
  797. 2-307)
  798. UNAME_MACHINE="alphaev67"
  799. ;;
  800. esac
  801. objdump --private-headers $dummy | \
  802. grep ld.so.1 > /dev/null
  803. if test "$?" = 0 ; then
  804. LIBC="libc1"
  805. fi
  806. fi
  807. rm -f $dummy.s $dummy
  808. echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
  809. elif test "${UNAME_MACHINE}" = "mips" ; then
  810. cat >$dummy.c <<EOF
  811. #ifdef __cplusplus
  812. #include <stdio.h> /* for printf() prototype */
  813. int main (int argc, char *argv[]) {
  814. #else
  815. int main (argc, argv) int argc; char *argv[]; {
  816. #endif
  817. #ifdef __MIPSEB__
  818. printf ("%s-unknown-linux-gnu\n", argv[1]);
  819. #endif
  820. #ifdef __MIPSEL__
  821. printf ("%sel-unknown-linux-gnu\n", argv[1]);
  822. #endif
  823. return 0;
  824. }
  825. EOF
  826. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
  827. rm -f $dummy.c $dummy
  828. elif test "${UNAME_MACHINE}" = "s390"; then
  829. echo s390-ibm-linux && exit 0
  830. else
  831. # Either a pre-BFD a.out linker (linux-gnuoldld)
  832. # or one that does not give us useful --help.
  833. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
  834. # If ld does not provide *any* "supported emulations:"
  835. # that means it is gnuoldld.
  836. echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
  837. test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
  838. case "${UNAME_MACHINE}" in
  839. i?86)
  840. VENDOR=pc;
  841. ;;
  842. *)
  843. VENDOR=unknown;
  844. ;;
  845. esac
  846. # Determine whether the default compiler is a.out or elf
  847. cat >$dummy.c <<EOF
  848. #include <features.h>
  849. #ifdef __cplusplus
  850. #include <stdio.h> /* for printf() prototype */
  851. int main (int argc, char *argv[]) {
  852. #else
  853. int main (argc, argv) int argc; char *argv[]; {
  854. #endif
  855. #ifdef __ELF__
  856. # ifdef __GLIBC__
  857. # if __GLIBC__ >= 2
  858. printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
  859. # else
  860. printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
  861. # endif
  862. # else
  863. printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
  864. # endif
  865. #else
  866. printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
  867. #endif
  868. return 0;
  869. }
  870. EOF
  871. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
  872. rm -f $dummy.c $dummy
  873. fi ;;
  874. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
  875. # are messed up and put the nodename in both sysname and nodename.
  876. i?86:DYNIX/ptx:4*:*)
  877. echo i386-sequent-sysv4
  878. exit 0 ;;
  879. i?86:UNIX_SV:4.2MP:2.*)
  880. # Unixware is an offshoot of SVR4, but it has its own version
  881. # number series starting with 2...
  882. # I am not positive that other SVR4 systems won't match this,
  883. # I just have to hope. -- rms.
  884. # Use sysv4.2uw... so that sysv4* matches it.
  885. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  886. exit 0 ;;
  887. i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
  888. UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
  889. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  890. echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
  891. else
  892. echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  893. fi
  894. exit 0 ;;
  895. i?86:*:5:7*)
  896. # Fixed at (any) Pentium or better
  897. UNAME_MACHINE=i586
  898. if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
  899. echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
  900. else
  901. echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
  902. fi
  903. exit 0 ;;
  904. i?86:*:3.2:*)
  905. if test -f /usr/options/cb.name; then
  906. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  907. echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
  908. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  909. UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  910. (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  911. (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
  912. && UNAME_MACHINE=i586
  913. (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
  914. && UNAME_MACHINE=i686
  915. (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
  916. && UNAME_MACHINE=i686
  917. echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
  918. else
  919. echo ${UNAME_MACHINE}-pc-sysv32
  920. fi
  921. exit 0 ;;
  922. i?86:*DOS:*:*)
  923. echo ${UNAME_MACHINE}-pc-msdosdjgpp
  924. exit 0 ;;
  925. pc:*:*:*)
  926. # Left here for compatibility:
  927. # uname -m prints for DJGPP always 'pc', but it prints nothing about
  928. # the processor, so we play safe by assuming i386.
  929. echo i386-pc-msdosdjgpp
  930. exit 0 ;;
  931. Intel:Mach:3*:*)
  932. echo i386-pc-mach3
  933. exit 0 ;;
  934. paragon:*:*:*)
  935. echo i860-intel-osf1
  936. exit 0 ;;
  937. i860:*:4.*:*) # i860-SVR4
  938. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  939. echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
  940. else # Add other i860-SVR4 vendors below as they are discovered.
  941. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
  942. fi
  943. exit 0 ;;
  944. mini*:CTIX:SYS*5:*)
  945. # "miniframe"
  946. echo m68010-convergent-sysv
  947. exit 0 ;;
  948. M68*:*:R3V[567]*:*)
  949. test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  950. 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
  951. OS_REL=''
  952. test -r /etc/.relid \
  953. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  954. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  955. && echo i486-ncr-sysv4.3${OS_REL} && exit 0
  956. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  957. && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
  958. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  959. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  960. && echo i486-ncr-sysv4 && exit 0 ;;
  961. m68*:LynxOS:2.*:*)
  962. echo m68k-unknown-lynxos${UNAME_RELEASE}
  963. exit 0 ;;
  964. mc68030:UNIX_System_V:4.*:*)
  965. echo m68k-atari-sysv4
  966. exit 0 ;;
  967. i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
  968. echo i386-unknown-lynxos${UNAME_RELEASE}
  969. exit 0 ;;
  970. TSUNAMI:LynxOS:2.*:*)
  971. echo sparc-unknown-lynxos${UNAME_RELEASE}
  972. exit 0 ;;
  973. rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
  974. echo rs6000-unknown-lynxos${UNAME_RELEASE}
  975. exit 0 ;;
  976. SM[BE]S:UNIX_SV:*:*)
  977. echo mips-dde-sysv${UNAME_RELEASE}
  978. exit 0 ;;
  979. RM*:ReliantUNIX-*:*:*)
  980. echo mips-sni-sysv4
  981. exit 0 ;;
  982. RM*:SINIX-*:*:*)
  983. echo mips-sni-sysv4
  984. exit 0 ;;
  985. *:SINIX-*:*:*)
  986. if uname -p 2>/dev/null >/dev/null ; then
  987. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  988. echo ${UNAME_MACHINE}-sni-sysv4
  989. else
  990. echo ns32k-sni-sysv
  991. fi
  992. exit 0 ;;
  993. PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  994. # says <Richard.M.Bartel@ccMail.Census.GOV>
  995. echo i586-unisys-sysv4
  996. exit 0 ;;
  997. *:UNIX_System_V:4*:FTX*)
  998. # From Gerald Hewes <hewes@openmarket.com>.
  999. # How about differentiating between stratus architectures? -djm
  1000. echo hppa1.1-stratus-sysv4
  1001. exit 0 ;;
  1002. *:*:*:FTX*)
  1003. # From seanf@swdc.stratus.com.
  1004. echo i860-stratus-sysv4
  1005. exit 0 ;;
  1006. mc68*:A/UX:*:*)
  1007. echo m68k-apple-aux${UNAME_RELEASE}
  1008. exit 0 ;;
  1009. news*:NEWS-OS:*:6*)
  1010. echo mips-sony-newsos6
  1011. exit 0 ;;
  1012. R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1013. if [ -d /usr/nec ]; then
  1014. echo mips-nec-sysv${UNAME_RELEASE}
  1015. else
  1016. echo mips-unknown-sysv${UNAME_RELEASE}
  1017. fi
  1018. exit 0 ;;
  1019. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1020. echo powerpc-be-beos
  1021. exit 0 ;;
  1022. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1023. echo powerpc-apple-beos
  1024. exit 0 ;;
  1025. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1026. echo i586-pc-beos
  1027. exit 0 ;;
  1028. SX-4:SUPER-UX:*:*)
  1029. echo sx4-nec-superux${UNAME_RELEASE}
  1030. exit 0 ;;
  1031. SX-5:SUPER-UX:*:*)
  1032. echo sx5-nec-superux${UNAME_RELEASE}
  1033. exit 0 ;;
  1034. Power*:Rhapsody:*:*)
  1035. echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1036. exit 0 ;;
  1037. *:Rhapsody:*:*)
  1038. echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1039. exit 0 ;;
  1040. *:Darwin:*:*)
  1041. echo `uname -p`-apple-darwin${UNAME_RELEASE}
  1042. exit 0 ;;
  1043. *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1044. if test "${UNAME_MACHINE}" = "x86pc"; then
  1045. UNAME_MACHINE=pc
  1046. fi
  1047. echo `uname -p`-${UNAME_MACHINE}-nto-qnx
  1048. exit 0 ;;
  1049. *:QNX:*:4*)
  1050. echo i386-pc-qnx
  1051. exit 0 ;;
  1052. NSR-W:NONSTOP_KERNEL:*:*)
  1053. echo nsr-tandem-nsk${UNAME_RELEASE}
  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. esac
  1062. #echo '(No uname command or uname output not recognized.)' 1>&2
  1063. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1064. cat >$dummy.c <<EOF
  1065. #ifdef _SEQUENT_
  1066. # include <sys/types.h>
  1067. # include <sys/utsname.h>
  1068. #endif
  1069. main ()
  1070. {
  1071. #if defined (sony)
  1072. #if defined (MIPSEB)
  1073. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1074. I don't know.... */
  1075. printf ("mips-sony-bsd\n"); exit (0);
  1076. #else
  1077. #include <sys/param.h>
  1078. printf ("m68k-sony-newsos%s\n",
  1079. #ifdef NEWSOS4
  1080. "4"
  1081. #else
  1082. ""
  1083. #endif
  1084. ); exit (0);
  1085. #endif
  1086. #endif
  1087. #if defined (__arm) && defined (__acorn) && defined (__unix)
  1088. printf ("arm-acorn-riscix"); exit (0);
  1089. #endif
  1090. #if defined (hp300) && !defined (hpux)
  1091. printf ("m68k-hp-bsd\n"); exit (0);
  1092. #endif
  1093. #if defined (NeXT)
  1094. #if !defined (__ARCHITECTURE__)
  1095. #define __ARCHITECTURE__ "m68k"
  1096. #endif
  1097. int version;
  1098. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1099. if (version < 4)
  1100. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1101. else
  1102. printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1103. exit (0);
  1104. #endif
  1105. #if defined (MULTIMAX) || defined (n16)
  1106. #if defined (UMAXV)
  1107. printf ("ns32k-encore-sysv\n"); exit (0);
  1108. #else
  1109. #if defined (CMU)
  1110. printf ("ns32k-encore-mach\n"); exit (0);
  1111. #else
  1112. printf ("ns32k-encore-bsd\n"); exit (0);
  1113. #endif
  1114. #endif
  1115. #endif
  1116. #if defined (__386BSD__)
  1117. printf ("i386-pc-bsd\n"); exit (0);
  1118. #endif
  1119. #if defined (sequent)
  1120. #if defined (i386)
  1121. printf ("i386-sequent-dynix\n"); exit (0);
  1122. #endif
  1123. #if defined (ns32000)
  1124. printf ("ns32k-sequent-dynix\n"); exit (0);
  1125. #endif
  1126. #endif
  1127. #if defined (_SEQUENT_)
  1128. struct utsname un;
  1129. uname(&un);
  1130. if (strncmp(un.version, "V2", 2) == 0) {
  1131. printf ("i386-sequent-ptx2\n"); exit (0);
  1132. }
  1133. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1134. printf ("i386-sequent-ptx1\n"); exit (0);
  1135. }
  1136. printf ("i386-sequent-ptx\n"); exit (0);
  1137. #endif
  1138. #if defined (vax)
  1139. #if !defined (ultrix)
  1140. printf ("vax-dec-bsd\n"); exit (0);
  1141. #else
  1142. printf ("vax-dec-ultrix\n"); exit (0);
  1143. #endif
  1144. #endif
  1145. #if defined (alliant) && defined (i860)
  1146. printf ("i860-alliant-bsd\n"); exit (0);
  1147. #endif
  1148. exit (1);
  1149. }
  1150. EOF
  1151. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
  1152. rm -f $dummy.c $dummy
  1153. # Apollos put the system type in the environment.
  1154. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  1155. # Convex versions that predate uname can use getsysinfo(1)
  1156. if [ -x /usr/convex/getsysinfo ]
  1157. then
  1158. case `getsysinfo -f cpu_type` in
  1159. c1*)
  1160. echo c1-convex-bsd
  1161. exit 0 ;;
  1162. c2*)
  1163. if getsysinfo -f scalar_acc
  1164. then echo c32-convex-bsd
  1165. else echo c2-convex-bsd
  1166. fi
  1167. exit 0 ;;
  1168. c34*)
  1169. echo c34-convex-bsd
  1170. exit 0 ;;
  1171. c38*)
  1172. echo c38-convex-bsd
  1173. exit 0 ;;
  1174. c4*)
  1175. echo c4-convex-bsd
  1176. exit 0 ;;
  1177. esac
  1178. fi
  1179. cat >&2 <<EOF
  1180. $0: unable to guess system type
  1181. The $version version of this script cannot recognize your system type.
  1182. Please download the most up to date version of the config scripts:
  1183. ftp://ftp.gnu.org/pub/gnu/config/
  1184. If the version you run ($0) is already up to date, please
  1185. send the following data and any information you think might be
  1186. pertinent to <config-patches@gnu.org> in order to provide the needed
  1187. information to handle your system.
  1188. config.guess version = $version
  1189. uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1190. uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1191. uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1192. uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1193. /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1194. /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1195. hostinfo = `(hostinfo) 2>/dev/null`
  1196. /bin/universe = `(/bin/universe) 2>/dev/null`
  1197. /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1198. /bin/arch = `(/bin/arch) 2>/dev/null`
  1199. /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1200. /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1201. UNAME_MACHINE = ${UNAME_MACHINE}
  1202. UNAME_RELEASE = ${UNAME_RELEASE}
  1203. UNAME_SYSTEM = ${UNAME_SYSTEM}
  1204. UNAME_VERSION = ${UNAME_VERSION}
  1205. EOF
  1206. exit 1
  1207. # Local variables:
  1208. # eval: (add-hook 'write-file-hooks 'time-stamp)
  1209. # time-stamp-start: "version='"
  1210. # time-stamp-format: "%:y-%02m-%02d"
  1211. # time-stamp-end: "'"
  1212. # End: