/tags/rel-0-1-1/FreeSpeech/vflow/config.guess

# · Shell · 1088 lines · 921 code · 17 blank · 150 comment · 81 complexity · ada7abfc2d718e00a3c08d82d2442f43 MD5 · raw file

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