1
0

config.guess 47 KB

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