config.guess 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812
  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-01-01'
  6. # This file is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, see <https://www.gnu.org/licenses/>.
  18. #
  19. # As a special exception to the GNU General Public License, if you
  20. # distribute this file as part of a program that contains a
  21. # configuration script generated by Autoconf, you may include it under
  22. # the same distribution terms that you use for the rest of that
  23. # program. This Exception is an additional permission under section 7
  24. # of the GNU General Public License, version 3 ("GPLv3").
  25. #
  26. # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
  27. #
  28. # You can get the latest version of this script from:
  29. # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
  30. #
  31. # Please send patches to <config-patches@gnu.org>.
  32. # The "shellcheck disable" line above the timestamp inhibits complaints
  33. # about features and limitations of the classic Bourne shell that were
  34. # superseded or lifted in POSIX. However, this script identifies a wide
  35. # variety of pre-POSIX systems that do not have POSIX shells at all, and
  36. # even some reasonably current systems (Solaris 10 as case-in-point) still
  37. # have a pre-POSIX /bin/sh.
  38. me=`echo "$0" | sed -e 's,.*/,,'`
  39. usage="\
  40. Usage: $0 [OPTION]
  41. Output the configuration name of the system '$me' is run on.
  42. Options:
  43. -h, --help print this help, then exit
  44. -t, --time-stamp print date of last modification, then exit
  45. -v, --version print version number, then exit
  46. Report bugs and patches to <config-patches@gnu.org>."
  47. version="\
  48. GNU config.guess ($timestamp)
  49. Originally written by Per Bothner.
  50. Copyright 1992-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 c89 c99 ; do
  104. if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
  105. CC_FOR_BUILD=$driver
  106. break
  107. fi
  108. done
  109. if test x"$CC_FOR_BUILD" = x ; then
  110. CC_FOR_BUILD=no_compiler_found
  111. fi
  112. ;;
  113. ,,*) CC_FOR_BUILD=$CC ;;
  114. ,*,*) CC_FOR_BUILD=$HOST_CC ;;
  115. esac
  116. }
  117. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  118. # (ghazi@noc.rutgers.edu 1994-08-24)
  119. if test -f /.attbin/uname ; then
  120. PATH=$PATH:/.attbin ; export PATH
  121. fi
  122. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  123. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  124. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  125. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  126. case $UNAME_SYSTEM in
  127. Linux|GNU|GNU/*)
  128. LIBC=unknown
  129. set_cc_for_build
  130. cat <<-EOF > "$dummy.c"
  131. #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. main()
  606. {
  607. if (!__power_pc())
  608. exit(1);
  609. puts("powerpc-ibm-aix3.2.5");
  610. exit(0);
  611. }
  612. EOF
  613. if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
  614. then
  615. GUESS=$SYSTEM_NAME
  616. else
  617. GUESS=rs6000-ibm-aix3.2.5
  618. fi
  619. elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  620. GUESS=rs6000-ibm-aix3.2.4
  621. else
  622. GUESS=rs6000-ibm-aix3.2
  623. fi
  624. ;;
  625. *:AIX:*:[4567])
  626. IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  627. if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
  628. IBM_ARCH=rs6000
  629. else
  630. IBM_ARCH=powerpc
  631. fi
  632. if test -x /usr/bin/lslpp ; then
  633. IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
  634. awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
  635. else
  636. IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
  637. fi
  638. GUESS=$IBM_ARCH-ibm-aix$IBM_REV
  639. ;;
  640. *:AIX:*:*)
  641. GUESS=rs6000-ibm-aix
  642. ;;
  643. ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
  644. GUESS=romp-ibm-bsd4.4
  645. ;;
  646. ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
  647. GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
  648. ;; # report: romp-ibm BSD 4.3
  649. *:BOSX:*:*)
  650. GUESS=rs6000-bull-bosx
  651. ;;
  652. DPX/2?00:B.O.S.:*:*)
  653. GUESS=m68k-bull-sysv3
  654. ;;
  655. 9000/[34]??:4.3bsd:1.*:*)
  656. GUESS=m68k-hp-bsd
  657. ;;
  658. hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  659. GUESS=m68k-hp-bsd4.4
  660. ;;
  661. 9000/[34678]??:HP-UX:*:*)
  662. HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
  663. case $UNAME_MACHINE in
  664. 9000/31?) HP_ARCH=m68000 ;;
  665. 9000/[34]??) HP_ARCH=m68k ;;
  666. 9000/[678][0-9][0-9])
  667. if test -x /usr/bin/getconf; then
  668. sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  669. sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  670. case $sc_cpu_version in
  671. 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
  672. 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
  673. 532) # CPU_PA_RISC2_0
  674. case $sc_kernel_bits in
  675. 32) HP_ARCH=hppa2.0n ;;
  676. 64) HP_ARCH=hppa2.0w ;;
  677. '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
  678. esac ;;
  679. esac
  680. fi
  681. if test "$HP_ARCH" = ""; then
  682. set_cc_for_build
  683. sed 's/^ //' << EOF > "$dummy.c"
  684. #define _HPUX_SOURCE
  685. #include <stdlib.h>
  686. #include <unistd.h>
  687. int main ()
  688. {
  689. #if defined(_SC_KERNEL_BITS)
  690. long bits = sysconf(_SC_KERNEL_BITS);
  691. #endif
  692. long cpu = sysconf (_SC_CPU_VERSION);
  693. switch (cpu)
  694. {
  695. case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  696. case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  697. case CPU_PA_RISC2_0:
  698. #if defined(_SC_KERNEL_BITS)
  699. switch (bits)
  700. {
  701. case 64: puts ("hppa2.0w"); break;
  702. case 32: puts ("hppa2.0n"); break;
  703. default: puts ("hppa2.0"); break;
  704. } break;
  705. #else /* !defined(_SC_KERNEL_BITS) */
  706. puts ("hppa2.0"); break;
  707. #endif
  708. default: puts ("hppa1.0"); break;
  709. }
  710. exit (0);
  711. }
  712. EOF
  713. (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
  714. test -z "$HP_ARCH" && HP_ARCH=hppa
  715. fi ;;
  716. esac
  717. if test "$HP_ARCH" = hppa2.0w
  718. then
  719. set_cc_for_build
  720. # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
  721. # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
  722. # generating 64-bit code. GNU and HP use different nomenclature:
  723. #
  724. # $ CC_FOR_BUILD=cc ./config.guess
  725. # => hppa2.0w-hp-hpux11.23
  726. # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
  727. # => hppa64-hp-hpux11.23
  728. if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
  729. grep -q __LP64__
  730. then
  731. HP_ARCH=hppa2.0w
  732. else
  733. HP_ARCH=hppa64
  734. fi
  735. fi
  736. GUESS=$HP_ARCH-hp-hpux$HPUX_REV
  737. ;;
  738. ia64:HP-UX:*:*)
  739. HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
  740. GUESS=ia64-hp-hpux$HPUX_REV
  741. ;;
  742. 3050*:HI-UX:*:*)
  743. set_cc_for_build
  744. sed 's/^ //' << EOF > "$dummy.c"
  745. #include <unistd.h>
  746. int
  747. main ()
  748. {
  749. long cpu = sysconf (_SC_CPU_VERSION);
  750. /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  751. true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  752. results, however. */
  753. if (CPU_IS_PA_RISC (cpu))
  754. {
  755. switch (cpu)
  756. {
  757. case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  758. case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  759. case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  760. default: puts ("hppa-hitachi-hiuxwe2"); break;
  761. }
  762. }
  763. else if (CPU_IS_HP_MC68K (cpu))
  764. puts ("m68k-hitachi-hiuxwe2");
  765. else puts ("unknown-hitachi-hiuxwe2");
  766. exit (0);
  767. }
  768. EOF
  769. $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
  770. { echo "$SYSTEM_NAME"; exit; }
  771. GUESS=unknown-hitachi-hiuxwe2
  772. ;;
  773. 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
  774. GUESS=hppa1.1-hp-bsd
  775. ;;
  776. 9000/8??:4.3bsd:*:*)
  777. GUESS=hppa1.0-hp-bsd
  778. ;;
  779. *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  780. GUESS=hppa1.0-hp-mpeix
  781. ;;
  782. hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
  783. GUESS=hppa1.1-hp-osf
  784. ;;
  785. hp8??:OSF1:*:*)
  786. GUESS=hppa1.0-hp-osf
  787. ;;
  788. i*86:OSF1:*:*)
  789. if test -x /usr/sbin/sysversion ; then
  790. GUESS=$UNAME_MACHINE-unknown-osf1mk
  791. else
  792. GUESS=$UNAME_MACHINE-unknown-osf1
  793. fi
  794. ;;
  795. parisc*:Lites*:*:*)
  796. GUESS=hppa1.1-hp-lites
  797. ;;
  798. C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  799. GUESS=c1-convex-bsd
  800. ;;
  801. C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  802. if getsysinfo -f scalar_acc
  803. then echo c32-convex-bsd
  804. else echo c2-convex-bsd
  805. fi
  806. exit ;;
  807. C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  808. GUESS=c34-convex-bsd
  809. ;;
  810. C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  811. GUESS=c38-convex-bsd
  812. ;;
  813. C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  814. GUESS=c4-convex-bsd
  815. ;;
  816. CRAY*Y-MP:*:*:*)
  817. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  818. GUESS=ymp-cray-unicos$CRAY_REL
  819. ;;
  820. CRAY*[A-Z]90:*:*:*)
  821. echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
  822. | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  823. -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  824. -e 's/\.[^.]*$/.X/'
  825. exit ;;
  826. CRAY*TS:*:*:*)
  827. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  828. GUESS=t90-cray-unicos$CRAY_REL
  829. ;;
  830. CRAY*T3E:*:*:*)
  831. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  832. GUESS=alphaev5-cray-unicosmk$CRAY_REL
  833. ;;
  834. CRAY*SV1:*:*:*)
  835. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  836. GUESS=sv1-cray-unicos$CRAY_REL
  837. ;;
  838. *:UNICOS/mp:*:*)
  839. CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
  840. GUESS=craynv-cray-unicosmp$CRAY_REL
  841. ;;
  842. F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  843. FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
  844. FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
  845. FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
  846. GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
  847. ;;
  848. 5000:UNIX_System_V:4.*:*)
  849. FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
  850. FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
  851. GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
  852. ;;
  853. i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  854. GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
  855. ;;
  856. sparc*:BSD/OS:*:*)
  857. GUESS=sparc-unknown-bsdi$UNAME_RELEASE
  858. ;;
  859. *:BSD/OS:*:*)
  860. GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
  861. ;;
  862. arm:FreeBSD:*:*)
  863. UNAME_PROCESSOR=`uname -p`
  864. set_cc_for_build
  865. if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  866. | grep -q __ARM_PCS_VFP
  867. then
  868. FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  869. GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
  870. else
  871. FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  872. GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
  873. fi
  874. ;;
  875. *:FreeBSD:*:*)
  876. UNAME_PROCESSOR=`uname -p`
  877. case $UNAME_PROCESSOR in
  878. amd64)
  879. UNAME_PROCESSOR=x86_64 ;;
  880. i386)
  881. UNAME_PROCESSOR=i586 ;;
  882. esac
  883. FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  884. GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
  885. ;;
  886. i*:CYGWIN*:*)
  887. GUESS=$UNAME_MACHINE-pc-cygwin
  888. ;;
  889. *:MINGW64*:*)
  890. GUESS=$UNAME_MACHINE-pc-mingw64
  891. ;;
  892. *:MINGW*:*)
  893. GUESS=$UNAME_MACHINE-pc-mingw32
  894. ;;
  895. *:MSYS*:*)
  896. GUESS=$UNAME_MACHINE-pc-msys
  897. ;;
  898. i*:PW*:*)
  899. GUESS=$UNAME_MACHINE-pc-pw32
  900. ;;
  901. *:SerenityOS:*:*)
  902. GUESS=$UNAME_MACHINE-pc-serenity
  903. ;;
  904. *:Interix*:*)
  905. case $UNAME_MACHINE in
  906. x86)
  907. GUESS=i586-pc-interix$UNAME_RELEASE
  908. ;;
  909. authenticamd | genuineintel | EM64T)
  910. GUESS=x86_64-unknown-interix$UNAME_RELEASE
  911. ;;
  912. IA64)
  913. GUESS=ia64-unknown-interix$UNAME_RELEASE
  914. ;;
  915. esac ;;
  916. i*:UWIN*:*)
  917. GUESS=$UNAME_MACHINE-pc-uwin
  918. ;;
  919. amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
  920. GUESS=x86_64-pc-cygwin
  921. ;;
  922. prep*:SunOS:5.*:*)
  923. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
  924. GUESS=powerpcle-unknown-solaris2$SUN_REL
  925. ;;
  926. *:GNU:*:*)
  927. # the GNU system
  928. GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
  929. GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
  930. GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
  931. ;;
  932. *:GNU/*:*:*)
  933. # other systems with GNU libc and userland
  934. GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
  935. GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  936. GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
  937. ;;
  938. x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
  939. GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
  940. ;;
  941. *:[Mm]anagarm:*:*)
  942. GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
  943. ;;
  944. *:Minix:*:*)
  945. GUESS=$UNAME_MACHINE-unknown-minix
  946. ;;
  947. aarch64:Linux:*:*)
  948. set_cc_for_build
  949. CPU=$UNAME_MACHINE
  950. LIBCABI=$LIBC
  951. if test "$CC_FOR_BUILD" != no_compiler_found; then
  952. ABI=64
  953. sed 's/^ //' << EOF > "$dummy.c"
  954. #ifdef __ARM_EABI__
  955. #ifdef __ARM_PCS_VFP
  956. ABI=eabihf
  957. #else
  958. ABI=eabi
  959. #endif
  960. #endif
  961. EOF
  962. cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
  963. eval "$cc_set_abi"
  964. case $ABI in
  965. eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
  966. esac
  967. fi
  968. GUESS=$CPU-unknown-linux-$LIBCABI
  969. ;;
  970. aarch64_be:Linux:*:*)
  971. UNAME_MACHINE=aarch64_be
  972. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  973. ;;
  974. alpha:Linux:*:*)
  975. case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
  976. EV5) UNAME_MACHINE=alphaev5 ;;
  977. EV56) UNAME_MACHINE=alphaev56 ;;
  978. PCA56) UNAME_MACHINE=alphapca56 ;;
  979. PCA57) UNAME_MACHINE=alphapca56 ;;
  980. EV6) UNAME_MACHINE=alphaev6 ;;
  981. EV67) UNAME_MACHINE=alphaev67 ;;
  982. EV68*) UNAME_MACHINE=alphaev68 ;;
  983. esac
  984. objdump --private-headers /bin/sh | grep -q ld.so.1
  985. if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
  986. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  987. ;;
  988. arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
  989. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  990. ;;
  991. arm*:Linux:*:*)
  992. set_cc_for_build
  993. if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
  994. | grep -q __ARM_EABI__
  995. then
  996. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  997. else
  998. if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  999. | grep -q __ARM_PCS_VFP
  1000. then
  1001. GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
  1002. else
  1003. GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
  1004. fi
  1005. fi
  1006. ;;
  1007. avr32*:Linux:*:*)
  1008. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1009. ;;
  1010. cris:Linux:*:*)
  1011. GUESS=$UNAME_MACHINE-axis-linux-$LIBC
  1012. ;;
  1013. crisv32:Linux:*:*)
  1014. GUESS=$UNAME_MACHINE-axis-linux-$LIBC
  1015. ;;
  1016. e2k:Linux:*:*)
  1017. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1018. ;;
  1019. frv:Linux:*:*)
  1020. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1021. ;;
  1022. hexagon:Linux:*:*)
  1023. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1024. ;;
  1025. i*86:Linux:*:*)
  1026. GUESS=$UNAME_MACHINE-pc-linux-$LIBC
  1027. ;;
  1028. ia64:Linux:*:*)
  1029. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1030. ;;
  1031. k1om:Linux:*:*)
  1032. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1033. ;;
  1034. kvx:Linux:*:*)
  1035. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1036. ;;
  1037. kvx:cos:*:*)
  1038. GUESS=$UNAME_MACHINE-unknown-cos
  1039. ;;
  1040. kvx:mbr:*:*)
  1041. GUESS=$UNAME_MACHINE-unknown-mbr
  1042. ;;
  1043. loongarch32:Linux:*:* | loongarch64:Linux:*:*)
  1044. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1045. ;;
  1046. m32r*:Linux:*:*)
  1047. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1048. ;;
  1049. m68*:Linux:*:*)
  1050. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1051. ;;
  1052. mips:Linux:*:* | mips64:Linux:*:*)
  1053. set_cc_for_build
  1054. IS_GLIBC=0
  1055. test x"${LIBC}" = xgnu && IS_GLIBC=1
  1056. sed 's/^ //' << EOF > "$dummy.c"
  1057. #undef CPU
  1058. #undef mips
  1059. #undef mipsel
  1060. #undef mips64
  1061. #undef mips64el
  1062. #if ${IS_GLIBC} && defined(_ABI64)
  1063. LIBCABI=gnuabi64
  1064. #else
  1065. #if ${IS_GLIBC} && defined(_ABIN32)
  1066. LIBCABI=gnuabin32
  1067. #else
  1068. LIBCABI=${LIBC}
  1069. #endif
  1070. #endif
  1071. #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
  1072. CPU=mipsisa64r6
  1073. #else
  1074. #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
  1075. CPU=mipsisa32r6
  1076. #else
  1077. #if defined(__mips64)
  1078. CPU=mips64
  1079. #else
  1080. CPU=mips
  1081. #endif
  1082. #endif
  1083. #endif
  1084. #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  1085. MIPS_ENDIAN=el
  1086. #else
  1087. #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  1088. MIPS_ENDIAN=
  1089. #else
  1090. MIPS_ENDIAN=
  1091. #endif
  1092. #endif
  1093. EOF
  1094. cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
  1095. eval "$cc_set_vars"
  1096. test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
  1097. ;;
  1098. mips64el:Linux:*:*)
  1099. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1100. ;;
  1101. openrisc*:Linux:*:*)
  1102. GUESS=or1k-unknown-linux-$LIBC
  1103. ;;
  1104. or32:Linux:*:* | or1k*:Linux:*:*)
  1105. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1106. ;;
  1107. padre:Linux:*:*)
  1108. GUESS=sparc-unknown-linux-$LIBC
  1109. ;;
  1110. parisc64:Linux:*:* | hppa64:Linux:*:*)
  1111. GUESS=hppa64-unknown-linux-$LIBC
  1112. ;;
  1113. parisc:Linux:*:* | hppa:Linux:*:*)
  1114. # Look for CPU level
  1115. case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  1116. PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
  1117. PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
  1118. *) GUESS=hppa-unknown-linux-$LIBC ;;
  1119. esac
  1120. ;;
  1121. ppc64:Linux:*:*)
  1122. GUESS=powerpc64-unknown-linux-$LIBC
  1123. ;;
  1124. ppc:Linux:*:*)
  1125. GUESS=powerpc-unknown-linux-$LIBC
  1126. ;;
  1127. ppc64le:Linux:*:*)
  1128. GUESS=powerpc64le-unknown-linux-$LIBC
  1129. ;;
  1130. ppcle:Linux:*:*)
  1131. GUESS=powerpcle-unknown-linux-$LIBC
  1132. ;;
  1133. riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
  1134. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1135. ;;
  1136. s390:Linux:*:* | s390x:Linux:*:*)
  1137. GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
  1138. ;;
  1139. sh64*:Linux:*:*)
  1140. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1141. ;;
  1142. sh*:Linux:*:*)
  1143. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1144. ;;
  1145. sparc:Linux:*:* | sparc64:Linux:*:*)
  1146. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1147. ;;
  1148. tile*:Linux:*:*)
  1149. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1150. ;;
  1151. vax:Linux:*:*)
  1152. GUESS=$UNAME_MACHINE-dec-linux-$LIBC
  1153. ;;
  1154. x86_64:Linux:*:*)
  1155. set_cc_for_build
  1156. CPU=$UNAME_MACHINE
  1157. LIBCABI=$LIBC
  1158. if test "$CC_FOR_BUILD" != no_compiler_found; then
  1159. ABI=64
  1160. sed 's/^ //' << EOF > "$dummy.c"
  1161. #ifdef __i386__
  1162. ABI=x86
  1163. #else
  1164. #ifdef __ILP32__
  1165. ABI=x32
  1166. #endif
  1167. #endif
  1168. EOF
  1169. cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
  1170. eval "$cc_set_abi"
  1171. case $ABI in
  1172. x86) CPU=i686 ;;
  1173. x32) LIBCABI=${LIBC}x32 ;;
  1174. esac
  1175. fi
  1176. GUESS=$CPU-pc-linux-$LIBCABI
  1177. ;;
  1178. xtensa*:Linux:*:*)
  1179. GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
  1180. ;;
  1181. i*86:DYNIX/ptx:4*:*)
  1182. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  1183. # earlier versions are messed up and put the nodename in both
  1184. # sysname and nodename.
  1185. GUESS=i386-sequent-sysv4
  1186. ;;
  1187. i*86:UNIX_SV:4.2MP:2.*)
  1188. # Unixware is an offshoot of SVR4, but it has its own version
  1189. # number series starting with 2...
  1190. # I am not positive that other SVR4 systems won't match this,
  1191. # I just have to hope. -- rms.
  1192. # Use sysv4.2uw... so that sysv4* matches it.
  1193. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
  1194. ;;
  1195. i*86:OS/2:*:*)
  1196. # If we were able to find 'uname', then EMX Unix compatibility
  1197. # is probably installed.
  1198. GUESS=$UNAME_MACHINE-pc-os2-emx
  1199. ;;
  1200. i*86:XTS-300:*:STOP)
  1201. GUESS=$UNAME_MACHINE-unknown-stop
  1202. ;;
  1203. i*86:atheos:*:*)
  1204. GUESS=$UNAME_MACHINE-unknown-atheos
  1205. ;;
  1206. i*86:syllable:*:*)
  1207. GUESS=$UNAME_MACHINE-pc-syllable
  1208. ;;
  1209. i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
  1210. GUESS=i386-unknown-lynxos$UNAME_RELEASE
  1211. ;;
  1212. i*86:*DOS:*:*)
  1213. GUESS=$UNAME_MACHINE-pc-msdosdjgpp
  1214. ;;
  1215. i*86:*:4.*:*)
  1216. UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
  1217. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  1218. GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
  1219. else
  1220. GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
  1221. fi
  1222. ;;
  1223. i*86:*:5:[678]*)
  1224. # UnixWare 7.x, OpenUNIX and OpenServer 6.
  1225. case `/bin/uname -X | grep "^Machine"` in
  1226. *486*) UNAME_MACHINE=i486 ;;
  1227. *Pentium) UNAME_MACHINE=i586 ;;
  1228. *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1229. esac
  1230. GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
  1231. ;;
  1232. i*86:*:3.2:*)
  1233. if test -f /usr/options/cb.name; then
  1234. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  1235. GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
  1236. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  1237. UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  1238. (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  1239. (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  1240. && UNAME_MACHINE=i586
  1241. (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  1242. && UNAME_MACHINE=i686
  1243. (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  1244. && UNAME_MACHINE=i686
  1245. GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
  1246. else
  1247. GUESS=$UNAME_MACHINE-pc-sysv32
  1248. fi
  1249. ;;
  1250. pc:*:*:*)
  1251. # Left here for compatibility:
  1252. # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1253. # the processor, so we play safe by assuming i586.
  1254. # Note: whatever this is, it MUST be the same as what config.sub
  1255. # prints for the "djgpp" host, or else GDB configure will decide that
  1256. # this is a cross-build.
  1257. GUESS=i586-pc-msdosdjgpp
  1258. ;;
  1259. Intel:Mach:3*:*)
  1260. GUESS=i386-pc-mach3
  1261. ;;
  1262. paragon:*:*:*)
  1263. GUESS=i860-intel-osf1
  1264. ;;
  1265. i860:*:4.*:*) # i860-SVR4
  1266. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  1267. GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
  1268. else # Add other i860-SVR4 vendors below as they are discovered.
  1269. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
  1270. fi
  1271. ;;
  1272. mini*:CTIX:SYS*5:*)
  1273. # "miniframe"
  1274. GUESS=m68010-convergent-sysv
  1275. ;;
  1276. mc68k:UNIX:SYSTEM5:3.51m)
  1277. GUESS=m68k-convergent-sysv
  1278. ;;
  1279. M680?0:D-NIX:5.3:*)
  1280. GUESS=m68k-diab-dnix
  1281. ;;
  1282. M68*:*:R3V[5678]*:*)
  1283. test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
  1284. 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)
  1285. OS_REL=''
  1286. test -r /etc/.relid \
  1287. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1288. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1289. && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1290. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1291. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1292. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1293. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1294. && { echo i486-ncr-sysv4; exit; } ;;
  1295. NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1296. OS_REL='.3'
  1297. test -r /etc/.relid \
  1298. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1299. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1300. && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  1301. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1302. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
  1303. /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
  1304. && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  1305. m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1306. GUESS=m68k-unknown-lynxos$UNAME_RELEASE
  1307. ;;
  1308. mc68030:UNIX_System_V:4.*:*)
  1309. GUESS=m68k-atari-sysv4
  1310. ;;
  1311. TSUNAMI:LynxOS:2.*:*)
  1312. GUESS=sparc-unknown-lynxos$UNAME_RELEASE
  1313. ;;
  1314. rs6000:LynxOS:2.*:*)
  1315. GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
  1316. ;;
  1317. PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
  1318. GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
  1319. ;;
  1320. SM[BE]S:UNIX_SV:*:*)
  1321. GUESS=mips-dde-sysv$UNAME_RELEASE
  1322. ;;
  1323. RM*:ReliantUNIX-*:*:*)
  1324. GUESS=mips-sni-sysv4
  1325. ;;
  1326. RM*:SINIX-*:*:*)
  1327. GUESS=mips-sni-sysv4
  1328. ;;
  1329. *:SINIX-*:*:*)
  1330. if uname -p 2>/dev/null >/dev/null ; then
  1331. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1332. GUESS=$UNAME_MACHINE-sni-sysv4
  1333. else
  1334. GUESS=ns32k-sni-sysv
  1335. fi
  1336. ;;
  1337. PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
  1338. # says <Richard.M.Bartel@ccMail.Census.GOV>
  1339. GUESS=i586-unisys-sysv4
  1340. ;;
  1341. *:UNIX_System_V:4*:FTX*)
  1342. # From Gerald Hewes <hewes@openmarket.com>.
  1343. # How about differentiating between stratus architectures? -djm
  1344. GUESS=hppa1.1-stratus-sysv4
  1345. ;;
  1346. *:*:*:FTX*)
  1347. # From seanf@swdc.stratus.com.
  1348. GUESS=i860-stratus-sysv4
  1349. ;;
  1350. i*86:VOS:*:*)
  1351. # From Paul.Green@stratus.com.
  1352. GUESS=$UNAME_MACHINE-stratus-vos
  1353. ;;
  1354. *:VOS:*:*)
  1355. # From Paul.Green@stratus.com.
  1356. GUESS=hppa1.1-stratus-vos
  1357. ;;
  1358. mc68*:A/UX:*:*)
  1359. GUESS=m68k-apple-aux$UNAME_RELEASE
  1360. ;;
  1361. news*:NEWS-OS:6*:*)
  1362. GUESS=mips-sony-newsos6
  1363. ;;
  1364. R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1365. if test -d /usr/nec; then
  1366. GUESS=mips-nec-sysv$UNAME_RELEASE
  1367. else
  1368. GUESS=mips-unknown-sysv$UNAME_RELEASE
  1369. fi
  1370. ;;
  1371. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1372. GUESS=powerpc-be-beos
  1373. ;;
  1374. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1375. GUESS=powerpc-apple-beos
  1376. ;;
  1377. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1378. GUESS=i586-pc-beos
  1379. ;;
  1380. BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
  1381. GUESS=i586-pc-haiku
  1382. ;;
  1383. ppc:Haiku:*:*) # Haiku running on Apple PowerPC
  1384. GUESS=powerpc-apple-haiku
  1385. ;;
  1386. *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
  1387. GUESS=$UNAME_MACHINE-unknown-haiku
  1388. ;;
  1389. SX-4:SUPER-UX:*:*)
  1390. GUESS=sx4-nec-superux$UNAME_RELEASE
  1391. ;;
  1392. SX-5:SUPER-UX:*:*)
  1393. GUESS=sx5-nec-superux$UNAME_RELEASE
  1394. ;;
  1395. SX-6:SUPER-UX:*:*)
  1396. GUESS=sx6-nec-superux$UNAME_RELEASE
  1397. ;;
  1398. SX-7:SUPER-UX:*:*)
  1399. GUESS=sx7-nec-superux$UNAME_RELEASE
  1400. ;;
  1401. SX-8:SUPER-UX:*:*)
  1402. GUESS=sx8-nec-superux$UNAME_RELEASE
  1403. ;;
  1404. SX-8R:SUPER-UX:*:*)
  1405. GUESS=sx8r-nec-superux$UNAME_RELEASE
  1406. ;;
  1407. SX-ACE:SUPER-UX:*:*)
  1408. GUESS=sxace-nec-superux$UNAME_RELEASE
  1409. ;;
  1410. Power*:Rhapsody:*:*)
  1411. GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
  1412. ;;
  1413. *:Rhapsody:*:*)
  1414. GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
  1415. ;;
  1416. arm64:Darwin:*:*)
  1417. GUESS=aarch64-apple-darwin$UNAME_RELEASE
  1418. ;;
  1419. *:Darwin:*:*)
  1420. UNAME_PROCESSOR=`uname -p`
  1421. case $UNAME_PROCESSOR in
  1422. unknown) UNAME_PROCESSOR=powerpc ;;
  1423. esac
  1424. if command -v xcode-select > /dev/null 2> /dev/null && \
  1425. ! xcode-select --print-path > /dev/null 2> /dev/null ; then
  1426. # Avoid executing cc if there is no toolchain installed as
  1427. # cc will be a stub that puts up a graphical alert
  1428. # prompting the user to install developer tools.
  1429. CC_FOR_BUILD=no_compiler_found
  1430. else
  1431. set_cc_for_build
  1432. fi
  1433. if test "$CC_FOR_BUILD" != no_compiler_found; then
  1434. if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1435. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1436. grep IS_64BIT_ARCH >/dev/null
  1437. then
  1438. case $UNAME_PROCESSOR in
  1439. i386) UNAME_PROCESSOR=x86_64 ;;
  1440. powerpc) UNAME_PROCESSOR=powerpc64 ;;
  1441. esac
  1442. fi
  1443. # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
  1444. if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
  1445. (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1446. grep IS_PPC >/dev/null
  1447. then
  1448. UNAME_PROCESSOR=powerpc
  1449. fi
  1450. elif test "$UNAME_PROCESSOR" = i386 ; then
  1451. # uname -m returns i386 or x86_64
  1452. UNAME_PROCESSOR=$UNAME_MACHINE
  1453. fi
  1454. GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
  1455. ;;
  1456. *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1457. UNAME_PROCESSOR=`uname -p`
  1458. if test "$UNAME_PROCESSOR" = x86; then
  1459. UNAME_PROCESSOR=i386
  1460. UNAME_MACHINE=pc
  1461. fi
  1462. GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
  1463. ;;
  1464. *:QNX:*:4*)
  1465. GUESS=i386-pc-qnx
  1466. ;;
  1467. NEO-*:NONSTOP_KERNEL:*:*)
  1468. GUESS=neo-tandem-nsk$UNAME_RELEASE
  1469. ;;
  1470. NSE-*:NONSTOP_KERNEL:*:*)
  1471. GUESS=nse-tandem-nsk$UNAME_RELEASE
  1472. ;;
  1473. NSR-*:NONSTOP_KERNEL:*:*)
  1474. GUESS=nsr-tandem-nsk$UNAME_RELEASE
  1475. ;;
  1476. NSV-*:NONSTOP_KERNEL:*:*)
  1477. GUESS=nsv-tandem-nsk$UNAME_RELEASE
  1478. ;;
  1479. NSX-*:NONSTOP_KERNEL:*:*)
  1480. GUESS=nsx-tandem-nsk$UNAME_RELEASE
  1481. ;;
  1482. *:NonStop-UX:*:*)
  1483. GUESS=mips-compaq-nonstopux
  1484. ;;
  1485. BS2000:POSIX*:*:*)
  1486. GUESS=bs2000-siemens-sysv
  1487. ;;
  1488. DS/*:UNIX_System_V:*:*)
  1489. GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
  1490. ;;
  1491. *:Plan9:*:*)
  1492. # "uname -m" is not consistent, so use $cputype instead. 386
  1493. # is converted to i386 for consistency with other x86
  1494. # operating systems.
  1495. if test "${cputype-}" = 386; then
  1496. UNAME_MACHINE=i386
  1497. elif test "x${cputype-}" != x; then
  1498. UNAME_MACHINE=$cputype
  1499. fi
  1500. GUESS=$UNAME_MACHINE-unknown-plan9
  1501. ;;
  1502. *:TOPS-10:*:*)
  1503. GUESS=pdp10-unknown-tops10
  1504. ;;
  1505. *:TENEX:*:*)
  1506. GUESS=pdp10-unknown-tenex
  1507. ;;
  1508. KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
  1509. GUESS=pdp10-dec-tops20
  1510. ;;
  1511. XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
  1512. GUESS=pdp10-xkl-tops20
  1513. ;;
  1514. *:TOPS-20:*:*)
  1515. GUESS=pdp10-unknown-tops20
  1516. ;;
  1517. *:ITS:*:*)
  1518. GUESS=pdp10-unknown-its
  1519. ;;
  1520. SEI:*:*:SEIUX)
  1521. GUESS=mips-sei-seiux$UNAME_RELEASE
  1522. ;;
  1523. *:DragonFly:*:*)
  1524. DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
  1525. GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
  1526. ;;
  1527. *:*VMS:*:*)
  1528. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1529. case $UNAME_MACHINE in
  1530. A*) GUESS=alpha-dec-vms ;;
  1531. I*) GUESS=ia64-dec-vms ;;
  1532. V*) GUESS=vax-dec-vms ;;
  1533. esac ;;
  1534. *:XENIX:*:SysV)
  1535. GUESS=i386-pc-xenix
  1536. ;;
  1537. i*86:skyos:*:*)
  1538. SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
  1539. GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
  1540. ;;
  1541. i*86:rdos:*:*)
  1542. GUESS=$UNAME_MACHINE-pc-rdos
  1543. ;;
  1544. i*86:Fiwix:*:*)
  1545. GUESS=$UNAME_MACHINE-pc-fiwix
  1546. ;;
  1547. *:AROS:*:*)
  1548. GUESS=$UNAME_MACHINE-unknown-aros
  1549. ;;
  1550. x86_64:VMkernel:*:*)
  1551. GUESS=$UNAME_MACHINE-unknown-esx
  1552. ;;
  1553. amd64:Isilon\ OneFS:*:*)
  1554. GUESS=x86_64-unknown-onefs
  1555. ;;
  1556. *:Unleashed:*:*)
  1557. GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
  1558. ;;
  1559. *:Ironclad:*:*)
  1560. GUESS=$UNAME_MACHINE-unknown-ironclad
  1561. ;;
  1562. esac
  1563. # Do we have a guess based on uname results?
  1564. if test "x$GUESS" != x; then
  1565. echo "$GUESS"
  1566. exit
  1567. fi
  1568. # No uname command or uname output not recognized.
  1569. set_cc_for_build
  1570. cat > "$dummy.c" <<EOF
  1571. #ifdef _SEQUENT_
  1572. #include <sys/types.h>
  1573. #include <sys/utsname.h>
  1574. #endif
  1575. #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
  1576. #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
  1577. #include <signal.h>
  1578. #if defined(_SIZE_T_) || defined(SIGLOST)
  1579. #include <sys/utsname.h>
  1580. #endif
  1581. #endif
  1582. #endif
  1583. main ()
  1584. {
  1585. #if defined (sony)
  1586. #if defined (MIPSEB)
  1587. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1588. I don't know.... */
  1589. printf ("mips-sony-bsd\n"); exit (0);
  1590. #else
  1591. #include <sys/param.h>
  1592. printf ("m68k-sony-newsos%s\n",
  1593. #ifdef NEWSOS4
  1594. "4"
  1595. #else
  1596. ""
  1597. #endif
  1598. ); exit (0);
  1599. #endif
  1600. #endif
  1601. #if defined (NeXT)
  1602. #if !defined (__ARCHITECTURE__)
  1603. #define __ARCHITECTURE__ "m68k"
  1604. #endif
  1605. int version;
  1606. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1607. if (version < 4)
  1608. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1609. else
  1610. printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1611. exit (0);
  1612. #endif
  1613. #if defined (MULTIMAX) || defined (n16)
  1614. #if defined (UMAXV)
  1615. printf ("ns32k-encore-sysv\n"); exit (0);
  1616. #else
  1617. #if defined (CMU)
  1618. printf ("ns32k-encore-mach\n"); exit (0);
  1619. #else
  1620. printf ("ns32k-encore-bsd\n"); exit (0);
  1621. #endif
  1622. #endif
  1623. #endif
  1624. #if defined (__386BSD__)
  1625. printf ("i386-pc-bsd\n"); exit (0);
  1626. #endif
  1627. #if defined (sequent)
  1628. #if defined (i386)
  1629. printf ("i386-sequent-dynix\n"); exit (0);
  1630. #endif
  1631. #if defined (ns32000)
  1632. printf ("ns32k-sequent-dynix\n"); exit (0);
  1633. #endif
  1634. #endif
  1635. #if defined (_SEQUENT_)
  1636. struct utsname un;
  1637. uname(&un);
  1638. if (strncmp(un.version, "V2", 2) == 0) {
  1639. printf ("i386-sequent-ptx2\n"); exit (0);
  1640. }
  1641. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1642. printf ("i386-sequent-ptx1\n"); exit (0);
  1643. }
  1644. printf ("i386-sequent-ptx\n"); exit (0);
  1645. #endif
  1646. #if defined (vax)
  1647. #if !defined (ultrix)
  1648. #include <sys/param.h>
  1649. #if defined (BSD)
  1650. #if BSD == 43
  1651. printf ("vax-dec-bsd4.3\n"); exit (0);
  1652. #else
  1653. #if BSD == 199006
  1654. printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1655. #else
  1656. printf ("vax-dec-bsd\n"); exit (0);
  1657. #endif
  1658. #endif
  1659. #else
  1660. printf ("vax-dec-bsd\n"); exit (0);
  1661. #endif
  1662. #else
  1663. #if defined(_SIZE_T_) || defined(SIGLOST)
  1664. struct utsname un;
  1665. uname (&un);
  1666. printf ("vax-dec-ultrix%s\n", un.release); exit (0);
  1667. #else
  1668. printf ("vax-dec-ultrix\n"); exit (0);
  1669. #endif
  1670. #endif
  1671. #endif
  1672. #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
  1673. #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
  1674. #if defined(_SIZE_T_) || defined(SIGLOST)
  1675. struct utsname *un;
  1676. uname (&un);
  1677. printf ("mips-dec-ultrix%s\n", un.release); exit (0);
  1678. #else
  1679. printf ("mips-dec-ultrix\n"); exit (0);
  1680. #endif
  1681. #endif
  1682. #endif
  1683. #if defined (alliant) && defined (i860)
  1684. printf ("i860-alliant-bsd\n"); exit (0);
  1685. #endif
  1686. exit (1);
  1687. }
  1688. EOF
  1689. $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
  1690. { echo "$SYSTEM_NAME"; exit; }
  1691. # Apollos put the system type in the environment.
  1692. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
  1693. echo "$0: unable to guess system type" >&2
  1694. case $UNAME_MACHINE:$UNAME_SYSTEM in
  1695. mips:Linux | mips64:Linux)
  1696. # If we got here on MIPS GNU/Linux, output extra information.
  1697. cat >&2 <<EOF
  1698. NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
  1699. the system type. Please install a C compiler and try again.
  1700. EOF
  1701. ;;
  1702. esac
  1703. cat >&2 <<EOF
  1704. This script (version $timestamp), has failed to recognize the
  1705. operating system you are using. If your script is old, overwrite *all*
  1706. copies of config.guess and config.sub with the latest versions from:
  1707. https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
  1708. and
  1709. https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
  1710. EOF
  1711. our_year=`echo $timestamp | sed 's,-.*,,'`
  1712. thisyear=`date +%Y`
  1713. # shellcheck disable=SC2003
  1714. script_age=`expr "$thisyear" - "$our_year"`
  1715. if test "$script_age" -lt 3 ; then
  1716. cat >&2 <<EOF
  1717. If $0 has already been updated, send the following data and any
  1718. information you think might be pertinent to config-patches@gnu.org to
  1719. provide the necessary information to handle your system.
  1720. config.guess timestamp = $timestamp
  1721. uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1722. uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1723. uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1724. uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1725. /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1726. /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1727. hostinfo = `(hostinfo) 2>/dev/null`
  1728. /bin/universe = `(/bin/universe) 2>/dev/null`
  1729. /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1730. /bin/arch = `(/bin/arch) 2>/dev/null`
  1731. /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1732. /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1733. UNAME_MACHINE = "$UNAME_MACHINE"
  1734. UNAME_RELEASE = "$UNAME_RELEASE"
  1735. UNAME_SYSTEM = "$UNAME_SYSTEM"
  1736. UNAME_VERSION = "$UNAME_VERSION"
  1737. EOF
  1738. fi
  1739. exit 1
  1740. # Local variables:
  1741. # eval: (add-hook 'before-save-hook 'time-stamp)
  1742. # time-stamp-start: "timestamp='"
  1743. # time-stamp-format: "%:y-%02m-%02d"
  1744. # time-stamp-end: "'"
  1745. # End: