config.guess 48 KB

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