config.guess 48 KB

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