config.guess 48 KB

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