1227 Commits

Author SHA1 Message Date
John Ericson
1ae6c5d42f * config.sub: Combine match arms.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-13 14:25:52 +10:00
John Ericson
f4f9b29a8c * config.sub (craynv): Move back as a basic_machine pattern.
* testsuite/config-sub.data: Add test case.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-13 14:17:53 +10:00
Ben Elliston
c0ba970d17 * testsuite/config-sub.data: Add some legacy test cases. 2018-08-13 10:10:23 +10:00
Ben Elliston
019c1a9f7a Bump timestamp. 2018-08-12 21:55:13 +10:00
John Ericson
1eb41eb778 * config.sub (basic_machine): Move up manufacturer-defaulting
patterns.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-12 21:53:44 +10:00
John Ericson
ad274839e2 * config.sub: Eliminate some dead code for SH targets.
* testsuite/config-sub.data: Add tests for sh2ele and sh2ele-elf.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-08 14:00:07 +10:00
John Ericson
ea0e5a6f5b * config.sub (tile*): Only set 'os' to -linux-gnu if unset.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-08 11:54:28 +10:00
John Ericson
437d5d59dc * config.sub (abacus, asmjs): Combine some redundant case arms.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-08 11:50:59 +10:00
John Ericson
1225baf116 * config.sub: Don't need 'os=${os:-none}' defaults because that is
already the default.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-08 11:48:35 +10:00
John Ericson
08ede0dcc1 * testsuiteb/config-sub.sh (run_config_sub_idempotent): New.
* config.sub: Fixes to pass the testsuite.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-08 11:45:12 +10:00
John Ericson
dbe15d73a8 * testsuite/config-guess.sh: Make 'rc' a local variable.
* testsuite/config-sub.sh: Likewise.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-03 18:03:14 +10:00
John Ericson
f52be464ee * testsuite/config-guess.sh: Re-indent with tabs.
* testsuite/config-sub.sh: Likewise.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-08-02 21:19:03 +10:00
Ben Elliston
8de5d27282 * config.guess: Fix SC2234 diagnostic from Shellcheck ("Remove
superfluous (..) around test command". Also remove redirection as
	test(1) should never produce any output.
2018-08-02 19:42:42 +10:00
Ben Elliston
05049e403e * Makefile (check-guess, check-sub): Run tests under bash. 2018-07-30 09:57:40 +10:00
John Ericson
4761c20494 * config.sub: Fix some more i386-pc-* defaults.
* testsuite/config-sub.data: Update.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-07-25 12:26:00 +10:00
Ben Elliston
c85e3fc03c From Apostolos Syropoulos <asyropoulos@gmail.com>:
* config.guess (i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*): Use the
	isainfo(1) command to guess what kind of system we have. Running
	isainfo -b returns either "32" or "64".
2018-07-19 08:04:09 +10:00
Mikaël Urankar
afe1fa96bf * config.guess (arm*:FreeBSD:*:*): New.
* testsuite/config-guess.data: Add a test case.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-07-18 22:38:44 +10:00
Ben Elliston
5c3c4a9647 * testsuite/config-guess.data: Sort. 2018-07-15 10:50:45 +10:00
Ben Elliston
9f9b3d365a * testsuite/config-guess.sh: Strip off spaces around pipe
delimiter as test data is read in.
	(run_config_guess): Set IFS to '|'.
	* testsuite/config-guess.data: Use ' | ' as the delimeter.
2018-07-13 22:20:28 +10:00
Ben Elliston
09da403c82 * config.guess (set_cc_for_build): Disable SC2039 ("In POSIX sh,
RANDOM is undefined").
	* Makefile (shellcheck): Don't disable SC2039 globally.
2018-07-13 21:43:28 +10:00
Ben Elliston
a4b36a6939 * config.guess: Disable SC2154 and SC2172 Shellcheck warnings.
* Makefile (shellcheck): Don't disable SC2172 globally.
2018-07-13 21:37:46 +10:00
Ben Elliston
30d53fc428 Bump timestamp. 2018-07-13 10:00:13 +10:00
John Ericson
baaaa582bf * config.sub: Don't recognize every *-unknown as a basic_machine.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-07-13 09:58:06 +10:00
Ben Elliston
1e826a0344 * config.guess: Replace large 'set_cc_for_build' shell variable,
that is executed via eval, with a POSIX shell function.
	* Makefile (shellcheck): Ignore SC2039 diagnostics ("In POSIX sh,
	RANDOM is undefined") and SC2172 ("Trapping signals by number is
	not well defined. Prefer signal names").
2018-07-12 07:56:15 +10:00
Ben Elliston
ba47464ef7 * config.guess (set_cc_for_build): Suppress possible mkdir output. 2018-07-06 22:45:59 +10:00
Ben Elliston
dd5d5dd697 * config.sub: Do not rewrite riscv -> riscv32.
* testsuite/config-sub.data: Adjust tests.
2018-07-03 21:18:29 +10:00
Ben Elliston
b47fd674df Update timestamp. 2018-07-02 23:43:07 +10:00
Sevan Janiyan
0388bdcb11 * config.guess (*:Minix:*:*): Accept any machine.
* testsuite/config-guess.data: Add a test case.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-06-26 11:54:17 +10:00
Palmer Dabbelt
a06fbed616 * config.sub: Add riscv-* as an alias for riscv32-*.
* testsuite/config-sub.data: Add tests.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-06-22 09:28:40 +10:00
Ben Elliston
3a2a927f54 * testsuite/config-sub.data: Add tests for Sequent and DYNIX/ptx. 2018-05-24 18:25:10 +10:00
John Ericson
8b7ef99acd * config.sub: Consolidate $os checking.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-24 14:58:59 +10:00
Ben Elliston
44afabad0c Revert "Fix top of file comments."
This reverts commit ed15654af036a976f82c4503eb81c1a44e55bd3c.
2018-05-23 13:22:23 +10:00
John Ericson
629b235120 * config.sub: Don't force basic_machine based on $os just for
"mint" and "clix".

I got rid of this forcing, as it can hide an error from the user and
is unlike how other OSes are handled. I added fallbacks for clix (MiNT
already had some) such that at least the following stil work:

  $ ./config.sub clipper-clix
  clipper-intergraph-clix

  $ ./config.sub m68k-mint
  m68k-atari-mint

  $ ./config.sub mint
  m68k-atari-mint

"clix" (as opposed to "nonsense-clix", ie. with at least one "-"
before) never worked, so I didn't add a short-hand to make it work
like "mint".

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-23 13:13:51 +10:00
John Ericson
437b9abd44 * config.sub: No more OS-driven substitution of -pc with sed.
I'm not sure why this was originally added. It's certainly not needed
anymore because the OS will never be duplicated onto the send of the
`basic_machine`.  If the user passed `unknown` or no vendor, this will
already be filled in. If they passed something more specific, it's
customary to respect that.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-23 12:59:07 +10:00
John Ericson
63fe500bb8 * config.sub: Simplify *-wrs handling.
"wrs" is just a vendor that can be handled with all the other vendor
exceptions for two-component cases. `wrs) os=vxworks` can instead be
put with the other OS defaults down below.

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-23 11:33:44 +10:00
John Ericson
ca138e34d0 * config.sub: Cordon off two-component aliases.
Instead of just catching manufacturers as OSes across the board, catch
them just as the second of two components. This prevents nonsense
like:

  $ ./config.sub amd64-unknown-ibm
  x86_64-unknown-ibm-aix

Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-23 11:31:46 +10:00
John Ericson
cc35b3ce10 * testsuite/config-sub.data: Add clipper-clix and m68k-mint tests.
Signed-off-by: Ben Elliston <bje@gnu.org>
2018-05-21 12:42:26 +10:00
Ben Elliston
ab84f2cea4 * testsuite/config-sub.data: Sort. 2018-05-19 19:03:54 +10:00
Ben Elliston
ed15654af0 Fix top of file comments. 2018-05-19 19:02:02 +10:00
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