1252 Commits

Author SHA1 Message Date
Dmitry V. Levin
023274ab8d testsuite: add tests for the aarch64c change
* testsuite/config-guess.data (aarch64c-unknown-freebsd14.0): New entry.
* testsuite/config-sub.data (aarch64c-freebsd14.0,
aarch64c-unknown-freebsd14.0): New entries.
2023-08-24 08:00:00 +00:00
Urs Janßen
4e60c54be7 config.sub: allow aarch64c-unknown-freebsd
config.guess says aarch64c-unknown-freebsd14.0 (cfarm240.cfarm.net,
an Arm Morello SoC, quad-core aarch64 Neoverse N1-based CPU
implementing CHERI), so let config.sub allow it.

* config.sub (aarch64c): Recognize.
* doc/config.sub.1: Regenerate.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2023-08-23 19:47:38 +00:00
Dmitry V. Levin
e4786449e1 config.guess: invoke "uname -p" from PATH for non-arm FreeBSD
Starting with commit afe1fa96bf32, "uname -p" from PATH is invoked in
case of FreeBSD on arm, while in other FreeBSD cases it was invoked
using a full pathname as "/usr/bin/uname -p".  Fix this inconsistency
and invoke "uname -p" from PATH for all FreeBSD cases.  This also allows
to test non-arm FreeBSD cases.

* config.guess (*:FreeBSD:*:*): Invoke "uname -p" from PATH.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data (x86_64-unknown-freebsd5.2,
i586-unknown-freebsd7.0): Reintroduce the tests removed by commit
68873f3c11c6.
2023-08-22 08:00:00 +00:00
Bruno Haible
021155df7f config.guess: Detect Android (as opposed to GNU/Linux)
Here's a patch to recognize Android environments.

Such environments are "apps" with POSIX-like tools. Today, the most frequently
used one is Termux [1][2][3]; on devices with Android versions before 5.0
one can use Terminal-IDE [4][5].

config.sub already supports this environment:

  $ sh config.sub armv7l-linux-androideabi
  armv7l-unknown-linux-androideabi

I've built many GNU packages in this environment, with the following recipe:
  CONFIG_SHELL=$PREFIX/bin/sh; export CONFIG_SHELL
  CC="clang -ferror-limit=0" CXX="clang++ -ferror-limit=0"; export CC CXX
  ./configure --host=armv7l-linux-androideabi --prefix=$HOME/local

The Termux people have compiled or ported more than 1000 packages as well [6].

But the requirement to pass the --host parameter each time is an annoyance.
Without it, based only on the results of uname, config.guess guesses

  $ sh config.guess
  armv7l-unknown-linux-gnueabi

and many configuration results are wrong (because Android has many functions
in libc without declaring them in the .h files, depending on the so-called
"Android API level"), leading to many compilation errors.

With the attached patch, it produces

  $ sh config.guess
  armv7l-unknown-linux-androideabi

The patch does not include an addition to the config.guess test suite, since
the uname values are:
  $ uname -m
  armv7l
  $ uname -r
  4.19.127
  $ uname -s
  Linux
  $ uname -v
  #1 SMP PREEMPT Tue Apr 4 16:54:58 IST 2023
  $ uname -p
  unknown
which maps to armv7l-unknown-linux-gnueabi.

[1] https://github.com/termux/termux-app
[2] https://f-droid.org/en/packages/com.termux/
[3] https://wiki.termux.com/wiki/Main_Page
[4] https://en.wikibooks.org/wiki/Android/Terminal_IDE
[5] http://www.spartacusrex.com/terminalide.htm
[6] https://github.com/termux/termux-packages/tree/master/packages

