Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build] fix lookup of defined-but-false configure options while gener…
…ating the Makefile
  • Loading branch information
moritz committed Aug 2, 2011
1 parent 124bec3 commit 2dd618f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/lib/NQP/Configure.pm
Expand Up @@ -155,12 +155,18 @@ sub fill_template_file {
close($OUT) or die $!;
}

sub lookup_config {
my ($key, $config) = @_;
return $config->{$key} if defined $config->{$key};
return $config->{"parrot::$key"} if defined $config->{"parrot::$key"};
return '';
}

sub fill_template_text {
my $text = shift;
my %config = @_;

$text =~ s/@([:\w]+)@/$config{$1} || $config{"parrot::$1"} || ''/ge;
$text =~ s/@([:\w]+)@/lookup_config("$1", \%config)/ge;
if ($text =~ /nqp::makefile/) {
if ($^O eq 'MSWin32') {
$text =~ s{/}{\\}g;
Expand Down

0 comments on commit 2dd618f

Please sign in to comment.