config.guess 44 KB

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