$user_cflags.=" ".$_;
}
}
- elsif ($_ =~ /^([^:]+):(.+)$/)
- {
- eval "\$table{\$1} = \"$2\""; # allow $xxx constructs in the string
- $target=$1;
- }
else
{
die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
}
$config{target} = $target;
delete $table{$base_target}->{template}; # or the next test will fail.
-my %target = ( %{$table{$base_target}}, resolve_config($target) );
+my %target = resolve_config($target);
&usage if (!%target || $target{template});
+# Set up defaults
+my %target = ( %{$table{$base_target}}, %target );
+
$target{exe_extension}="";
$target{exe_extension}=".exe" if ($config{target} eq "DJGPP"
|| $config{target} =~ /^(?:Cygwin|mingw)/);
if (-f catfile($srcdir, "engines", $_, "build.info"));
}
+ $config{build_infos} = [ ];
+
foreach (@build_infos) {
my $sourced = catdir($srcdir, $_->[0]);
my $buildd = catdir($blddir, $_->[0]);
my %renames = ();
my %sharednames = ();
+ push @{$config{build_infos}}, catfile(abs2rel($sourced, $blddir), $f);
my $template = Text::Template->new(TYPE => 'FILE',
SOURCE => catfile($sourced, $f));
die "Something went wrong with $sourced/$f: $!\n" unless $template;
if ($type eq "TABLE") {
print "\n";
print "*** $target\n";
- printf "\$%-12s = %s\n", $_, $target{$_} foreach (@sequence);
+ foreach (@sequence) {
+ if (ref($target{$_}) eq "ARRAY") {
+ printf "\$%-12s = %s\n", $_, join(" ", @{$target{$_}});
+ } else {
+ printf "\$%-12s = %s\n", $_, $target{$_};
+ }
+ }
} elsif ($type eq "HASH") {
my $largest =
length((sort { length($a) <=> length($b) } @sequence)[-1]);
print " '$target' => {\n";
foreach (@sequence) {
if ($target{$_}) {
- print " '",$_,"'"," " x ($largest - length($_))," => '",$target{$_},"',\n";
+ if (ref($target{$_}) eq "ARRAY") {
+ print " '",$_,"'"," " x ($largest - length($_))," => [ ",join(", ", map { "'$_'" } @{$target{$_}})," ],\n";
+ } else {
+ print " '",$_,"'"," " x ($largest - length($_))," => '",$target{$_},"',\n";
+ }
}
}
print " },\n";