config.guess 47 KB

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