config.guess 44 KB

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