* config.guess (Linux|GNU|GNU/*): Detect Android.
* doc/config.guess.1: Regenerate.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2023-08-17 09:49:32 +00:00
Adam Joseph
6c78704d54 config.sub: add javascript-*-ghcjs
GHC has been using a custom triple "javascript-unknown-ghcjs" for
their (non asm.js, non wasm) javascript-emitting kernel-less target.

This triple is a bit of an oddball, so the support for it is highly
restricted in order to discourage further proliferation of the
javascript "cpu" or ghcjs "operating system", which are valid only
in combination with each other.

* config.sub (javascript-*-ghcjs): Allow.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data (javascript-ghcjs,
javascript-unknown-ghcjs): New entries.

Link: 6636b67023
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2023-08-16 11:59:26 +00:00
Adam Joseph
2a7c4b64d4 testsuite: add coverage for vendor-clobbering
While reimplementing config.sub for use in a situation where no bash
interpreter was available, I discovered several oddities about
config.sub's behavior.

One such oddity was the fact that an explicitly-provided vendor will
be clobbered by the inferred vendor for three cpu types: microblaze,
s390, and mmix.  This commit adds test cases for this clobbering
behavior, so that unintentional changes to it will be noticed.

* testsuite/config-sub.data (microblaze-unknown-elf, mmix-unknown-elf,
s390-unknown-elf): New entries.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2023-08-14 08:30:08 +00:00
John Ericson
39c49ea712 config.sub: Systematize parsing of machine code formats
Instead of treating them as OSes, we treat them as their own category.
This is modeled on what LLVM does with its `ObjectFormatType` enum [1],
advancing my long-running project of trying to nudge GNU config and LLVM
towards each other, taking the best ideas of both.

Currently, my emphasis is just on code cleanup. There are just a few
tests for newly supported changes that fall out of this. But down the
road, this also opens the door to parsing configs with more than 4
components, like [2].

[1]: https://llvm.org/doxygen/classllvm_1_1Triple.html#a83e907e55fa50e093caa96a0aff96201

[2]: a18266473b/llvm/unittests/TargetParser/TripleTest.cpp (L1873C50-L1873C77)
added in
28b82bc39e

* config.sub: Save machine code format name separately from the OS name.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data (arm-unknown-none-aout,
arm-unknown-none-pe): New entries.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2023-08-07 18:20:40 +00:00
Maciej W. Rozycki
d4e37b5868 config.sub: Handle arbitrary MIPS CPU names
GNU binutils support the selection of the default MIPS subtarget via the
configuration triplet, e.g. `mips64octeon+el-unknown-linux-gnu' builds a
Linux/GNU 64-bit MIPS (n32 ABI) little-endian configuration with the CPU
set to Octeon+ by default.  However `config.sub' rejects such a triplet
and indeed it only lets through a random choice of ones people submitted
changes for to support.

There is a large number of MIPS CPU configurations, 118 at the moment,
that GNU binutils know, so rather than adding them individually and then
hoping it will be kept up to date from now on accept any `mips*' pattern
for the machine part, just as we already do for a few of other targets.

	* config.sub: Allow any `mips*' CPU rather than listing a choice
	individually.
	* doc/config.sub.1: Regenerate.
	* testsuite/config-sub.data: Add test cases.
2023-07-31 10:00:55 +00:00
Dmitry V. Levin
af8d803a82 config.guess (aarch64:Linux:*:*): Detect 32-bit ABI
On x86_64 Linux, a C compiler producing 32bit code causes the guessed
CPU to be changed to i686.

Adapt this approach for aarch64 Linux, i.e. change the guessed CPU
to armv8l when a compiler producing arm eabi code is detected.

* config.guess (aarch64:Linux:*:*): Test for the 32-bit ABI.
* doc/config.guess.1: Regenerate.

Suggested-by: David Allsopp <david.allsopp@metastack.com>
2023-07-20 16:40:00 +00:00
Paul Iannetta
602766470c Add KVX MPPA detection
* config.guess (kvx:Linux:*:*, kvx:cos:*:*, kvx:mbr:*:*): Recognize.
* config.sub (kvx): Recognize cpu.
(cos*, mbr*): Recognize os.
* testsuite/config-guess.data: Add tests for kvx targets.
* testsuite/config-sub.data: Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
2023-07-19 11:16:47 +00:00
Luis Campos
be68d790b6 config.sub: Add Apple tvOS and watchOS
These are distinct from "ios". They are also technically Darwin, so while
something like "aarch64-apple-darwin" could be used when targeting these,
on Apple-silicon based systems there could be cases where `--host` and
`--build` have the same value, and a ./configure script may determine that
we are not cross building, causing it to try to execute test programs for
the target OS that will not run on macOS.

These are functionally equivalent to iOS, and targets with "-tvos" and
"-watchos" are already used by clang.

* config.sub (tvos*, watchos*): Recognize.
* testsuite/config-sub.data (arm64-apple-tvos, arm64-apple-tvos10.0.0,
arm64-apple-watchos, arm64-apple-watchos5.0): New tests.
* doc/config.sub.1: Regenerate.
2023-07-13 11:29:18 +00:00
John Ericson
998ba14143 config.sub: Accept $cpu-$vendor-none-{coff,elf}
These are not real OSes, they are object file formats. There is a
longstanding tradition of using them for embedded/freestanding
programming, so it makes sense to parse them with `kernel=none`.

(I have a WIP future patch that systematizes parsing these non-OSes a
bit more. That also opens the door to parsing a 5th component as LLVM
can do.)

This change unblocks an issue we've been having with Nixpkgs (see
https://github.com/NixOS/nixpkgs/issues/165836 for the longer version).

* config.sub (none-coff*, none-elf*): Recognize.
* testsuite/config-sub.data (arm-unknown-none-coff,
arm-unknown-none-elf, riscv64-company-none-elf): New tests.
* doc/config.sub.1: Regenerate.
2023-07-04 22:52:51 +00:00
John Ericson
91f6a7f616 config.sub: Accept LLVM-style $cpu-$vendor-windows-{gnu,msvc}
In older times, MinGW (GCC toolchain with modified windows headers) was
the only free software toolchain for Windows.  But now, LLVM has support
both for MinGW ABI and Microsoft's own.  The distinction matters for C++
more than C.

LLVM[1], Rust[2], and other projects have taken to differentiating these
two as `...windows-gnu` vs `...windows-msvc`.  I think that makes a lot
of sense, as it correctly identifiers both their commonalities and their
differences.

A lot of MinGW-supporting software, most notably GCC itself, will
presumably continue to use configs like x86_64-pc-mingw32 and
i686-pc-mingw32.  That's fine; this patch doesn't normalize them away
(like LLVM does) or remove them!  If and when that software wants to
support the MSVC ABI without requiring MSVC itself, they can switch to
these newer configurations.

[1]: a18266473b/llvm/unittests/TargetParser/TripleTest.cpp (L1907-L1951)
[2]: 36fb58e433/compiler/rustc_target/src/spec/mod.rs (L1255-L1271)
2023-06-26 23:56:57 +00:00
Paul Eggert
4ad4bb7c30 Quote 'like this', not `like this'.
In 2012 the GNU Coding Standards changed to recommend quoting
'like this' or "like this" instead of `like this'.
Alter diagnostics and comments accordingly.
Use a more-consistent quoting style in config.sub diagnostics,
preferring 'like this' to "like this" as the former is more
resistant to shell metacharacters.
2023-06-23 16:55:10 +00:00
Paul Eggert
63acb96f92 Fix config.sub spelling typo for "athlon"
This typo was introduced in commit
fc14426403b6106981d2b3a4666835df29203043
dated Tue Aug 28 09:59:08 2018 +1000.
2023-01-21 06:15:01 +00:00
Dmitry V. Levin
4ce12a5c91 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.
2023-01-01 08:00:00 +00:00
Dmitry V. Levin
f992bcc082 testsuite: make config data sorted using "make sort"
* testsuite/config-guess.data: Make the data sorted.
2022-10-07 08:00:00 +00:00
Arsen Arsenović
c397e2c040 config.sub: add linux-mlibc targets
Note: currently, there's no detection method for linux-mlibc in
config.guess, since there's no decided way to detect mlibc.

Signed-off-by: Arsen Arsenović <arsen@aarsen.me>

* config.sub (linux-mlibc*): Recognize.
* testsuite/config-sub.data (aarch64-linux-mlibc, riscv-linux-mlibc,
x86_64-linux-mlibc): New tests.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-09-17 21:34:48 +00:00
Arsen Arsenović
9f9f9b0b13 config.guess: support running on Managarm systems
Signed-off-by: Arsen Arsenović <arsen@aarsen.me>

* config.guess (x86_64:[Mm]anagarm:*:*, i?86:[Mm]anagarm:*:*,
*:[Mm]anagarm:*:*): Recognize.
(timestamp): Update.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data: Add tests for managarm targets.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-09-17 21:34:48 +00:00
Arsen Arsenović
87e6687749 config.sub: add managarm-{mlibc,kernel} targets
To achieve this, the `kernel' pseudo-OS value was added, intended to
identify targets requiring a kernel-specific compiler and base system.

Signed-off-by: Arsen Arsenović <arsen@aarsen.me>

* config.sub (managarm-*): Recognize.
(mlibc*): Likewise libc.
(timestamp): Update.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data (aarch64-managarm, aarch64-managarm-kernel,
aarch64-managarm-mlibc, riscv-managarm, riscv-managarm-kernel,
riscv-managarm-mlibc, x86_64-managarm, x86_64-managarm-kernel,
x86_64-managarm-mlibc): New tests.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-09-17 21:34:48 +00:00
Xiaotian Wu
20403c5701 Remove loongarchx32
loongarchx32 doesn't exist in the real world, so we can delete it.

* config.guess (loongarchx32:Linux:*:*): Remove.
(timestamp): Update.
* config.sub (loongarchx32): Remove.
(timestamp): Update.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data (loongarchx32): Remove.
* testsuite/config-sub.data (loongarchx32, loongarchx32-elf,
loongarchx32-linux, loongarchx32-loongson-elf): Likewise.

Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-08-01 08:05:29 +00:00
Alexander von Gluck IV
02ba26b218 config.guess: Update Haiku guesses
* config.guess (ppc:Haiku:*:*, *:Haiku:*:*): Recognize.
(timestamp): Update.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data: Add more test cases for Haiku.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-05-25 20:43:13 +00:00
Bruno Haible
f56a714038 config.guess (x86_64:Linux:*:*): Detect 32-bit ABI.
* config.guess (x86_64:Linux:*:*): Test for the 32-bit ABI. Don't assume that
__ILP32__ is a certain indicator for the x32 ABI; for GCC ≥ 9 it no longer is.
* doc/config.guess.1: Regenerate.
2022-05-08 17:08:08 +00:00
Bruno Haible
8a9de2bc05 testsuite: Add one more testcase.
* testsuite/config-guess.data: Add a test for i686-pc-linux-gnu.
2022-05-08 17:18:13 +00:00
Idan Horowitz
c179db1b6f config.guess: recognize SerenityOS
* config.guess (*:SerenityOS:*:*): Recognize.
(timestamp): Update.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data: Add test case for SerenityOS.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2022-01-09 21:53:25 +00:00
Dmitry V. Levin
7e20fac20c gitlog-to-changelog: update from gnulib
* gitlog-to-changelog: Update to version '2021-02-24 23:42' from gnulib.
2022-01-04 08:00:00 +00:00
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
Dmitry V. Levin
ee98986410 config.sub: alias armh to armv7l
ALT uses armh as an alias for armv7l-alt-linux-gnueabihf since 2012.

* config.sub (armh-unknown|armh-alt): Set cpu, vendor, and basic_os.
(timestamp): Update.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data (armh, armh-alt-linux-gnueabihf): New tests.
2021-12-25 08:00:00 +00:00
Dmitry V. Levin
da0f86d042 config.sub: alias aarch64le to aarch64
Apparently, QNX reports aarch64 as aarch64le on little-endian machines.

* config.sub (aarch64le-*): Set cpu to aarch64.
(timestamp): Update.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data (aarch64le-qnx): New test.

Reported-by: Elad Lahav <e2lahav@gmail.com>
Link: https://lists.gnu.org/archive/html/config-patches/2021-12/msg00009.html
2021-12-24 17:00:00 +00:00
Dmitry V. Levin
5b6ae7445c config.sub: fix typo in timestamp
* config.sub: Fix timestamp.
* doc/config.sub.1: Regenerate.

Reported-by: Jordi Sanfeliu <jordi@fibranet.cat>
Fixes: a013aac61edfa2a03727521508286480010e7bf3
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-12-13 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
Kinshuk Dua
9428e344e6 config.sub: Fix typo in comment
Fixes: 5e531d391852a54e7fab2d8ff55625fca514b305
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-10-18 09:31:31 +00:00
Nick Bowler
191bcb948f config.sub: work around command assignment bug in some shells
When combining variable assignments with a shell command, some older
shells (notably heirloom-sh and presumably also Solaris 10 /bin/sh)
have a bug which causes the assignment to alter the current execution
environment whenever the command is a shell built-in.  For example:

  % dash -c 'x=good; x=bad echo >/dev/null; echo $x'
  good

  % jsh -c 'x=good; x=bad echo >/dev/null; echo $x'
  bad

The config.sub script contains a few commands of the form:

  IFS=- read ...

which triggers this bug, causing the IFS assignment to persist for the
remainder of the script.  This can cause misbehaviour in certain cases,
for example:

  % jsh config.sub i386-linux-gnu
  config.sub: test: unknown operator gnu

  % jsh config.sub i386-gnu/linux
  sed: can't read s|gnu/linux|gnu|: No such file or directory
  Invalid configuration `i386-gnu/linux': OS `' not recognized

* config.sub: Save and restore IFS explicitly to avoid shell bugs.
* doc/config.sub.1: Regenerate.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-08-14 16:20:38 +00:00
Jeremy Soller
2707e389a5 config.sub: add Linux Relibc Target
$ 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 (881 tests)
PASS: config.sub idempotency checks (818 tests)
PASS: config.sub canonicalise each config.guess testcase (136 tests)

* config.sub (relibc*): Recognize.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data (x86_64-linux-relibc): New test.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-08-04 13:32:46 +00:00
Stephanos Ioannidis
401e1a7dd1 config.sub: add Zephyr RTOS support
This adds the Zephyr RTOS targets in preparation for implementing the
Zephyr RTOS-specific toolchain support.

$ 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 (880 tests)
PASS: config.sub idempotency checks (817 tests)
PASS: config.sub canonicalise each config.guess testcase (136 tests)

* config.sub (zephyr*): Recognize.
* doc/config.sub.1: Regenerate.
* testsuite/config-sub.data: Add testcases for *-zephyr.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-07-06 14:09:09 +00:00
Ozkan Sezer
805517123c config.sub: disable shellcheck SC2006 / SC2268 warnings
This is in line with the recent config.guess change in commit
12fcf67c9108f4c4b581eaa302088782f0ee40ea

* config.sub (shellcheck disable): Add SC2006,SC2268.

Suggested-by: Jacob Bachmeyer <jcb@gnu.org>
Signed-off-by: Ozkan Sezer <sezero@users.sourceforge.net>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-07-03 08:05:56 +00:00
Ozkan Sezer
79549b168d config.sub: normalize the quoting in the echo FOO | sed ...
Some cases quote the argument to echo and some do not.  At runtime
it probably does not matter because the substituted values will never
contain whitespace, but quoting them all would make shellcheck more
useful.

* config.sub: Consistently quote the argument of echo.
* doc/config.sub.1: Regenerate.

Suggested-by: Jacob Bachmeyer <jcb@gnu.org>
Signed-off-by: Ozkan Sezer <sezero@users.sourceforge.net>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-07-03 08:05:40 +00:00
Ozkan Sezer
0ee661a9f9 config.sub: replace POSIX $( ) with classic throughout
This is in line with the recent config.guess change in commit
d70c4fa934de164178054c3a60aaa0024ed07c91.

The patch was generated using patch-6.gawk script introduced in that
commit.

* config.sub: Revert POSIX command substitutions to classic form.

Signed-off-by: Ozkan Sezer <sezero@users.sourceforge.net>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2021-07-02 05:55:50 +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
d921e50274 Remove automatic patch generators
These tools have served their purposes and need not be kept outside of
the repository history any longer.  This patch as a diff also collects
the contents of the various tools in one convenient place.

* patch-1.gawk: Remove.
* patch-3.gawk: Likewise.
* patch-6.gawk: Likewise.
2021-05-27 01:13:22 +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