591 Commits

Author SHA1 Message Date
Bernhard Voelker
03087cbd51 Fix GPLv3 license headers to use a comma instead of semicolon
See: https://www.gnu.org/licenses/gpl-3.0.html#howto

Update license headers automatically using the following script:

  $ git grep -l 'Foundation; either version 3' \
    | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'

* config.guess: Adjust via the above command.
(timestamp): Update.
* config.sub: Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-01-03 23:16:50 +00:00
Dmitry V. Levin
dacec0cff2 Update copyright years
* config.guess: Update copyright years.
* config.sub: Likewise.
* testsuite/config-guess.sh: Likewise.
* testsuite/config-sub.sh: Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
2022-01-01 08:00:00 +00:00
Andreas F. Borchert
9e4c79f5fc config.guess: x86_64-pc-solaris2.11 is not properly recognized
config.guess guesses Solaris 11 to run on a 32-bit platform
despite Solaris 11 no longer supporting any 32-bit platform.

See the following code at lines 434 to 445:

| SUN_ARCH=i386
| # If there is a compiler, see if it is configured for 64-bit objects.
| # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
| # This test works for both compilers.
| if test "$CC_FOR_BUILD" != no_compiler_found; then
|     if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
|         (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
|         grep IS_64BIT_ARCH >/dev/null
|     then
|         SUN_ARCH=x86_64
|     fi
| fi

If "cc" is installed, i.e. the Oracle Studio compiler, this one is
chosen for $CC_FOR_BUILD.  This compiler, the gcc provided by Oracle
and also gcc bootstrapped from sources on that platform with a default
configuration will by default generate 32-bit binaries -- even on
a 64-bit platform.  And __amd64 will not be defined for compilations
targeting a 32-bit platform.  This is different from the corresponding
behaviour on GNU/Linux systems where the local platform is targeted by
default.

Thus, as long as you do not add "-m64" or if you have a custom-built
gcc which defaults to 64 bit, you will get 32-bit binaries on Solaris
despite living on a 64-bit platform.

* config.guess (i86pc:SunOS:5.*:* || i86xen:SunOS:5.*:*): Adapt the
test by adding the "-m64" flag.  This will work properly for Solaris
10 as well (the last Solaris release that supported x86 32-bit
platforms).
* doc/config.guess.1: Regenerate.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-11-30 20:18:10 +00:00
Jordi Sanfeliu
a013aac61e Recognize Fiwix
$ make check
cd testsuite && bash config-guess.sh && rm uname
PASS: config.guess checks (137 tests)
cd testsuite && bash config-sub.sh
PASS: config.sub checks (882 tests)
PASS: config.sub idempotency checks (819 tests)
PASS: config.sub canonicalise each config.guess testcase (137 tests)

* config.guess (i*86:Fiwix:*:*): Recognize.
* config.sub (fiwix*): Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data: Add a test case for Fiwix.
* testsuite/config-sub.data (i386-fiwix): New test.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-10-27 14:35:57 +00:00
Vineet Gupta
45e181800a Recognize arc32
This is the 32-bit variant of ARCv3 ISA (which is not compatible with the
32-bit ARCv2 ISA)

| make check
| cd testsuite && bash config-guess.sh && rm uname
| PASS: config.guess checks (136 tests)
| cd testsuite && bash config-sub.sh
| PASS: config.sub checks (864 tests)
| PASS: config.sub idempotency checks (801 tests)
| PASS: config.sub canonicalise each config.guess testcase (136 tests)

* config.guess (arc32:Linux:*:*): Recognize.
* config.sub (arc32): Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data: Add a test case for arc32.
* testsuite/config-sub.data (arc32, arc*-elf): Add test cases.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-06-04 04:01:25 +00:00
Jacob Bachmeyer
598afeec95 config.guess: manual fixups after previous automatic patch
The tool could not handle command substitutions that span lines, but
fortunately there were only two such substitutions in the script.

The test for which universe is active on Pyramid is rewritten into a
case block because it was the only use of a command substitution as an
argument to the test command, which would require quoting.

* config.guess: Rewrite "if" for Pyramid systems to "case".
2021-05-26 04:59:02 +00:00
Jacob Bachmeyer
d70c4fa934 config.guess: replace POSIX $( ) with classic throughout
The previous replacement of backticks with POSIX command substitutions
was ill-considered and illogical: this script recognizes many archaic
machine types that probably never had POSIX shells, therefore it needs
to be able to run successfully under pre-POSIX shells.

This patch was generated using the included GNU Awk program.

* config.guess: Revert POSIX command substitutions to classic form.
* patch-6.gawk: Store the tool that produced the automated patch.
2021-05-26 04:47:05 +00:00
Jacob Bachmeyer
12fcf67c91 config.guess: manual fixup after previous automated patches
This patch provides the special handling for the GNU system.  As these
were two small and unique edits, they were not included in the scripts.

This patch also cleans up other minor issues that must be addressed
before reverting to classic command substitutions and updates
"shellcheck" directives to account for changes in this script and the
change in "shellcheck" towards reporting individual portability issues.
2021-05-26 03:43:34 +00:00
Jacob Bachmeyer
b1e61adfaa config.guess: automatic fixups after previous automated patch
This patch was generated using the following command:

  sed -i config.guess \
      -e '/="[^"]\+"\(-\|$\)/s/="\([^"([:space:])]\+\)"/=\1/' \
      -e '/="[^"]\+"[[:alnum:]]/s/="\$\([^([:space:])]\+\)"/=${\1}/' \
      -e \
'/\$(echo[^|]\+|/s/\([^[:space:]]\)[[:space:]]*|[[:space:]]*sed/\1 | sed/g'

* config.guess: Remove unneeded quotes in other variable assignments,
standardize spacing for "echo ... | sed" substitutions.
2021-05-26 03:20:24 +00:00
Jacob Bachmeyer
649a106360 config.guess: remove unneeded quotes and factor command substitutions
This is further cleanup and simplifies some constructs that can confuse
Emacs' syntax highlighting while generally reducing required quoting.

This patch was generated using the included GNU Awk program.

* config.guess: Remove unneeded variable quotes and factor out command
substitutions when setting GUESS.
* patch-3.gawk: Store the tool that produced the automated patch.
2021-05-26 03:01:22 +00:00
Jacob Bachmeyer
3865afa669 config.guess: manual fixups after previous automatic patch
* config.guess: Adjust a few "leftover" cases that the tool could not
easily recognize and fixes comment indentation in a few other special
cases.
2021-05-25 04:27:42 +00:00
Jacob Bachmeyer
59a37e44b8 config.guess: use intermediate variable with uname results
This will allow quoting to be significantly simplified in another
pass through the file.

This patch was generated using the included GNU Awk program.

* config.guess: Use GUESS variable to hold results of uname analysis.
* patch-1.gawk: Store the tool that produced the automated patch.
2021-05-25 04:05:16 +00:00
Jacob Bachmeyer
d9728ee231 config.guess: introduce intermediate variable with uname results
This will allow quoting to be significantly simplified in another
pass through the file.

* config.guess: Introduce GUESS variable to hold results of uname analysis.
2021-05-25 04:05:16 +00:00
Dmitry V. Levin
4550d2f15b config.guess: fix shellcheck warning SC2154
While, according to Plan 9 documentation, the environment variable
$cputype is set to the name of the kernel's CPU's architecture,
shellcheck warns that cputype is referenced but not assigned.
Be on the safe side and do not use cputype if it is not defined
or empty.

* config.guess (*:Plan9:*:*): Fix shellcheck warning SC2154.
2021-05-24 08:00:00 +00:00
Dmitry V. Levin
9a37c126ce config.guess: remove redundant quotes in case commands
According to the GNU Autoconf Portable Shell Programming manual,
the Bourne shell does not systematically split variables and back-quoted
expressions, in particular on the right-hand side of assignments and in
the argument of 'case'.

The change is made automatically using the following command:
$ sed -E -i 's/(\<case )"(\$[^"]+)"( in\>)/\1\2\3/' config.guess

* config.guess: Simplify case commands by removing quotes around the
argument.

Suggested-by: Jacob Bachmeyer <jcb@gnu.org>
2021-05-24 08:00:00 +00:00
Dmitry V. Levin
185e597749 config.guess: simplify exit status workaround on alphaev67-dec-osf5.1
Commit 29865ea8a5622cdd80b7a69a0afa78004b4cd311 introduced an exit trap
reset before exiting to avoid a spurious non-zero exit status on
alphaev67-dec-osf5.1.  Simplify that code a bit by moving the exit trap
reset around.

* config.guess (alpha:OSF1:*:*): Reset exit trap earlier.
* doc/config.guess.1: Regenerate.
2021-05-24 08:00:00 +00:00
Vineet Gupta
491e04557e Recognize arc64
This paves way for setting up arc64 software ecosystem.

$ make check
cd testsuite && bash config-guess.sh && rm uname
PASS: config.guess checks (136 tests)
cd testsuite && bash config-sub.sh
PASS: config.sub checks (853 tests)
PASS: config.sub idempotency checks (790 tests)
PASS: config.sub canonicalise each config.guess testcase (136 tests)

* config.guess (arc64:Linux:*:*): Recognize.
* config.sub (arc64): Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data: Add a test case for arc64.
* testsuite/config-sub.data (arc64, arc*-elf): Add test cases.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-04-21 19:51:18 +00:00
Purple Rain
6c5532f345 config.guess: add SecBSD support
* config.guess (*:SecBSD:*:*): Recognize.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data: Add a test case.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-04-16 22:26:32 +00:00
Kalamatee
6faca61810 config.guess: update AROS system detection
* config.guess: Recognize *:AROS:*:*.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data: Add test cases.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-01-25 20:35:13 +00:00
M. Levinson
441e7e4bd4 config.guess: fix shell variable quoting bug
* config.guess (*:NetBSD:*:*): Spell out the full sysctl command twice
instead of using a shell variable.
* doc/config.guess.1: Regenerate.

Fixes: 827c77253b396c07306927b2a4b794a3251c48eb
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-01-19 13:49:34 +00:00
Dmitry V. Levin
0045dea533 Update copyright years
* config.guess: Update copyright years.
* config.sub: Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
2021-01-01 08:00:00 +00:00
Kito Cheng
8e0c6ffd5c Recognize riscv32be and riscv64be
Recently RISC-V community got patches big-endian support for binutils,
and we'd like to accept that, however before accepting that I think it
would be better to upstream config.sub and config.guess change here :)

