config.guess 49 KB

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