1
0

config.guess 44 KB

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