mirror of
git://git.savannah.gnu.org/config.git
synced 2025-05-26 09:06:38 +12:00

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>
Description
No description provided
Languages
Perl
77.6%
Shell
18.9%
Makefile
3.5%