It's my check result on Ubuntu 18.04:

 $ make check
 cd testsuite && bash config-guess.sh && rm uname
 PASS: config.guess checks (131 tests)
 cd testsuite && bash config-sub.sh
 PASS: config.sub checks (830 tests)
 PASS: config.sub idempotency checks (767 tests)
 PASS: config.sub canonicalise each config.guess testcase (131 tests)

* config.guess (riscv32be:Linux:*:*, riscv64be:Linux:*:*): Recognize.
* config.sub (riscv32be, riscv64be): Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data: Add test cases for riscv32be, and riscv64be.
* testsuite/config-sub.data (riscv32be, riscv64be): Add test cases.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-31 07:27:52 +00:00
Xiaotian Wu
c8ddc8472f Recognize loongarch32, loongarch64, and loongarchx32
* config.guess (loongarch32:Linux:*:*, loongarch64:Linux:*:*,
loongarchx32:Linux:*:*): Recognize.
* config.sub (loongarch32, loongarch64, loongarchx32): Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data: Add test cases for loongarch32,
loongarch64, and loongarchx32.
* testsuite/config-sub.data (loongarch32, loongarch64, loongarchx32):
Add test cases.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-22 08:00:00 +00:00
Dmitry V. Levin
888c8e3d5f Update URLs of the latest version of config.guess and config.sub scripts
Prefer cgit URLs over gitweb as the former are usually served faster:
$ time -f %e wget -q 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess'
1.06
$ time -f %e wget -q 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess'
0.73

