config.guess 45 KB

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