1038 Commits

Author SHA1 Message Date
Ben Elliston
382847f038 * config.guess (set_cc_for_build): Guard against $CC_FOR_BUILD,
$HOST_CC and $CC being undefined by using ${var-} style expansion.
	(*:NetBSD:*:*): Likewise for $abi.
	* testsuite/config-guess.sh: Run config.guess under `sh -eu'.
2018-05-19 18:58:37 +10:00
Ben Elliston
32d5bd9cec * testsuite/config-guess.sh: Set -eu for robustness. Run
config.guess under `sh -e' to catch more problems.
	* testsuite/config-sub.sh: Run config.sub under `sh -eu'.
2018-05-19 18:34:15 +10:00
John Ericson
14ec0b015e * config.sub: Cordon off single component aliases.
More detail from the patch author:

Currently there are number of aliases that expand both on their own
and as part of multi-component configurations. For example:

	$ ./config.sub 386bsd-linux
	i386-pc-bsd

This change moves all of those to just trigger on a single field
branch, preventing their matching as part of larger components:

	$ ./config.sub 386bsd-linux
	Invalid configuration `386bsd-linux': machine `386bsd' not recognized

This should increase correctness and avoid needless work in the common
case (as many of these are very, very old).

I was very conservative in deciding which patterns were such single
component aliases, as this does make config.sub less forgiving than
before. My criteria for patterns in this `case $basic_machine` were:

  - the pattern doesn't contain any `-`
  - the pattern doesn't contain any `*`
  - `os` was assigned in the match body
  - basic_machine wasn't essentially left as is.

The first rule is simple: if it contains a `-` it's not a
single-component pattern. The second rule is because any
`$basic_machine` pattern with an asterisk (`*`) could conceivably
match a two component string, even if the actual code strongly
signaled that was not the intent. The third rule was to indicate no
`os` was expected, as it is valid to omit a vendor in the two
component case so `basic_machine` is just one component without being
the entire configuration.

The 4th and last rule is the trickiest. If the basic_machine was left
as is, or appended with a vendor, I considered the pattern less of an
alias and more a defaulting of a canonical or near canonical
name. This seemed like a "higher quality" short-hand and thus one that
is valid as part of a larger config. Instead of just hard-assigning
`os`, however, I changed it to default `os` with:

	os=${os:-DEFAULT}

so as to respect any more information the user passed. This gives us
more pleasant absurdities like:
	$ ./config.sub j90
	j90-cray-unicos

	$ ./config.sub j90-linux
	j90-cray-linux-gnu

