config.guess 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. #! /bin/sh
  2. # Attempt to guess a canonical system name.
  3. # Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
  4. #
  5. # This file is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. #
  19. # As a special exception to the GNU General Public License, if you
  20. # distribute this file as part of a program that contains a
  21. # configuration script generated by Autoconf, you may include it under
  22. # the same distribution terms that you use for the rest of that program.
  23. # Written by Per Bothner <bothner@cygnus.com>.
  24. # The master version of this file is at the FSF in /home/gd/gnu/lib.
  25. #
  26. # This script attempts to guess a canonical system name similar to
  27. # config.sub. If it succeeds, it prints the system name on stdout, and
  28. # exits with 0. Otherwise, it exits with 1.
  29. #
  30. # The plan is that this can be called by configure scripts if you
  31. # don't specify an explicit system type (host/target name).
  32. #
  33. # Only a few systems have been added to this list; please add others
  34. # (but try to keep the structure clean).
  35. #
  36. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  37. # (ghazi@noc.rutgers.edu 8/24/94.)
  38. if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  39. PATH=$PATH:/.attbin ; export PATH
  40. fi
  41. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  42. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  43. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  44. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  45. trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
  46. # Note: order is significant - the case branches are not exclusive.
  47. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  48. alpha:OSF1:*:*)
  49. # A Vn.n version is a released version.
  50. # A Tn.n version is a released field test version.
  51. # A Xn.n version is an unreleased experimental baselevel.
  52. # 1.2 uses "1.2" for uname -r.
  53. echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
  54. exit 0 ;;
  55. 21064:Windows_NT:50:3)
  56. echo alpha-dec-winnt3.5
  57. exit 0 ;;
  58. Amiga*:UNIX_System_V:4.0:*)
  59. echo m68k-cbm-sysv4
  60. exit 0;;
  61. amiga:NetBSD:*:*)
  62. echo m68k-cbm-netbsd${UNAME_RELEASE}
  63. exit 0 ;;
  64. amiga:OpenBSD:*:*)
  65. echo m68k-cbm-openbsd${UNAME_RELEASE}
  66. exit 0 ;;
  67. arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  68. echo arm-acorn-riscix${UNAME_RELEASE}
  69. exit 0;;
  70. Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
  71. # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  72. if test "`(/bin/universe) 2>/dev/null`" = att ; then
  73. echo pyramid-pyramid-sysv3
  74. else
  75. echo pyramid-pyramid-bsd
  76. fi
  77. exit 0 ;;
  78. NILE:*:*:dcosx)
  79. echo pyramid-pyramid-svr4
  80. exit 0 ;;
  81. sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  82. echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  83. exit 0 ;;
  84. i86pc:SunOS:5.*:*)
  85. echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  86. exit 0 ;;
  87. sun4*:SunOS:6*:*)
  88. # According to config.sub, this is the proper way to canonicalize
  89. # SunOS6. Hard to guess exactly what SunOS6 will be like, but
  90. # it's likely to be more like Solaris than SunOS4.
  91. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  92. exit 0 ;;
  93. sun4*:SunOS:*:*)
  94. case "`/usr/bin/arch -k`" in
  95. Series*|S4*)
  96. UNAME_RELEASE=`uname -v`
  97. ;;
  98. esac
  99. # Japanese Language versions have a version number like `4.1.3-JL'.
  100. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  101. exit 0 ;;
  102. sun3*:SunOS:*:*)
  103. echo m68k-sun-sunos${UNAME_RELEASE}
  104. exit 0 ;;
  105. aushp:SunOS:*:*)
  106. echo sparc-auspex-sunos${UNAME_RELEASE}
  107. exit 0 ;;
  108. atari*:NetBSD:*:*)
  109. echo m68k-atari-netbsd${UNAME_RELEASE}
  110. exit 0 ;;
  111. atari*:OpenBSD:*:*)
  112. echo m68k-atari-openbsd${UNAME_RELEASE}
  113. exit 0 ;;
  114. sun3*:NetBSD:*:*)
  115. echo m68k-sun-netbsd${UNAME_RELEASE}
  116. exit 0 ;;
  117. sun3*:OpenBSD:*:*)
  118. echo m68k-sun-openbsd${UNAME_RELEASE}
  119. exit 0 ;;
  120. mac68k:NetBSD:*:*)
  121. echo m68k-apple-netbsd${UNAME_RELEASE}
  122. exit 0 ;;
  123. mac68k:OpenBSD:*:*)
  124. echo m68k-apple-openbsd${UNAME_RELEASE}
  125. exit 0 ;;
  126. powerpc:machten:*:*)
  127. echo powerpc-apple-machten${UNAME_RELEASE}
  128. exit 0 ;;
  129. RISC*:Mach:*:*)
  130. echo mips-dec-mach_bsd4.3
  131. exit 0 ;;
  132. RISC*:ULTRIX:*:*)
  133. echo mips-dec-ultrix${UNAME_RELEASE}
  134. exit 0 ;;
  135. VAX*:ULTRIX*:*:*)
  136. echo vax-dec-ultrix${UNAME_RELEASE}
  137. exit 0 ;;
  138. mips:*:*:UMIPS | mips:*:*:RISCos)
  139. sed 's/^ //' << EOF >dummy.c
  140. int main (argc, argv) int argc; char **argv; {
  141. #if defined (host_mips) && defined (MIPSEB)
  142. #if defined (SYSTYPE_SYSV)
  143. printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
  144. #endif
  145. #if defined (SYSTYPE_SVR4)
  146. printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
  147. #endif
  148. #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  149. printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
  150. #endif
  151. #endif
  152. exit (-1);
  153. }
  154. EOF
  155. ${CC-cc} dummy.c -o dummy \
  156. && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
  157. && rm dummy.c dummy && exit 0
  158. rm -f dummy.c dummy
  159. echo mips-mips-riscos${UNAME_RELEASE}
  160. exit 0 ;;
  161. Night_Hawk:Power_UNIX:*:*)
  162. echo powerpc-harris-powerunix
  163. exit 0 ;;
  164. m88k:CX/UX:7*:*)
  165. echo m88k-harris-cxux7
  166. exit 0 ;;
  167. m88k:*:4*:R4*)
  168. echo m88k-motorola-sysv4
  169. exit 0 ;;
  170. m88k:*:3*:R3*)
  171. echo m88k-motorola-sysv3
  172. exit 0 ;;
  173. AViiON:dgux:*:*)
  174. # DG/UX returns AViiON for all architectures
  175. UNAME_PROCESSOR=`/usr/bin/uname -p`
  176. if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
  177. if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
  178. -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
  179. echo m88k-dg-dgux${UNAME_RELEASE}
  180. else
  181. echo m88k-dg-dguxbcs${UNAME_RELEASE}
  182. fi
  183. else echo i586-dg-dgux${UNAME_RELEASE}
  184. fi
  185. exit 0 ;;
  186. M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  187. echo m88k-dolphin-sysv3
  188. exit 0 ;;
  189. M88*:*:R3*:*)
  190. # Delta 88k system running SVR3
  191. echo m88k-motorola-sysv3
  192. exit 0 ;;
  193. XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  194. echo m88k-tektronix-sysv3
  195. exit 0 ;;
  196. Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  197. echo m68k-tektronix-bsd
  198. exit 0 ;;
  199. *:IRIX*:*:*)
  200. echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  201. exit 0 ;;
  202. ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  203. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
  204. exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
  205. i?86:AIX:*:*)
  206. echo i386-ibm-aix
  207. exit 0 ;;
  208. *:AIX:2:3)
  209. if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  210. sed 's/^ //' << EOF >dummy.c
  211. #include <sys/systemcfg.h>
  212. main()
  213. {
  214. if (!__power_pc())
  215. exit(1);
  216. puts("powerpc-ibm-aix3.2.5");
  217. exit(0);
  218. }
  219. EOF
  220. ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
  221. rm -f dummy.c dummy
  222. echo rs6000-ibm-aix3.2.5
  223. elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  224. echo rs6000-ibm-aix3.2.4
  225. else
  226. echo rs6000-ibm-aix3.2
  227. fi
  228. exit 0 ;;
  229. *:AIX:*:4)
  230. if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
  231. IBM_ARCH=rs6000
  232. else
  233. IBM_ARCH=powerpc
  234. fi
  235. if [ -x /usr/bin/oslevel ] ; then
  236. IBM_REV=`/usr/bin/oslevel`
  237. else
  238. IBM_REV=4.${UNAME_RELEASE}
  239. fi
  240. echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  241. exit 0 ;;
  242. *:AIX:*:*)
  243. echo rs6000-ibm-aix
  244. exit 0 ;;
  245. ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  246. echo romp-ibm-bsd4.4
  247. exit 0 ;;
  248. ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
  249. echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
  250. exit 0 ;; # report: romp-ibm BSD 4.3
  251. *:BOSX:*:*)
  252. echo rs6000-bull-bosx
  253. exit 0 ;;
  254. DPX/2?00:B.O.S.:*:*)
  255. echo m68k-bull-sysv3
  256. exit 0 ;;
  257. 9000/[34]??:4.3bsd:1.*:*)
  258. echo m68k-hp-bsd
  259. exit 0 ;;
  260. hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  261. echo m68k-hp-bsd4.4
  262. exit 0 ;;
  263. 9000/[3478]??:HP-UX:*:*)
  264. case "${UNAME_MACHINE}" in
  265. 9000/31? ) HP_ARCH=m68000 ;;
  266. 9000/[34]?? ) HP_ARCH=m68k ;;
  267. 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
  268. 9000/8?? ) HP_ARCH=hppa1.0 ;;
  269. esac
  270. HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  271. echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  272. exit 0 ;;
  273. 3050*:HI-UX:*:*)
  274. sed 's/^ //' << EOF >dummy.c
  275. #include <unistd.h>
  276. int
  277. main ()
  278. {
  279. long cpu = sysconf (_SC_CPU_VERSION);
  280. /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  281. true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  282. results, however. */
  283. if (CPU_IS_PA_RISC (cpu))
  284. {
  285. switch (cpu)
  286. {
  287. case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  288. case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  289. case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  290. default: puts ("hppa-hitachi-hiuxwe2"); break;
  291. }
  292. }
  293. else if (CPU_IS_HP_MC68K (cpu))
  294. puts ("m68k-hitachi-hiuxwe2");
  295. else puts ("unknown-hitachi-hiuxwe2");
  296. exit (0);
  297. }
  298. EOF
  299. ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
  300. rm -f dummy.c dummy
  301. echo unknown-hitachi-hiuxwe2
  302. exit 0 ;;
  303. 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  304. echo hppa1.1-hp-bsd
  305. exit 0 ;;
  306. 9000/8??:4.3bsd:*:*)
  307. echo hppa1.0-hp-bsd
  308. exit 0 ;;
  309. hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  310. echo hppa1.1-hp-osf
  311. exit 0 ;;
  312. hp8??:OSF1:*:*)
  313. echo hppa1.0-hp-osf
  314. exit 0 ;;
  315. i?86:OSF1:*:*)
  316. if [ -x /usr/sbin/sysversion ] ; then
  317. echo ${UNAME_MACHINE}-unknown-osf1mk
  318. else
  319. echo ${UNAME_MACHINE}-unknown-osf1
  320. fi
  321. exit 0 ;;
  322. parisc*:Lites*:*:*)
  323. echo hppa1.1-hp-lites
  324. exit 0 ;;
  325. C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  326. echo c1-convex-bsd
  327. exit 0 ;;
  328. C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  329. if getsysinfo -f scalar_acc
  330. then echo c32-convex-bsd
  331. else echo c2-convex-bsd
  332. fi
  333. exit 0 ;;
  334. C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  335. echo c34-convex-bsd
  336. exit 0 ;;
  337. C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  338. echo c38-convex-bsd
  339. exit 0 ;;
  340. C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  341. echo c4-convex-bsd
  342. exit 0 ;;
  343. CRAY*X-MP:*:*:*)
  344. echo xmp-cray-unicos
  345. exit 0 ;;
  346. CRAY*Y-MP:*:*:*)
  347. echo ymp-cray-unicos${UNAME_RELEASE}
  348. exit 0 ;;
  349. CRAY*[A-Z]90:*:*:*)
  350. echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
  351. | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  352. -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
  353. exit 0 ;;
  354. CRAY*TS:*:*:*)
  355. echo t90-cray-unicos${UNAME_RELEASE}
  356. exit 0 ;;
  357. CRAY-2:*:*:*)
  358. echo cray2-cray-unicos
  359. exit 0 ;;
  360. F300:UNIX_System_V:*:*)
  361. FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
  362. FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
  363. echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  364. exit 0 ;;
  365. F301:UNIX_System_V:*:*)
  366. echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
  367. exit 0 ;;
  368. hp3[0-9][05]:NetBSD:*:*)
  369. echo m68k-hp-netbsd${UNAME_RELEASE}
  370. exit 0 ;;
  371. hp3[0-9][05]:OpenBSD:*:*)
  372. echo m68k-hp-openbsd${UNAME_RELEASE}
  373. exit 0 ;;
  374. i?86:BSD/386:*:* | *:BSD/OS:*:*)
  375. echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
  376. exit 0 ;;
  377. *:FreeBSD:*:*)
  378. echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  379. exit 0 ;;
  380. *:NetBSD:*:*)
  381. echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  382. exit 0 ;;
  383. *:OpenBSD:*:*)
  384. echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  385. exit 0 ;;
  386. i*:CYGWIN*:*)
  387. echo i386-pc-cygwin32
  388. exit 0 ;;
  389. p*:CYGWIN*:*)
  390. echo powerpcle-unknown-cygwin32
  391. exit 0 ;;
  392. prep*:SunOS:5.*:*)
  393. echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  394. exit 0 ;;
  395. *:GNU:*:*)
  396. echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  397. exit 0 ;;
  398. *:Linux:*:*)
  399. # The BFD linker knows what the default object file format is, so
  400. # first see if it will tell us.
  401. ld_help_string=`ld --help 2>&1`
  402. if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
  403. echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
  404. elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
  405. echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
  406. elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
  407. echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
  408. elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
  409. echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
  410. elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
  411. echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
  412. elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
  413. echo "powerpc-unknown-linux-gnu" ; exit 0
  414. elif test "${UNAME_MACHINE}" = "alpha" ; then
  415. echo alpha-unknown-linux-gnu ; exit 0
  416. elif test "${UNAME_MACHINE}" = "sparc" ; then
  417. echo sparc-unknown-linux-gnu ; exit 0
  418. else
  419. # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
  420. # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
  421. test ! -d /usr/lib/ldscripts/. \
  422. && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
  423. # Determine whether the default compiler is a.out or elf
  424. cat >dummy.c <<EOF
  425. main(argc, argv)
  426. int argc;
  427. char *argv[];
  428. {
  429. #ifdef __ELF__
  430. printf ("%s-pc-linux-gnu\n", argv[1]);
  431. #else
  432. printf ("%s-pc-linux-gnuaout\n", argv[1]);
  433. #endif
  434. return 0;
  435. }
  436. EOF
  437. ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
  438. rm -f dummy.c dummy
  439. fi ;;
  440. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
  441. # are messed up and put the nodename in both sysname and nodename.
  442. i?86:DYNIX/ptx:4*:*)
  443. echo i386-sequent-sysv4
  444. exit 0 ;;
  445. i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
  446. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  447. echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
  448. else
  449. echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
  450. fi
  451. exit 0 ;;
  452. i?86:*:3.2:*)
  453. if test -f /usr/options/cb.name; then
  454. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  455. echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
  456. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  457. UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  458. (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  459. (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
  460. && UNAME_MACHINE=i586
  461. echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
  462. else
  463. echo ${UNAME_MACHINE}-pc-sysv32
  464. fi
  465. exit 0 ;;
  466. Intel:Mach:3*:*)
  467. echo i386-pc-mach3
  468. exit 0 ;;
  469. paragon:*:*:*)
  470. echo i860-intel-osf1
  471. exit 0 ;;
  472. i860:*:4.*:*) # i860-SVR4
  473. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  474. echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
  475. else # Add other i860-SVR4 vendors below as they are discovered.
  476. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
  477. fi
  478. exit 0 ;;
  479. mini*:CTIX:SYS*5:*)
  480. # "miniframe"
  481. echo m68010-convergent-sysv
  482. exit 0 ;;
  483. M68*:*:R3V[567]*:*)
  484. test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  485. 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
  486. OS_REL=''
  487. test -r /etc/.relid \
  488. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  489. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  490. && echo i486-ncr-sysv4.3${OS_REL} && exit 0
  491. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  492. && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
  493. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  494. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  495. && echo i486-ncr-sysv4 && exit 0 ;;
  496. m68*:LynxOS:2.*:*)
  497. echo m68k-unknown-lynxos${UNAME_RELEASE}
  498. exit 0 ;;
  499. mc68030:UNIX_System_V:4.*:*)
  500. echo m68k-atari-sysv4
  501. exit 0 ;;
  502. i?86:LynxOS:2.*:*)
  503. echo i386-unknown-lynxos${UNAME_RELEASE}
  504. exit 0 ;;
  505. TSUNAMI:LynxOS:2.*:*)
  506. echo sparc-unknown-lynxos${UNAME_RELEASE}
  507. exit 0 ;;
  508. rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
  509. echo rs6000-unknown-lynxos${UNAME_RELEASE}
  510. exit 0 ;;
  511. SM[BE]S:UNIX_SV:*:*)
  512. echo mips-dde-sysv${UNAME_RELEASE}
  513. exit 0 ;;
  514. RM*:SINIX-*:*:*)
  515. echo mips-sni-sysv4
  516. exit 0 ;;
  517. *:SINIX-*:*:*)
  518. if uname -p 2>/dev/null >/dev/null ; then
  519. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  520. echo ${UNAME_MACHINE}-sni-sysv4
  521. else
  522. echo ns32k-sni-sysv
  523. fi
  524. exit 0 ;;
  525. *:UNIX_System_V:4*:FTX*)
  526. # From Gerald Hewes <hewes@openmarket.com>.
  527. # How about differentiating between stratus architectures? -djm
  528. echo hppa1.1-stratus-sysv4
  529. exit 0 ;;
  530. *:*:*:FTX*)
  531. # From seanf@swdc.stratus.com.
  532. echo i860-stratus-sysv4
  533. exit 0 ;;
  534. mc68*:A/UX:*:*)
  535. echo m68k-apple-aux${UNAME_RELEASE}
  536. exit 0 ;;
  537. R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
  538. if [ -d /usr/nec ]; then
  539. echo mips-nec-sysv${UNAME_RELEASE}
  540. else
  541. echo mips-unknown-sysv${UNAME_RELEASE}
  542. fi
  543. exit 0 ;;
  544. PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  545. # says <Richard.M.Bartel@ccMail.Census.GOV>
  546. echo i586-unisys-sysv4
  547. exit 0 ;;
  548. esac
  549. #echo '(No uname command or uname output not recognized.)' 1>&2
  550. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  551. cat >dummy.c <<EOF
  552. #ifdef _SEQUENT_
  553. # include <sys/types.h>
  554. # include <sys/utsname.h>
  555. #endif
  556. main ()
  557. {
  558. #if defined (sony)
  559. #if defined (MIPSEB)
  560. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  561. I don't know.... */
  562. printf ("mips-sony-bsd\n"); exit (0);
  563. #else
  564. #include <sys/param.h>
  565. printf ("m68k-sony-newsos%s\n",
  566. #ifdef NEWSOS4
  567. "4"
  568. #else
  569. ""
  570. #endif
  571. ); exit (0);
  572. #endif
  573. #endif
  574. #if defined (__arm) && defined (__acorn) && defined (__unix)
  575. printf ("arm-acorn-riscix"); exit (0);
  576. #endif
  577. #if defined (hp300) && !defined (hpux)
  578. printf ("m68k-hp-bsd\n"); exit (0);
  579. #endif
  580. #if defined (NeXT)
  581. #if !defined (__ARCHITECTURE__)
  582. #define __ARCHITECTURE__ "m68k"
  583. #endif
  584. int version;
  585. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  586. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  587. exit (0);
  588. #endif
  589. #if defined (MULTIMAX) || defined (n16)
  590. #if defined (UMAXV)
  591. printf ("ns32k-encore-sysv\n"); exit (0);
  592. #else
  593. #if defined (CMU)
  594. printf ("ns32k-encore-mach\n"); exit (0);
  595. #else
  596. printf ("ns32k-encore-bsd\n"); exit (0);
  597. #endif
  598. #endif
  599. #endif
  600. #if defined (__386BSD__)
  601. printf ("i386-pc-bsd\n"); exit (0);
  602. #endif
  603. #if defined (sequent)
  604. #if defined (i386)
  605. printf ("i386-sequent-dynix\n"); exit (0);
  606. #endif
  607. #if defined (ns32000)
  608. printf ("ns32k-sequent-dynix\n"); exit (0);
  609. #endif
  610. #endif
  611. #if defined (_SEQUENT_)
  612. struct utsname un;
  613. uname(&un);
  614. if (strncmp(un.version, "V2", 2) == 0) {
  615. printf ("i386-sequent-ptx2\n"); exit (0);
  616. }
  617. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  618. printf ("i386-sequent-ptx1\n"); exit (0);
  619. }
  620. printf ("i386-sequent-ptx\n"); exit (0);
  621. #endif
  622. #if defined (vax)
  623. #if !defined (ultrix)
  624. printf ("vax-dec-bsd\n"); exit (0);
  625. #else
  626. printf ("vax-dec-ultrix\n"); exit (0);
  627. #endif
  628. #endif
  629. #if defined (alliant) && defined (i860)
  630. printf ("i860-alliant-bsd\n"); exit (0);
  631. #endif
  632. exit (1);
  633. }
  634. EOF
  635. ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
  636. rm -f dummy.c dummy
  637. # Apollos put the system type in the environment.
  638. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  639. # Convex versions that predate uname can use getsysinfo(1)
  640. if [ -x /usr/convex/getsysinfo ]
  641. then
  642. case `getsysinfo -f cpu_type` in
  643. c1*)
  644. echo c1-convex-bsd
  645. exit 0 ;;
  646. c2*)
  647. if getsysinfo -f scalar_acc
  648. then echo c32-convex-bsd
  649. else echo c2-convex-bsd
  650. fi
  651. exit 0 ;;
  652. c34*)
  653. echo c34-convex-bsd
  654. exit 0 ;;
  655. c38*)
  656. echo c38-convex-bsd
  657. exit 0 ;;
  658. c4*)
  659. echo c4-convex-bsd
  660. exit 0 ;;
  661. esac
  662. fi
  663. #echo '(Unable to guess system type)' 1>&2
  664. exit 1