config.guess 48 KB

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