configure.guess 26 KB

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