libmspack 0.10.1.2 → 0.11.0

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