config.guess 48 KB

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