config.guess 40 KB

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