autosetup-config.guess 50 KB

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