* config.guess: Prefer cgit URLs over gitweb.
(timestamp): Update.
* config.sub: Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
2020-11-19 08:00:00 +00:00
Dmitry V. Levin
edcc7bbb5d config.guess: combine two heuristics to detect musl libc
Apparently, this is needed to correctly detect musl libc in different
versions of Alpine Linux.

According to
https://lists.gnu.org/archive/html/config-patches/2020-09/msg00002.html,
the ldd based check does not work for some old versions of the Alpine Linux,
and, according to
https://lists.gnu.org/archive/html/config-patches/2020-11/msg00002.html,
the compiler may not be available in a fresh Alpine container.

The ldd based check is essentially the same as the check that was
introduced by commit 3d00f60242f1726fc6eaa38e09435a969ee7ebe5, it is
performed iff the compiler based check could not give a definitive
answer.

Reported-by: Cheng XU <xucheng@me.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-11-17 08:00:00 +00:00
Ben Elliston
77632d92f2 Update timestamps. 2020-11-07 15:46:23 +11:00
Ben Elliston
95c8d9a294 * config.sub, config.guess: Replace backtick .. substitutions
with POSIX $(..) command substitutions throughout.
	* Makefile (shellcheck): Don't exclude message SC2006.
2020-11-07 15:38:19 +11:00
Rin Okuyama
1c43980155 * config.guess (*:NetBSD:*:*): Handle aarch64eb.
* testsuite/config-guess.data: Add test cases.

Signed-off-by: Ben Elliston <bje@gnu.org>
2020-10-22 00:05:38 +11:00
Bruno Haible
4aa554d72b * config.guess: Don't use 'ldd --version' to determine the presence of
musl libc, as this fails on Alpine Linux 3.10.

Signed-off-by: Ben Elliston <bje@gnu.org>
2020-09-20 14:21:00 +10:00
Issam E. Maghni
0b5188819b * config.guess: Replace "if [ EXPR ]" with "if test EXPR".
* config.sub: Likewise.
	* testsuite/config-guess.sh: Likewise.
	* testsuite/config-sub.sh: Likewise.

