config.guess 48 KB

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