diff options
author | lloyd <[email protected]> | 2006-09-09 01:22:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-09 01:22:48 +0000 |
commit | 537f690ff35042ae71aafc743d15892f41662951 (patch) | |
tree | f4119e71d81a7ec20456af74fa422726948ed563 | |
parent | 851aae3b7a03daa77f16b7256ed97f2317566c12 (diff) |
Be more free with suggesting the user try running with --help in the event
of a failure relating to input.
-rwxr-xr-x | configure.pl | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/configure.pl b/configure.pl index 972e8d947..d659fcf2c 100755 --- a/configure.pl +++ b/configure.pl @@ -90,7 +90,29 @@ sub main { else { help(); } my ($cc,$os,$submodel) = split(/-/,$cc_os_cpu_set,3); - if(!defined($cc) or !defined($os) or !defined($submodel)) { help(); } + + help() unless(defined($cc) and defined($os) and defined($submodel)); + + croak("Compiler $cc isn't known (try --help)") + unless defined($COMPILER{$cc}); + + $os = os_alias($os); + croak("OS $os isn't known (try --help)") unless + ($os eq 'generic' or defined($OPERATING_SYSTEM{$os})); + + my $arch = undef; + ($arch, $submodel) = figure_out_arch($submodel); + + croak(realname($os), " doesn't run on $arch ($submodel)") + unless($arch eq 'generic' or $os eq 'generic' or + in_array($arch, $OPERATING_SYSTEM{$os}{'arch'})); + + croak(realname($cc), " doesn't run on $arch ($submodel)") + unless($arch eq 'generic' or + (in_array($arch, $COMPILER{$cc}{'arch'}))); + + croak(realname($cc), " doesn't run on ", realname($os)) + unless($os eq 'generic' or (in_array($os, $COMPILER{$cc}{'os'}))); # hacks @@ -126,26 +148,6 @@ sub main { } } - croak("Compiler $cc isn't known") unless defined($COMPILER{$cc}); - - $os = os_alias($os); - croak("OS $os isn't known") unless - ($os eq 'generic' or defined($OPERATING_SYSTEM{$os})); - - my $arch = undef; - ($arch, $submodel) = figure_out_arch($submodel); - - croak(realname($os), " doesn't run on $arch ($submodel)") - unless($arch eq 'generic' or $os eq 'generic' or - in_array($arch, $OPERATING_SYSTEM{$os}{'arch'})); - - croak(realname($cc), " doesn't run on $arch ($submodel)") - unless($arch eq 'generic' or - (in_array($arch, $COMPILER{$cc}{'arch'}))); - - croak(realname($cc), " doesn't run on ", realname($os)) - unless($os eq 'generic' or (in_array($os, $COMPILER{$cc}{'os'}))); - my %MODULE_SETS = ( 'unix' => [ 'alloc_mmap', 'es_egd', 'es_ftw', 'es_unix', 'fd_unix', @@ -392,7 +394,7 @@ sub figure_out_arch { }; my $arch = &$find_arch($name); - croak("Arch type $name isn't known") unless defined $arch; + croak("Arch type $name isn't known (try --help)") unless defined $arch; trace("mapped name '$name' to arch '$arch'"); my %archinfo = %{ $CPU{$arch} }; |