Signed-off-by: Ben Elliston <bje@gnu.org>
2020-08-17 13:36:41 +10:00
Ben Elliston
2593751ef2 * config.guess (arm64:Darwin:*:*): Recognise.
* testsuite/config-guess.data: Add a test case.
2020-07-12 18:21:33 +10:00
Jessica Clarke
bd1cbeed14 * config.guess (x86_64:Linux:*:*): Detect x32 ABI. This is
currently only supported when CC_FOR_BUILD is available, as that
	ultimately governs what the native ABI is.

Signed-off-by: Ben Elliston <bje@air.net.au>
2020-06-15 11:48:25 +10:00
Ben Elliston
fb5be05bb0 * config.guess: Instruct the user to send information about their
system only if the script they are running has a timestamped year
	of less than three years ago.
2020-04-26 13:27:26 +10:00
Ben Elliston
5256817ace * config.guess: Update copyright years.
* config.sub: Likewise.
	* doc/config.guess.1: Regenerate.
	* doc/config.sub.1: Likewise.
2020-01-01 19:36:58 +11:00
Ben Elliston
c542caa003 * config.guess (set_cc_for_build): Prevent multiple calls by
chechking if $tmp is already set. We can't check CC_FOR_BUILD as
	the user may set it externally. Thanks to Torbjörn Granlund for
	the bug report.
2019-12-21 13:01:01 +11:00
Torbjörn Granlund
6f5b719255 * config.guess (alpha:Linux:*:*): Guard against missing
/proc/cpuinfo by redirecting standard error to /dev/null.

Signed-off-by: Ben Elliston <bje@gnu.org>
2019-12-21 12:01:43 +11:00
Daniel Bittman
fadac5a0ed * config.guess (*:Twizzler:*:*): New.
* config.sub (-twizzler*): New.
	* testsuite/config-guess.data: Add test cases.
	* testsuite/config-sub.data: Ditto.

Signed-off-by: Ben Elliston <bje@gnu.org>
2019-09-12 09:56:40 +10:00
Ben Elliston
afb0b3e1d7 * config.guess (mips:OSF1:*.*): Whitespace cleanup. 2019-07-24 10:16:30 +10:00
Ben Elliston
f83dbaa146 * config.guess (*:OS108:*:*): Recognise new OS.
* testsuite/config-guess.data: Add a test case.
2019-06-10 23:36:57 +10:00
Ben Elliston
3f4274dfc2 * config.guess (*:Darwin:*:*): Run xcode-select to determine if a
system compiler is installed. If not, do not run set_cc_for_build,
	as the default cc will open a dialog box asking to install
	Xcode. If no C compiler is available, guess based on uname -p and
	uname -m.
2019-05-28 23:39:01 +10:00
Ben Elliston
bad92f031d Revert. Fix extraneous 'fi'. 2019-05-28 15:29:39 +10:00
Ben Elliston
9bbefc160a * config.guess (*:Darwin:*:*): Simplify UNAME_PROCESSOR. 2019-05-28 12:59:21 +10:00
Paul Eggert
b98424c249 * config.guess: Remove space after "#endif", as Gnulib and some
other downstream projects frown on trailing white space.

Signed-off-by: Ben Elliston <bje@gnu.org>
2019-05-01 06:29:40 +10:00
Urs Janßen
798218fde9 * config.guess: Use utsname version instead of preprocessor macros
on vax-dec-ultrix and mips-dec-ultrix versions >= 3.0.

Signed-off-by: Ben Elliston <bje@gnu.org>
2019-04-28 12:22:19 +10:00
YunQiang Su
fe616913d7 * config.guess (mips:Linux:*:*): Detect ISA R6.
Signed-off-by: Ben Elliston <bje@gnu.org>
2019-03-08 13:12:21 +11:00
Urs Janßen
57c365fdb4 * config.guess (m68k-sony-newsos, mips-dec-ultrix3): Restore C
program that detects these systems.

Signed-off-by: Ben Elliston <bje@gnu.org>
2019-03-04 09:55:18 +11:00
Urs Janßen
6bf486266c * config.guess (i*86:*:5:[678]*): Fix Unixware output.
Signed-off-by: Ben Elliston <bje@gnu.org>
2019-02-19 16:07:32 +11:00
Ben Elliston
2221f7d58e Revert:
2019-01-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config.guess (sun4*:SunOS:5.*:*): Return sparcv9-sun-solaris2.*
	with 64-bit compiler.
	(tadpole*:SunOS:5.*:*): Likewise.
2019-01-15 10:26:10 +11:00
Ben Elliston
5fe51ffd1b * config.guess (sun4*:SunOS:5.*:*): Return sparcv9-sun-solaris2.*
with 64-bit compiler.
	(tadpole*:SunOS:5.*:*): Likewise.
2019-01-03 11:59:32 +11:00
Ben Elliston
c701dfb820 * config.guess: Update copyright years.
* config.sub: Likewise.
	* doc/config.guess.1: Regenerate.
	* doc/config.sub.1: Likewise.
2019-01-01 08:15:34 +11:00