Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
try to fix error reporting when NQP is too old
  • Loading branch information
moritz committed Nov 7, 2013
1 parent 9c888d2 commit 9b80284
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Configure.pl
Expand Up @@ -129,9 +129,12 @@
my @errors;
if ($backends{parrot}) {
my %nqp_config;
if ($impls{parrot}{config}) {
if ($impls{parrot}{ok}) {
%nqp_config = %{ $impls{parrot}{config} };
}
elsif ($impls{parrot}{config}) {
push @errors, "The nqp-p is too old";
}
else {
push @errors, "Cannot obtain configuration from NQP on parrot";
}
Expand Down Expand Up @@ -177,9 +180,12 @@
$config{j_nqp} = $impls{jvm}{bin};
$config{j_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32';
my %nqp_config;
if ( $impls{jvm}{config} ) {
if ( $impls{jvm}{ok} ) {
%nqp_config = %{ $impls{jvm}{config} };
}
elsif ( $impls{jvm}{config} ) {
push @errors, "nqp-j is too old";
}
else {
push @errors, "Unable to read configuration from NQP on the JVM";
}
Expand Down
6 changes: 4 additions & 2 deletions tools/lib/NQP/Configure.pm
Expand Up @@ -285,10 +285,11 @@ sub gen_nqp {
my $bin = fill_template_text('@bindir@/nqp-p@ext@', %c);
$impls{parrot}{bin} = $bin;
%c = read_config($bin);
$impls{parrot}{config} = \%c;
my $nqp_have = $c{'nqp::version'};
my $nqp_ok = $nqp_have && cmp_rev($nqp_have, $nqp_want) >= 0;
if ($nqp_ok) {
$impls{parrot}{config} = \%c;
$impls{parrot}{ok} = 1;
}
else {
$need{parrot} = 1;
Expand All @@ -305,9 +306,10 @@ sub gen_nqp {
$impls{$b}{bin} = $bin;
my %c = read_config($bin);
my $nqp_have = $c{'nqp::version'} || '';
$impls{$b}{config} = \%c;
my $nqp_ok = $nqp_have && cmp_rev($nqp_have, $nqp_want) >= 0;
if ($nqp_ok) {
$impls{$b}{config} = \%c;
$impls{$b}{ok} = 1;
}
else {
$need{$b} = 1;
Expand Down

0 comments on commit 9b80284

Please sign in to comment.