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.

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