Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve the error diagnostics when someone tries to build Rakudo
using a non-devel installation of Parrot.  Also make the error
messages themselves look a bit more STD-like  ("===SORRY!===").
  • Loading branch information
pmichaud committed Aug 26, 2009
1 parent 47057c1 commit bd7533f
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions Configure.pl
Expand Up @@ -47,7 +47,7 @@
@parrot_config_exe = ($options{'parrot-config'});
}

# Get configuration information from parrot_config
# Get configuration information from parrot_config
my %config = read_parrot_config(@parrot_config_exe);

my $parrot_errors = '';
Expand All @@ -61,15 +61,20 @@

if ($parrot_errors) {
die <<"END";
===SORRY!===
$parrot_errors
To automatically checkout (svn) and build a copy of parrot r$reqsvn,
try re-running Configure.pl with the '--gen-parrot' option.
Or, use the '--parrot-config' option to explicitly specify
the location of parrot_config to be used to build Rakudo Perl.
END
}

# Create the Makefile using the information we just got
# Verify the Parrot installation is sufficient for building Rakudo
verify_parrot(%config);

# Create the Makefile using the information we just got
create_makefile(%config);
my $make = $config{'make'};

Expand Down Expand Up @@ -113,6 +118,32 @@ sub read_parrot_config {
}


sub verify_parrot {
print "Verifying Parrot installation...\n";
my %config = @_;
my $PARROT_LIB_DIR = $config{'libdir'}.$config{'versiondir'};
my @required_files = (
"$PARROT_LIB_DIR/library/PGE/Perl6Grammar.pbc",
"$PARROT_LIB_DIR/library/PCT/HLLCompiler.pbc",
);
my @missing;
for my $reqfile (@required_files) {
push @missing, " $reqfile" unless -f $reqfile;
}
if (@missing) {
my $missing = join("\n", @missing);
die <<"END";
===SORRY!===
I'm missing some needed files from the Parrot installation:
$missing
(Perhaps you need to use Parrot's "make install-dev" or
install the "parrot-devel" package for your system?)
END
}
}

# Generate a Makefile from a configuration
sub create_makefile {
my %config = @_;
Expand Down

0 comments on commit bd7533f

Please sign in to comment.