rather than:
	$ ./config.sub j90-linux
	j90-cray-unicos

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-19 14:00:25 +10:00
Ben Elliston
45e7cb552c * Makefile (shellcheck): Include testsuite/*.sh scripts. 2018-05-14 21:06:06 +10:00
John Ericson
5b1c9fc952 * config.sub: Don't prepend $os with '-' everywhere. Include
it in the output instead.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-14 07:21:35 +10:00
John Ericson
bb2048934b * config.sub: Error if there is more than four components.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-13 20:35:04 +10:00
Ben Elliston
c34561d03c * config.sub: Remove do-nothing case. 2018-05-12 11:20:45 +10:00
Ben Elliston
2f8d0c496f Typo fix from Paul Eggert. 2018-05-11 14:57:38 +10:00
Ben Elliston
b75cdc942a * config.sub: Simplify an if expression. 2018-05-05 21:11:00 +10:00
John Ericson
09df750b99 * config.sub (arm*-*-none-eabi): Recognise.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-05 21:09:43 +10:00
Ben Elliston
65463c5913 * config.sub: Pass the -r option to 'read'. 2018-05-05 21:00:21 +10:00
John Ericson
50a0413a5b * config.sub: Properly recognise configuration types with four
components. Re-work the old logic to simplify the shell code.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-05 15:15:12 +10:00
Ben Elliston
642dd8df5e * Makefile (shellcheck): New. 2018-05-04 14:13:26 +10:00
Ben Elliston
76d82de19f * config.sub: Whitespace tweak. 2018-05-03 04:49:10 +10:00
Ben Elliston
0bb25285e2 * config.sub (maybe_os): Reindent this block. 2018-05-01 15:45:14 +10:00
John Ericson
f3e464fb69 * config.sub: Rewrite basic_machine 'if' with 'case'.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-01 15:41:39 +10:00
Francois H. Theron
d23f148145 * config.sub (nfp, nfp-*): New.
* testsuite/config-sub.data: Add test cases.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-01 15:29:04 +10:00
John Ericson
c62a41f36a * config.sub (arm6m, armv[78][arm]): Recognise.
* testsuite/config-sub.data: Add tests.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-04-24 09:06:53 +10:00
Mao Han
63b4ce2e8c * config.sub (csky, csky-*): Recognise.
* testsuite/config-sub.data: Add a test case.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-04-16 14:46:36 +10:00
Ben Elliston
1aefff3bbb * testsuite/config-sub.data: Sort. 2018-04-16 14:35:12 +10:00
John Darrington
c3818bbab0 * config.sub (s12z, hcs12z, m68hcs12z, m9s12z): New.
* testsuite/config-sub.data: Add test cases.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-04-16 14:33:13 +10:00
Paul Eggert
614ae20b93 * config.guess: Use before-save-hook not write-file-functions.
* config.sub: Ditto.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-03-08 11:29:55 +11:00
Ben Elliston
6b2374c795 Fix config.guess timestamp. 2018-03-01 07:09:48 +11:00
Ben Elliston
8d4e4ce15b Revert for now:
2018-02-24  James Clarke  <jrtc27@jrtc27.com>

	* config.guess (x86_64:Linux:*:*): Detect x32 ABI.
2018-03-01 07:08:40 +11:00
Rishi Khan
b69837cbbd * config.sub (hcos-*): Recognise.
* testsuite/config-sub.data: Add a test case.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-02-28 09:15:47 +11:00
James Clarke
bd9626458c * config.guess (x86_64:Linux:*:*): Detect x32 ABI.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-02-24 12:34:33 +11:00
Ben Elliston
365ea7edee Reported by Nelson H. F. Beebe:
* config.sub (os): Recognise midnightbsd*.
	* testsuite/config-sub.data: Add a test case.
2018-02-22 13:50:09 +11:00
Henri Menke
3d00f60242 * config.guess: Try to detect musl libc on GNU/Linux systems using
ldd --version.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-01-26 14:04:08 +11:00
Ben Elliston
827c77253b * config.guess: Use double quotes on any remaining unquoted
variables to prevent globbing and word splitting.
2018-01-16 18:09:53 +11:00
Ben Elliston
9ca5f17e49 * config.guess: Change most ${foo} expansions to "$foo" to:
(1) double quote to prevent globbing and word splitting; and
	(2) remove extraneous braces.
2018-01-16 12:06:26 +11:00
Ben Elliston
68b4eebf4d * config.guess: Quote $dummy.c, $dummy.o and $dummy to prevent
globbing and word splitting in the filename.
2018-01-16 11:32:22 +11:00
Ben Elliston
12c6a5c16e * config.sub: Double quote variables to silence warning SC2086
(double quote to prevent globbing and word splitting).
2018-01-15 07:33:04 +11:00
Ben Elliston
391ea45d14 * config.sub (os): Move -es1800* case above -es*.
* testsuite/config-sub.data: Add several test cases.
2018-01-14 11:18:55 +11:00
Ben Elliston
8ca6442e66 * config.sub (os): Remove overlapping pattern -svr4*. 2018-01-14 11:01:37 +11:00
Ben Elliston
e8c56e37c2 * config.sub (maybe_os): Remove duplicate pattern -hms*.
* testsuite/config-sub.data: Add a test.
2018-01-14 10:57:24 +11:00
Ben Elliston
10438e2050 * config.sub (maybe_os): Remove duplicate pattern -beos*.
* testsuite/config-sub.data: Add a test.
2018-01-14 10:54:49 +11:00
Ben Elliston
d1a4abff22 * config.sub (maybe_os): Remove duplicated pattern -haiku*.
(basic_machine): Don't match haiku in the manufacturer field.
	* testsuite/config-sub.data: Add a test.
2018-01-14 10:51:48 +11:00
Ben Elliston
aaaf06062a * config.sub (maybe_os): Remove duplicated pattern -opened* which
prevents the more specific case matching on line 1427.
	* testsuite/config-sub.data: Add a test.
2018-01-14 10:29:58 +11:00
Ben Elliston
53fa691097 * config.sub (maybe_os): Remove first and duplicate -none*
case. This is matched further down. Found by Shellcheck.
2018-01-14 08:31:27 +11:00
Ben Elliston
5960fa40b2 * config.sub (maybe_os): Remove duplicate case for z8k. 2018-01-13 23:10:33 +11:00
Ben Elliston
8af31e838c * config.sub (maybe_os): Remove duplicate case for sh.
* testsuite/config-sub.data: Add test cases for sh and sh-elf.
2018-01-13 23:06:49 +11:00
Ben Elliston
f22522a600 * config.sub (maybe_os): Remove duplicate patterns for sparc,
sparcv8, sparcv9, sparcv9b and sparcv9v. Found by Shellcheck.
2018-01-13 22:12:38 +11:00
Ben Elliston
efc9a4d8d5 * config.sub (maybe_os): Remove cases z8k-*-coff and z80-*-coff as
these are never matched. Found by Shellcheck.
2018-01-13 22:09:07 +11:00
Ben Elliston
dea159d913 * config.sub (maybe_os): Remove duplicate m88k-omron* case.
Found by Shellcheck.
	* testsuite/config-sub.data: Add a test case.
2018-01-13 22:06:51 +11:00
Ben Elliston
1ea2427f47 * config.sub (maybe_os): Remove pdp10 case as it is handled above.
Found by Shellcheck.
2018-01-13 21:45:29 +11:00
Ben Elliston
97447f42ae * config.sub (basic_machine): Remove first pdp11 case so that the
second, specialised case will match instead. Found by Shellcheck.
	* testsuite/config-sub.data: Adjust test case.
2018-01-13 21:43:46 +11:00
Ben Elliston
0ce3d2f0c0 * config.sub (maybe_os): Clean up 386BSD.
* testsuite/config-sub.data: Adjust test cases.
2018-01-13 21:37:16 +11:00
Ben Elliston
ae1acbbff7 * testsuite/config-guess.data: Sort.
* testsuite/config-sub.data: Likewise.
2018-01-13 21:11:12 +11:00
Ben Elliston
702204e47b * config.sub (maybe_os): Remove sparclite-wrs pattern as it is
matched by sparclite-* above. Found by Shellcheck.
	* testsuite/config-sub.data: Add test cases.
2018-01-13 21:00:55 +11:00
Ben Elliston
a592387de4 * config.sub (maybe_os): Remove -rtmk-nova* pattern as it is
matched by -rtmk* immediately preceding it. Found by Shellcheck.
2018-01-13 20:55:11 +11:00