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