config.guess 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. #! /bin/sh
  2. # Attempt to guess a canonical system name.
  3. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
  4. # Free Software Foundation, Inc.
  5. timestamp='2001-10-05'
  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. # Originally written by Per Bothner <bothner@cygnus.com>.
  25. # Please send patches to <config-patches@gnu.org>. Submit a context
  26. # diff and a properly formatted ChangeLog entry.
  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 build system type.
  34. me=`echo "$0" | sed -e 's,.*/,,'`
  35. usage="\
  36. Usage: $0 [OPTION]
  37. Output the configuration name of the system \`$me' is run on.
  38. Operation modes:
  39. -h, --help print this help, then exit
  40. -t, --time-stamp print date of last modification, then exit
  41. -v, --version print version number, then exit
  42. Report bugs and patches to <config-patches@gnu.org>."
  43. version="\
  44. GNU config.guess ($timestamp)
  45. Originally written by Per Bothner.
  46. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
  47. Free Software Foundation, Inc.
  48. This is free software; see the source for copying conditions. There is NO
  49. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  50. help="
  51. Try \`$me --help' for more information."
  52. # Parse command line
  53. while test $# -gt 0 ; do
  54. case $1 in
  55. --time-stamp | --time* | -t )
  56. echo "$timestamp" ; exit 0 ;;
  57. --version | -v )
  58. echo "$version" ; exit 0 ;;
  59. --help | --h* | -h )
  60. echo "$usage"; exit 0 ;;
  61. -- ) # Stop option processing
  62. shift; break ;;
  63. - ) # Use stdin as input.
  64. break ;;
  65. -* )
  66. echo "$me: invalid option $1$help" >&2
  67. exit 1 ;;
  68. * )
  69. break ;;
  70. esac
  71. done
  72. if test $# != 0; then
  73. echo "$me: too many arguments$help" >&2
  74. exit 1
  75. fi
  76. dummy=dummy-$$
  77. trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
  78. # CC_FOR_BUILD -- compiler used by this script.
  79. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
  80. # use `HOST_CC' if defined, but it is deprecated.
  81. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
  82. ,,) echo "int dummy(){}" > $dummy.c ;
  83. for c in cc gcc c89 ; do
  84. ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
  85. if test $? = 0 ; then
  86. CC_FOR_BUILD="$c"; break ;
  87. fi ;
  88. done ;
  89. rm -f $dummy.c $dummy.o $dummy.rel ;
  90. if test x"$CC_FOR_BUILD" = x ; then
  91. CC_FOR_BUILD=no_compiler_found ;
  92. fi
  93. ;;
  94. ,,*) CC_FOR_BUILD=$CC ;;
  95. ,*,*) CC_FOR_BUILD=$HOST_CC ;;
  96. esac'
  97. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  98. # (ghazi@noc.rutgers.edu 1994-08-24)
  99. if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  100. PATH=$PATH:/.attbin ; export PATH
  101. fi
  102. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  103. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  104. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  105. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  106. # Note: order is significant - the case branches are not exclusive.
  107. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  108. *:NetBSD:*:*)
  109. # NetBSD (nbsd) targets should (where applicable) match one or
  110. # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
  111. # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
  112. # switched to ELF, *-*-netbsd* would select the old
  113. # object file format. This provides both forward
  114. # compatibility and a consistent mechanism for selecting the
  115. # object file format.
  116. # Determine the machine/vendor (is the vendor relevant).
  117. case "${UNAME_MACHINE}" in
  118. amiga) machine=m68k-unknown ;;
  119. arm32) machine=arm-unknown ;;
  120. atari*) machine=m68k-atari ;;
  121. sun3*) machine=m68k-sun ;;
  122. mac68k) machine=m68k-apple ;;
  123. macppc) machine=powerpc-apple ;;
  124. hp3[0-9][05]) machine=m68k-hp ;;
  125. ibmrt|romp-ibm) machine=romp-ibm ;;
  126. sparc*) machine=`uname -p`-unknown ;;
  127. *) machine=${UNAME_MACHINE}-unknown ;;
  128. esac
  129. # The Operating System including object format, if it has switched
  130. # to ELF recently, or will in the future.
  131. case "${UNAME_MACHINE}" in
  132. i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
  133. eval $set_cc_for_build
  134. if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  135. | grep __ELF__ >/dev/null
  136. then
  137. # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  138. # Return netbsd for either. FIX?
  139. os=netbsd
  140. else
  141. os=netbsdelf
  142. fi
  143. ;;
  144. *)
  145. os=netbsd
  146. ;;
  147. esac
  148. # The OS release
  149. release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  150. # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  151. # contains redundant information, the shorter form:
  152. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  153. echo "${machine}-${os}${release}"
  154. exit 0 ;;
  155. amiga:OpenBSD:*:*)
  156. echo m68k-unknown-openbsd${UNAME_RELEASE}
  157. exit 0 ;;
  158. arc:OpenBSD:*:*)
  159. echo mipsel-unknown-openbsd${UNAME_RELEASE}
  160. exit 0 ;;
  161. hp300:OpenBSD:*:*)
  162. echo m68k-unknown-openbsd${UNAME_RELEASE}
  163. exit 0 ;;
  164. mac68k:OpenBSD:*:*)
  165. echo m68k-unknown-openbsd${UNAME_RELEASE}
  166. exit 0 ;;
  167. macppc:OpenBSD:*:*)
  168. echo powerpc-unknown-openbsd${UNAME_RELEASE}
  169. exit 0 ;;
  170. mvme68k:OpenBSD:*:*)
  171. echo m68k-unknown-openbsd${UNAME_RELEASE}
  172. exit 0 ;;
  173. mvme88k:OpenBSD:*:*)
  174. echo m88k-unknown-openbsd${UNAME_RELEASE}
  175. exit 0 ;;
  176. mvmeppc:OpenBSD:*:*)
  177. echo powerpc-unknown-openbsd${UNAME_RELEASE}
  178. exit 0 ;;
  179. pmax:OpenBSD:*:*)
  180. echo mipsel-unknown-openbsd${UNAME_RELEASE}
  181. exit 0 ;;
  182. sgi:OpenBSD:*:*)
  183. echo mipseb-unknown-openbsd${UNAME_RELEASE}
  184. exit 0 ;;
  185. sun3:OpenBSD:*:*)
  186. echo m68k-unknown-openbsd${UNAME_RELEASE}
  187. exit 0 ;;
  188. wgrisc:OpenBSD:*:*)
  189. echo mipsel-unknown-openbsd${UNAME_RELEASE}
  190. exit 0 ;;
  191. *:OpenBSD:*:*)
  192. echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
  193. exit 0 ;;
  194. alpha:OSF1:*:*)
  195. if test $UNAME_RELEASE = "V4.0"; then
  196. UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  197. fi
  198. # A Vn.n version is a released version.
  199. # A Tn.n version is a released field test version.
  200. # A Xn.n version is an unreleased experimental baselevel.
  201. # 1.2 uses "1.2" for uname -r.
  202. cat <<EOF >$dummy.s
  203. .data
  204. \$Lformat:
  205. .byte 37,100,45,37,120,10,0 # "%d-%x\n"
  206. .text
  207. .globl main
  208. .align 4
  209. .ent main
  210. main:
  211. .frame \$30,16,\$26,0
  212. ldgp \$29,0(\$27)
  213. .prologue 1
  214. .long 0x47e03d80 # implver \$0
  215. lda \$2,-1
  216. .long 0x47e20c21 # amask \$2,\$1
  217. lda \$16,\$Lformat
  218. mov \$0,\$17
  219. not \$1,\$18
  220. jsr \$26,printf
  221. ldgp \$29,0(\$26)
  222. mov 0,\$16
  223. jsr \$26,exit
  224. .end main
  225. EOF
  226. eval $set_cc_for_build
  227. $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
  228. if test "$?" = 0 ; then
  229. case `./$dummy` in
  230. 0-0)
  231. UNAME_MACHINE="alpha"
  232. ;;
  233. 1-0)
  234. UNAME_MACHINE="alphaev5"
  235. ;;
  236. 1-1)
  237. UNAME_MACHINE="alphaev56"
  238. ;;
  239. 1-101)
  240. UNAME_MACHINE="alphapca56"
  241. ;;
  242. 2-303)
  243. UNAME_MACHINE="alphaev6"
  244. ;;
  245. 2-307)
  246. UNAME_MACHINE="alphaev67"
  247. ;;
  248. 2-1307)
  249. UNAME_MACHINE="alphaev68"
  250. ;;
  251. esac
  252. fi
  253. rm -f $dummy.s $dummy
  254. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  255. exit 0 ;;
  256. Alpha\ *:Windows_NT*:*)
  257. # How do we know it's Interix rather than the generic POSIX subsystem?
  258. # Should we change UNAME_MACHINE based on the output of uname instead
  259. # of the specific Alpha model?
  260. echo alpha-pc-interix
  261. exit 0 ;;
  262. 21064:Windows_NT:50:3)
  263. echo alpha-dec-winnt3.5
  264. exit 0 ;;
  265. Amiga*:UNIX_System_V:4.0:*)
  266. echo m68k-unknown-sysv4
  267. exit 0;;
  268. *:[Aa]miga[Oo][Ss]:*:*)
  269. echo ${UNAME_MACHINE}-unknown-amigaos
  270. exit 0 ;;
  271. *:OS/390:*:*)
  272. echo i370-ibm-openedition
  273. exit 0 ;;
  274. arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  275. echo arm-acorn-riscix${UNAME_RELEASE}
  276. exit 0;;
  277. SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
  278. echo hppa1.1-hitachi-hiuxmpp
  279. exit 0;;
  280. Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  281. # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  282. if test "`(/bin/universe) 2>/dev/null`" = att ; then
  283. echo pyramid-pyramid-sysv3
  284. else
  285. echo pyramid-pyramid-bsd
  286. fi
  287. exit 0 ;;
  288. NILE*:*:*:dcosx)
  289. echo pyramid-pyramid-svr4
  290. exit 0 ;;
  291. sun4H:SunOS:5.*:*)
  292. echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  293. exit 0 ;;
  294. sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  295. echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  296. exit 0 ;;
  297. i86pc:SunOS:5.*:*)
  298. echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  299. exit 0 ;;
  300. sun4*:SunOS:6*:*)
  301. # According to config.sub, this is the proper way to canonicalize
  302. # SunOS6. Hard to guess exactly what SunOS6 will be like, but
  303. # it's likely to be more like Solaris than SunOS4.
  304. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  305. exit 0 ;;
  306. sun4*:SunOS:*:*)
  307. case "`/usr/bin/arch -k`" in
  308. Series*|S4*)
  309. UNAME_RELEASE=`uname -v`
  310. ;;
  311. esac
  312. # Japanese Language versions have a version number like `4.1.3-JL'.
  313. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  314. exit 0 ;;
  315. sun3*:SunOS:*:*)
  316. echo m68k-sun-sunos${UNAME_RELEASE}
  317. exit 0 ;;
  318. sun*:*:4.2BSD:*)
  319. UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  320. test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
  321. case "`/bin/arch`" in
  322. sun3)
  323. echo m68k-sun-sunos${UNAME_RELEASE}
  324. ;;
  325. sun4)
  326. echo sparc-sun-sunos${UNAME_RELEASE}
  327. ;;
  328. esac
  329. exit 0 ;;
  330. aushp:SunOS:*:*)
  331. echo sparc-auspex-sunos${UNAME_RELEASE}
  332. exit 0 ;;
  333. # The situation for MiNT is a little confusing. The machine name
  334. # can be virtually everything (everything which is not
  335. # "atarist" or "atariste" at least should have a processor
  336. # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
  337. # to the lowercase version "mint" (or "freemint"). Finally
  338. # the system name "TOS" denotes a system which is actually not
  339. # MiNT. But MiNT is downward compatible to TOS, so this should
  340. # be no problem.
  341. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  342. echo m68k-atari-mint${UNAME_RELEASE}
  343. exit 0 ;;
  344. atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  345. echo m68k-atari-mint${UNAME_RELEASE}
  346. exit 0 ;;
  347. *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  348. echo m68k-atari-mint${UNAME_RELEASE}
  349. exit 0 ;;
  350. milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  351. echo m68k-milan-mint${UNAME_RELEASE}
  352. exit 0 ;;
  353. hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  354. echo m68k-hades-mint${UNAME_RELEASE}
  355. exit 0 ;;
  356. *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  357. echo m68k-unknown-mint${UNAME_RELEASE}
  358. exit 0 ;;
  359. powerpc:machten:*:*)
  360. echo powerpc-apple-machten${UNAME_RELEASE}
  361. exit 0 ;;
  362. RISC*:Mach:*:*)
  363. echo mips-dec-mach_bsd4.3
  364. exit 0 ;;
  365. RISC*:ULTRIX:*:*)
  366. echo mips-dec-ultrix${UNAME_RELEASE}
  367. exit 0 ;;
  368. VAX*:ULTRIX*:*:*)
  369. echo vax-dec-ultrix${UNAME_RELEASE}
  370. exit 0 ;;
  371. 2020:CLIX:*:* | 2430:CLIX:*:*)
  372. echo clipper-intergraph-clix${UNAME_RELEASE}
  373. exit 0 ;;
  374. mips:*:*:UMIPS | mips:*:*:RISCos)
  375. eval $set_cc_for_build
  376. sed 's/^ //' << EOF >$dummy.c
  377. #ifdef __cplusplus
  378. #include <stdio.h> /* for printf() prototype */
  379. int main (int argc, char *argv[]) {
  380. #else
  381. int main (argc, argv) int argc; char *argv[]; {
  382. #endif
  383. #if defined (host_mips) && defined (MIPSEB)
  384. #if defined (SYSTYPE_SYSV)
  385. printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
  386. #endif
  387. #if defined (SYSTYPE_SVR4)
  388. printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
  389. #endif
  390. #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  391. printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
  392. #endif
  393. #endif
  394. exit (-1);
  395. }
  396. EOF
  397. $CC_FOR_BUILD $dummy.c -o $dummy \
  398. && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
  399. && rm -f $dummy.c $dummy && exit 0
  400. rm -f $dummy.c $dummy
  401. echo mips-mips-riscos${UNAME_RELEASE}
  402. exit 0 ;;
  403. Motorola:PowerMAX_OS:*:*)
  404. echo powerpc-motorola-powermax
  405. exit 0 ;;
  406. Night_Hawk:Power_UNIX:*:*)
  407. echo powerpc-harris-powerunix
  408. exit 0 ;;
  409. m88k:CX/UX:7*:*)
  410. echo m88k-harris-cxux7
  411. exit 0 ;;
  412. m88k:*:4*:R4*)
  413. echo m88k-motorola-sysv4
  414. exit 0 ;;
  415. m88k:*:3*:R3*)
  416. echo m88k-motorola-sysv3
  417. exit 0 ;;
  418. AViiON:dgux:*:*)
  419. # DG/UX returns AViiON for all architectures
  420. UNAME_PROCESSOR=`/usr/bin/uname -p`
  421. if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
  422. then
  423. if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
  424. [ ${TARGET_BINARY_INTERFACE}x = x ]
  425. then
  426. echo m88k-dg-dgux${UNAME_RELEASE}
  427. else
  428. echo m88k-dg-dguxbcs${UNAME_RELEASE}
  429. fi
  430. else
  431. echo i586-dg-dgux${UNAME_RELEASE}
  432. fi
  433. exit 0 ;;
  434. M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  435. echo m88k-dolphin-sysv3
  436. exit 0 ;;
  437. M88*:*:R3*:*)
  438. # Delta 88k system running SVR3
  439. echo m88k-motorola-sysv3
  440. exit 0 ;;
  441. XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  442. echo m88k-tektronix-sysv3
  443. exit 0 ;;
  444. Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  445. echo m68k-tektronix-bsd
  446. exit 0 ;;
  447. *:IRIX*:*:*)
  448. echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  449. exit 0 ;;
  450. ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  451. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
  452. exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
  453. i*86:AIX:*:*)
  454. echo i386-ibm-aix
  455. exit 0 ;;
  456. ia64:AIX:*:*)
  457. if [ -x /usr/bin/oslevel ] ; then
  458. IBM_REV=`/usr/bin/oslevel`
  459. else
  460. IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  461. fi
  462. echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
  463. exit 0 ;;
  464. *:AIX:2:3)
  465. if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  466. eval $set_cc_for_build
  467. sed 's/^ //' << EOF >$dummy.c
  468. #include <sys/systemcfg.h>
  469. main()
  470. {
  471. if (!__power_pc())
  472. exit(1);
  473. puts("powerpc-ibm-aix3.2.5");
  474. exit(0);
  475. }
  476. EOF
  477. $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
  478. rm -f $dummy.c $dummy
  479. echo rs6000-ibm-aix3.2.5
  480. elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  481. echo rs6000-ibm-aix3.2.4
  482. else
  483. echo rs6000-ibm-aix3.2
  484. fi
  485. exit 0 ;;
  486. *:AIX:*:[45])
  487. IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
  488. if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
  489. IBM_ARCH=rs6000
  490. else
  491. IBM_ARCH=powerpc
  492. fi
  493. if [ -x /usr/bin/oslevel ] ; then
  494. IBM_REV=`/usr/bin/oslevel`
  495. else
  496. IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  497. fi
  498. echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  499. exit 0 ;;
  500. *:AIX:*:*)
  501. echo rs6000-ibm-aix
  502. exit 0 ;;
  503. ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  504. echo romp-ibm-bsd4.4
  505. exit 0 ;;
  506. ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
  507. echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
  508. exit 0 ;; # report: romp-ibm BSD 4.3
  509. *:BOSX:*:*)
  510. echo rs6000-bull-bosx
  511. exit 0 ;;
  512. DPX/2?00:B.O.S.:*:*)
  513. echo m68k-bull-sysv3
  514. exit 0 ;;
  515. 9000/[34]??:4.3bsd:1.*:*)
  516. echo m68k-hp-bsd
  517. exit 0 ;;
  518. hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  519. echo m68k-hp-bsd4.4
  520. exit 0 ;;
  521. 9000/[34678]??:HP-UX:*:*)
  522. HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  523. case "${UNAME_MACHINE}" in
  524. 9000/31? ) HP_ARCH=m68000 ;;
  525. 9000/[34]?? ) HP_ARCH=m68k ;;
  526. 9000/[678][0-9][0-9])
  527. if [ -x /usr/bin/getconf ]; then
  528. sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  529. sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  530. case "${sc_cpu_version}" in
  531. 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
  532. 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
  533. 532) # CPU_PA_RISC2_0
  534. case "${sc_kernel_bits}" in
  535. 32) HP_ARCH="hppa2.0n" ;;
  536. 64) HP_ARCH="hppa2.0w" ;;
  537. '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
  538. esac ;;
  539. esac
  540. fi
  541. if [ "${HP_ARCH}" = "" ]; then
  542. eval $set_cc_for_build
  543. sed 's/^ //' << EOF >$dummy.c
  544. #define _HPUX_SOURCE
  545. #include <stdlib.h>
  546. #include <unistd.h>
  547. int main ()
  548. {
  549. #if defined(_SC_KERNEL_BITS)
  550. long bits = sysconf(_SC_KERNEL_BITS);
  551. #endif
  552. long cpu = sysconf (_SC_CPU_VERSION);
  553. switch (cpu)
  554. {
  555. case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  556. case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  557. case CPU_PA_RISC2_0:
  558. #if defined(_SC_KERNEL_BITS)
  559. switch (bits)
  560. {
  561. case 64: puts ("hppa2.0w"); break;
  562. case 32: puts ("hppa2.0n"); break;
  563. default: puts ("hppa2.0"); break;
  564. } break;
  565. #else /* !defined(_SC_KERNEL_BITS) */
  566. puts ("hppa2.0"); break;
  567. #endif
  568. default: puts ("hppa1.0"); break;
  569. }
  570. exit (0);
  571. }
  572. EOF
  573. (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
  574. if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
  575. rm -f $dummy.c $dummy
  576. fi ;;
  577. esac
  578. echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  579. exit 0 ;;
  580. ia64:HP-UX:*:*)
  581. HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  582. echo ia64-hp-hpux${HPUX_REV}
  583. exit 0 ;;
  584. 3050*:HI-UX:*:*)
  585. eval $set_cc_for_build
  586. sed 's/^ //' << EOF >$dummy.c
  587. #include <unistd.h>
  588. int
  589. main ()
  590. {
  591. long cpu = sysconf (_SC_CPU_VERSION);
  592. /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  593. true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  594. results, however. */
  595. if (CPU_IS_PA_RISC (cpu))
  596. {
  597. switch (cpu)
  598. {
  599. case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  600. case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  601. case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  602. default: puts ("hppa-hitachi-hiuxwe2"); break;
  603. }
  604. }
  605. else if (CPU_IS_HP_MC68K (cpu))
  606. puts ("m68k-hitachi-hiuxwe2");
  607. else puts ("unknown-hitachi-hiuxwe2");
  608. exit (0);
  609. }
  610. EOF
  611. $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
  612. rm -f $dummy.c $dummy
  613. echo unknown-hitachi-hiuxwe2
  614. exit 0 ;;
  615. 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  616. echo hppa1.1-hp-bsd
  617. exit 0 ;;
  618. 9000/8??:4.3bsd:*:*)
  619. echo hppa1.0-hp-bsd
  620. exit 0 ;;
  621. *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  622. echo hppa1.0-hp-mpeix
  623. exit 0 ;;
  624. hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  625. echo hppa1.1-hp-osf
  626. exit 0 ;;
  627. hp8??:OSF1:*:*)
  628. echo hppa1.0-hp-osf
  629. exit 0 ;;
  630. i*86:OSF1:*:*)
  631. if [ -x /usr/sbin/sysversion ] ; then
  632. echo ${UNAME_MACHINE}-unknown-osf1mk
  633. else
  634. echo ${UNAME_MACHINE}-unknown-osf1
  635. fi
  636. exit 0 ;;
  637. parisc*:Lites*:*:*)
  638. echo hppa1.1-hp-lites
  639. exit 0 ;;
  640. C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  641. echo c1-convex-bsd
  642. exit 0 ;;
  643. C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  644. if getsysinfo -f scalar_acc
  645. then echo c32-convex-bsd
  646. else echo c2-convex-bsd
  647. fi
  648. exit 0 ;;
  649. C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  650. echo c34-convex-bsd
  651. exit 0 ;;
  652. C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  653. echo c38-convex-bsd
  654. exit 0 ;;
  655. C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  656. echo c4-convex-bsd
  657. exit 0 ;;
  658. CRAY*X-MP:*:*:*)
  659. echo xmp-cray-unicos
  660. exit 0 ;;
  661. CRAY*Y-MP:*:*:*)
  662. echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  663. exit 0 ;;
  664. CRAY*[A-Z]90:*:*:*)
  665. echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
  666. | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  667. -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  668. -e 's/\.[^.]*$/.X/'
  669. exit 0 ;;
  670. CRAY*TS:*:*:*)
  671. echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  672. exit 0 ;;
  673. CRAY*T3D:*:*:*)
  674. echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  675. exit 0 ;;
  676. CRAY*T3E:*:*:*)
  677. echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  678. exit 0 ;;
  679. CRAY*SV1:*:*:*)
  680. echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  681. exit 0 ;;
  682. CRAY-2:*:*:*)
  683. echo cray2-cray-unicos
  684. exit 0 ;;
  685. F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  686. FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  687. FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  688. FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
  689. echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  690. exit 0 ;;
  691. i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  692. echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
  693. exit 0 ;;
  694. sparc*:BSD/OS:*:*)
  695. echo sparc-unknown-bsdi${UNAME_RELEASE}
  696. exit 0 ;;
  697. *:BSD/OS:*:*)
  698. echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
  699. exit 0 ;;
  700. *:FreeBSD:*:*)
  701. echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  702. exit 0 ;;
  703. i*:CYGWIN*:*)
  704. echo ${UNAME_MACHINE}-pc-cygwin
  705. exit 0 ;;
  706. i*:MINGW*:*)
  707. echo ${UNAME_MACHINE}-pc-mingw32
  708. exit 0 ;;
  709. i*:PW*:*)
  710. echo ${UNAME_MACHINE}-pc-pw32
  711. exit 0 ;;
  712. i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
  713. # How do we know it's Interix rather than the generic POSIX subsystem?
  714. # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
  715. # UNAME_MACHINE based on the output of uname instead of i386?
  716. echo i386-pc-interix
  717. exit 0 ;;
  718. i*:UWIN*:*)
  719. echo ${UNAME_MACHINE}-pc-uwin
  720. exit 0 ;;
  721. p*:CYGWIN*:*)
  722. echo powerpcle-unknown-cygwin
  723. exit 0 ;;
  724. prep*:SunOS:5.*:*)
  725. echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  726. exit 0 ;;
  727. *:GNU:*:*)
  728. echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  729. exit 0 ;;
  730. i*86:Minix:*:*)
  731. echo ${UNAME_MACHINE}-pc-minix
  732. exit 0 ;;
  733. arm*:Linux:*:*)
  734. echo ${UNAME_MACHINE}-unknown-linux-gnu
  735. exit 0 ;;
  736. ia64:Linux:*:*)
  737. echo ${UNAME_MACHINE}-unknown-linux
  738. exit 0 ;;
  739. m68*:Linux:*:*)
  740. echo ${UNAME_MACHINE}-unknown-linux-gnu
  741. exit 0 ;;
  742. mips:Linux:*:*)
  743. case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
  744. big) echo mips-unknown-linux-gnu && exit 0 ;;
  745. little) echo mipsel-unknown-linux-gnu && exit 0 ;;
  746. esac
  747. ;;
  748. ppc:Linux:*:*)
  749. echo powerpc-unknown-linux-gnu
  750. exit 0 ;;
  751. ppc64:Linux:*:*)
  752. echo powerpc64-unknown-linux-gnu
  753. exit 0 ;;
  754. alpha:Linux:*:*)
  755. case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
  756. EV5) UNAME_MACHINE=alphaev5 ;;
  757. EV56) UNAME_MACHINE=alphaev56 ;;
  758. PCA56) UNAME_MACHINE=alphapca56 ;;
  759. PCA57) UNAME_MACHINE=alphapca56 ;;
  760. EV6) UNAME_MACHINE=alphaev6 ;;
  761. EV67) UNAME_MACHINE=alphaev67 ;;
  762. EV68*) UNAME_MACHINE=alphaev68 ;;
  763. esac
  764. objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
  765. if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
  766. echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
  767. exit 0 ;;
  768. parisc:Linux:*:* | hppa:Linux:*:*)
  769. # Look for CPU level
  770. case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  771. PA7*) echo hppa1.1-unknown-linux-gnu ;;
  772. PA8*) echo hppa2.0-unknown-linux-gnu ;;
  773. *) echo hppa-unknown-linux-gnu ;;
  774. esac
  775. exit 0 ;;
  776. parisc64:Linux:*:* | hppa64:Linux:*:*)
  777. echo hppa64-unknown-linux-gnu
  778. exit 0 ;;
  779. s390:Linux:*:* | s390x:Linux:*:*)
  780. echo ${UNAME_MACHINE}-ibm-linux
  781. exit 0 ;;
  782. sh*:Linux:*:*)
  783. echo ${UNAME_MACHINE}-unknown-linux-gnu
  784. exit 0 ;;
  785. sparc:Linux:*:* | sparc64:Linux:*:*)
  786. echo ${UNAME_MACHINE}-unknown-linux-gnu
  787. exit 0 ;;
  788. x86_64:Linux:*:*)
  789. echo x86_64-unknown-linux-gnu
  790. exit 0 ;;
  791. i*86:Linux:*:*)
  792. # The BFD linker knows what the default object file format is, so
  793. # first see if it will tell us. cd to the root directory to prevent
  794. # problems with other programs or directories called `ld' in the path.
  795. ld_supported_targets=`cd /; ld --help 2>&1 \
  796. | sed -ne '/supported targets:/!d
  797. s/[ ][ ]*/ /g
  798. s/.*supported targets: *//
  799. s/ .*//
  800. p'`
  801. case "$ld_supported_targets" in
  802. elf32-i386)
  803. TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
  804. ;;
  805. a.out-i386-linux)
  806. echo "${UNAME_MACHINE}-pc-linux-gnuaout"
  807. exit 0 ;;
  808. coff-i386)
  809. echo "${UNAME_MACHINE}-pc-linux-gnucoff"
  810. exit 0 ;;
  811. "")
  812. # Either a pre-BFD a.out linker (linux-gnuoldld) or
  813. # one that does not give us useful --help.
  814. echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
  815. exit 0 ;;
  816. esac
  817. # Determine whether the default compiler is a.out or elf
  818. eval $set_cc_for_build
  819. cat >$dummy.c <<EOF
  820. #include <features.h>
  821. #ifdef __cplusplus
  822. #include <stdio.h> /* for printf() prototype */
  823. int main (int argc, char *argv[]) {
  824. #else
  825. int main (argc, argv) int argc; char *argv[]; {
  826. #endif
  827. #ifdef __ELF__
  828. # ifdef __GLIBC__
  829. # if __GLIBC__ >= 2
  830. printf ("%s-pc-linux-gnu\n", argv[1]);
  831. # else
  832. printf ("%s-pc-linux-gnulibc1\n", argv[1]);
  833. # endif
  834. # else
  835. printf ("%s-pc-linux-gnulibc1\n", argv[1]);
  836. # endif
  837. #else
  838. printf ("%s-pc-linux-gnuaout\n", argv[1]);
  839. #endif
  840. return 0;
  841. }
  842. EOF
  843. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
  844. rm -f $dummy.c $dummy
  845. test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
  846. ;;
  847. i*86:DYNIX/ptx:4*:*)
  848. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  849. # earlier versions are messed up and put the nodename in both
  850. # sysname and nodename.
  851. echo i386-sequent-sysv4
  852. exit 0 ;;
  853. i*86:UNIX_SV:4.2MP:2.*)
  854. # Unixware is an offshoot of SVR4, but it has its own version
  855. # number series starting with 2...
  856. # I am not positive that other SVR4 systems won't match this,
  857. # I just have to hope. -- rms.
  858. # Use sysv4.2uw... so that sysv4* matches it.
  859. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  860. exit 0 ;;
  861. i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  862. UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
  863. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  864. echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
  865. else
  866. echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  867. fi
  868. exit 0 ;;
  869. i*86:*:5:[78]*)
  870. case `/bin/uname -X | grep "^Machine"` in
  871. *486*) UNAME_MACHINE=i486 ;;
  872. *Pentium) UNAME_MACHINE=i586 ;;
  873. *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  874. esac
  875. echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
  876. exit 0 ;;
  877. i*86:*:3.2:*)
  878. if test -f /usr/options/cb.name; then
  879. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  880. echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
  881. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  882. UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  883. (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  884. (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
  885. && UNAME_MACHINE=i586
  886. (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
  887. && UNAME_MACHINE=i686
  888. (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
  889. && UNAME_MACHINE=i686
  890. echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
  891. else
  892. echo ${UNAME_MACHINE}-pc-sysv32
  893. fi
  894. exit 0 ;;
  895. i*86:*DOS:*:*)
  896. echo ${UNAME_MACHINE}-pc-msdosdjgpp
  897. exit 0 ;;
  898. pc:*:*:*)
  899. # Left here for compatibility:
  900. # uname -m prints for DJGPP always 'pc', but it prints nothing about
  901. # the processor, so we play safe by assuming i386.
  902. echo i386-pc-msdosdjgpp
  903. exit 0 ;;
  904. Intel:Mach:3*:*)
  905. echo i386-pc-mach3
  906. exit 0 ;;
  907. paragon:*:*:*)
  908. echo i860-intel-osf1
  909. exit 0 ;;
  910. i860:*:4.*:*) # i860-SVR4
  911. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  912. echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
  913. else # Add other i860-SVR4 vendors below as they are discovered.
  914. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
  915. fi
  916. exit 0 ;;
  917. mini*:CTIX:SYS*5:*)
  918. # "miniframe"
  919. echo m68010-convergent-sysv
  920. exit 0 ;;
  921. M68*:*:R3V[567]*:*)
  922. test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  923. 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
  924. OS_REL=''
  925. test -r /etc/.relid \
  926. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  927. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  928. && echo i486-ncr-sysv4.3${OS_REL} && exit 0
  929. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  930. && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
  931. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  932. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  933. && echo i486-ncr-sysv4 && exit 0 ;;
  934. m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  935. echo m68k-unknown-lynxos${UNAME_RELEASE}
  936. exit 0 ;;
  937. mc68030:UNIX_System_V:4.*:*)
  938. echo m68k-atari-sysv4
  939. exit 0 ;;
  940. i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
  941. echo i386-unknown-lynxos${UNAME_RELEASE}
  942. exit 0 ;;
  943. TSUNAMI:LynxOS:2.*:*)
  944. echo sparc-unknown-lynxos${UNAME_RELEASE}
  945. exit 0 ;;
  946. rs6000:LynxOS:2.*:*)
  947. echo rs6000-unknown-lynxos${UNAME_RELEASE}
  948. exit 0 ;;
  949. PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
  950. echo powerpc-unknown-lynxos${UNAME_RELEASE}
  951. exit 0 ;;
  952. SM[BE]S:UNIX_SV:*:*)
  953. echo mips-dde-sysv${UNAME_RELEASE}
  954. exit 0 ;;
  955. RM*:ReliantUNIX-*:*:*)
  956. echo mips-sni-sysv4
  957. exit 0 ;;
  958. RM*:SINIX-*:*:*)
  959. echo mips-sni-sysv4
  960. exit 0 ;;
  961. *:SINIX-*:*:*)
  962. if uname -p 2>/dev/null >/dev/null ; then
  963. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  964. echo ${UNAME_MACHINE}-sni-sysv4
  965. else
  966. echo ns32k-sni-sysv
  967. fi
  968. exit 0 ;;
  969. PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  970. # says <Richard.M.Bartel@ccMail.Census.GOV>
  971. echo i586-unisys-sysv4
  972. exit 0 ;;
  973. *:UNIX_System_V:4*:FTX*)
  974. # From Gerald Hewes <hewes@openmarket.com>.
  975. # How about differentiating between stratus architectures? -djm
  976. echo hppa1.1-stratus-sysv4
  977. exit 0 ;;
  978. *:*:*:FTX*)
  979. # From seanf@swdc.stratus.com.
  980. echo i860-stratus-sysv4
  981. exit 0 ;;
  982. *:VOS:*:*)
  983. # From Paul.Green@stratus.com.
  984. echo hppa1.1-stratus-vos
  985. exit 0 ;;
  986. mc68*:A/UX:*:*)
  987. echo m68k-apple-aux${UNAME_RELEASE}
  988. exit 0 ;;
  989. news*:NEWS-OS:6*:*)
  990. echo mips-sony-newsos6
  991. exit 0 ;;
  992. R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  993. if [ -d /usr/nec ]; then
  994. echo mips-nec-sysv${UNAME_RELEASE}
  995. else
  996. echo mips-unknown-sysv${UNAME_RELEASE}
  997. fi
  998. exit 0 ;;
  999. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1000. echo powerpc-be-beos
  1001. exit 0 ;;
  1002. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1003. echo powerpc-apple-beos
  1004. exit 0 ;;
  1005. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1006. echo i586-pc-beos
  1007. exit 0 ;;
  1008. SX-4:SUPER-UX:*:*)
  1009. echo sx4-nec-superux${UNAME_RELEASE}
  1010. exit 0 ;;
  1011. SX-5:SUPER-UX:*:*)
  1012. echo sx5-nec-superux${UNAME_RELEASE}
  1013. exit 0 ;;
  1014. Power*:Rhapsody:*:*)
  1015. echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1016. exit 0 ;;
  1017. *:Rhapsody:*:*)
  1018. echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1019. exit 0 ;;
  1020. *:Darwin:*:*)
  1021. echo `uname -p`-apple-darwin${UNAME_RELEASE}
  1022. exit 0 ;;
  1023. *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1024. if test "${UNAME_MACHINE}" = "x86pc"; then
  1025. UNAME_MACHINE=pc
  1026. fi
  1027. echo `uname -p`-${UNAME_MACHINE}-nto-qnx
  1028. exit 0 ;;
  1029. *:QNX:*:4*)
  1030. echo i386-pc-qnx
  1031. exit 0 ;;
  1032. NSR-[KW]:NONSTOP_KERNEL:*:*)
  1033. echo nsr-tandem-nsk${UNAME_RELEASE}
  1034. exit 0 ;;
  1035. *:NonStop-UX:*:*)
  1036. echo mips-compaq-nonstopux
  1037. exit 0 ;;
  1038. BS2000:POSIX*:*:*)
  1039. echo bs2000-siemens-sysv
  1040. exit 0 ;;
  1041. DS/*:UNIX_System_V:*:*)
  1042. echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
  1043. exit 0 ;;
  1044. *:Plan9:*:*)
  1045. # "uname -m" is not consistent, so use $cputype instead. 386
  1046. # is converted to i386 for consistency with other x86
  1047. # operating systems.
  1048. if test "$cputype" = "386"; then
  1049. UNAME_MACHINE=i386
  1050. else
  1051. UNAME_MACHINE="$cputype"
  1052. fi
  1053. echo ${UNAME_MACHINE}-unknown-plan9
  1054. exit 0 ;;
  1055. i*86:OS/2:*:*)
  1056. # If we were able to find `uname', then EMX Unix compatibility
  1057. # is probably installed.
  1058. echo ${UNAME_MACHINE}-pc-os2-emx
  1059. exit 0 ;;
  1060. *:TOPS-10:*:*)
  1061. echo pdp10-unknown-tops10
  1062. exit 0 ;;
  1063. *:TENEX:*:*)
  1064. echo pdp10-unknown-tenex
  1065. exit 0 ;;
  1066. KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
  1067. echo pdp10-dec-tops20
  1068. exit 0 ;;
  1069. XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
  1070. echo pdp10-xkl-tops20
  1071. exit 0 ;;
  1072. *:TOPS-20:*:*)
  1073. echo pdp10-unknown-tops20
  1074. exit 0 ;;
  1075. *:ITS:*:*)
  1076. echo pdp10-unknown-its
  1077. exit 0 ;;
  1078. i*86:XTS-300:*:STOP)
  1079. echo ${UNAME_MACHINE}-unknown-stop
  1080. exit 0 ;;
  1081. i*86:atheos:*:*)
  1082. echo ${UNAME_MACHINE}-unknown-atheos
  1083. exit 0 ;;
  1084. esac
  1085. #echo '(No uname command or uname output not recognized.)' 1>&2
  1086. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1087. eval $set_cc_for_build
  1088. cat >$dummy.c <<EOF
  1089. #ifdef _SEQUENT_
  1090. # include <sys/types.h>
  1091. # include <sys/utsname.h>
  1092. #endif
  1093. main ()
  1094. {
  1095. #if defined (sony)
  1096. #if defined (MIPSEB)
  1097. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1098. I don't know.... */
  1099. printf ("mips-sony-bsd\n"); exit (0);
  1100. #else
  1101. #include <sys/param.h>
  1102. printf ("m68k-sony-newsos%s\n",
  1103. #ifdef NEWSOS4
  1104. "4"
  1105. #else
  1106. ""
  1107. #endif
  1108. ); exit (0);
  1109. #endif
  1110. #endif
  1111. #if defined (__arm) && defined (__acorn) && defined (__unix)
  1112. printf ("arm-acorn-riscix"); exit (0);
  1113. #endif
  1114. #if defined (hp300) && !defined (hpux)
  1115. printf ("m68k-hp-bsd\n"); exit (0);
  1116. #endif
  1117. #if defined (NeXT)
  1118. #if !defined (__ARCHITECTURE__)
  1119. #define __ARCHITECTURE__ "m68k"
  1120. #endif
  1121. int version;
  1122. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1123. if (version < 4)
  1124. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1125. else
  1126. printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1127. exit (0);
  1128. #endif
  1129. #if defined (MULTIMAX) || defined (n16)
  1130. #if defined (UMAXV)
  1131. printf ("ns32k-encore-sysv\n"); exit (0);
  1132. #else
  1133. #if defined (CMU)
  1134. printf ("ns32k-encore-mach\n"); exit (0);
  1135. #else
  1136. printf ("ns32k-encore-bsd\n"); exit (0);
  1137. #endif
  1138. #endif
  1139. #endif
  1140. #if defined (__386BSD__)
  1141. printf ("i386-pc-bsd\n"); exit (0);
  1142. #endif
  1143. #if defined (sequent)
  1144. #if defined (i386)
  1145. printf ("i386-sequent-dynix\n"); exit (0);
  1146. #endif
  1147. #if defined (ns32000)
  1148. printf ("ns32k-sequent-dynix\n"); exit (0);
  1149. #endif
  1150. #endif
  1151. #if defined (_SEQUENT_)
  1152. struct utsname un;
  1153. uname(&un);
  1154. if (strncmp(un.version, "V2", 2) == 0) {
  1155. printf ("i386-sequent-ptx2\n"); exit (0);
  1156. }
  1157. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1158. printf ("i386-sequent-ptx1\n"); exit (0);
  1159. }
  1160. printf ("i386-sequent-ptx\n"); exit (0);
  1161. #endif
  1162. #if defined (vax)
  1163. # if !defined (ultrix)
  1164. # include <sys/param.h>
  1165. # if defined (BSD)
  1166. # if BSD == 43
  1167. printf ("vax-dec-bsd4.3\n"); exit (0);
  1168. # else
  1169. # if BSD == 199006
  1170. printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1171. # else
  1172. printf ("vax-dec-bsd\n"); exit (0);
  1173. # endif
  1174. # endif
  1175. # else
  1176. printf ("vax-dec-bsd\n"); exit (0);
  1177. # endif
  1178. # else
  1179. printf ("vax-dec-ultrix\n"); exit (0);
  1180. # endif
  1181. #endif
  1182. #if defined (alliant) && defined (i860)
  1183. printf ("i860-alliant-bsd\n"); exit (0);
  1184. #endif
  1185. exit (1);
  1186. }
  1187. EOF
  1188. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
  1189. rm -f $dummy.c $dummy
  1190. # Apollos put the system type in the environment.
  1191. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  1192. # Convex versions that predate uname can use getsysinfo(1)
  1193. if [ -x /usr/convex/getsysinfo ]
  1194. then
  1195. case `getsysinfo -f cpu_type` in
  1196. c1*)
  1197. echo c1-convex-bsd
  1198. exit 0 ;;
  1199. c2*)
  1200. if getsysinfo -f scalar_acc
  1201. then echo c32-convex-bsd
  1202. else echo c2-convex-bsd
  1203. fi
  1204. exit 0 ;;
  1205. c34*)
  1206. echo c34-convex-bsd
  1207. exit 0 ;;
  1208. c38*)
  1209. echo c38-convex-bsd
  1210. exit 0 ;;
  1211. c4*)
  1212. echo c4-convex-bsd
  1213. exit 0 ;;
  1214. esac
  1215. fi
  1216. cat >&2 <<EOF
  1217. $0: unable to guess system type
  1218. This script, last modified $timestamp, has failed to recognize
  1219. the operating system you are using. It is advised that you
  1220. download the most up to date version of the config scripts from
  1221. ftp://ftp.gnu.org/pub/gnu/config/
  1222. If the version you run ($0) is already up to date, please
  1223. send the following data and any information you think might be
  1224. pertinent to <config-patches@gnu.org> in order to provide the needed
  1225. information to handle your system.
  1226. config.guess timestamp = $timestamp
  1227. uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1228. uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1229. uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1230. uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1231. /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1232. /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1233. hostinfo = `(hostinfo) 2>/dev/null`
  1234. /bin/universe = `(/bin/universe) 2>/dev/null`
  1235. /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1236. /bin/arch = `(/bin/arch) 2>/dev/null`
  1237. /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1238. /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1239. UNAME_MACHINE = ${UNAME_MACHINE}
  1240. UNAME_RELEASE = ${UNAME_RELEASE}
  1241. UNAME_SYSTEM = ${UNAME_SYSTEM}
  1242. UNAME_VERSION = ${UNAME_VERSION}
  1243. EOF
  1244. exit 1
  1245. # Local variables:
  1246. # eval: (add-hook 'write-file-hooks 'time-stamp)
  1247. # time-stamp-start: "timestamp='"
  1248. # time-stamp-format: "%:y-%02m-%02d"
  1249. # time-stamp-end: "'"
  1250. # End: