config.guess 48 KB

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