config.guess 48 KB

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