config.guess 38 KB

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