$target{build_scheme} = [ $target{build_scheme} ]
if ref($target{build_scheme}) ne "ARRAY";
+my ($builder, $builder_platform, @builder_opts) =
+ @{$target{build_scheme}};
+
# if $config{prefix}/lib$target{multilib} is not an existing directory, then
# assume that it's not searched by linker automatically, in
# which case adding $target{multilib} suffix causes more grief than
}
}
-if ($target{build_scheme}->[0] ne "mk1mf")
+if ($builder ne "mk1mf")
{
# add {no-}static-engine to options to allow mkdef.pl to work without extra arguments
if ($config{no_shared})
# If we use the unified build, collect information from build.info files
my %unified_info = ();
-if ($target{build_scheme}->[0] eq "unified") {
+if ($builder eq "unified") {
+ # Store the name of the template file we will build the build file from
+ # in %config. This may be useful for the build file itself.
+ my $build_file_template =
+ catfile($srcdir, "Configurations",
+ $builder_platform."-".$target{build_file}.".tmpl");
+ $build_file_template =
+ catfile($srcdir, "Configurations", $target{build_file}.".tmpl")
+ if (! -f $build_file_template);
+ $config{build_file_template} = $build_file_template;
+
use lib catdir(dirname(__FILE__),"util");
use with_fallback qw(Text::Template);
next if @skip && $skip[$#skip] <= 0;
push @rawlines, $_
if ($target_kind eq $target{build_file}
- || $target_kind eq $target{build_file}."(".$target{build_scheme}->[1].")");
+ || $target_kind eq $target{build_file}."(".$builder_platform.")");
}
},
qr/^(?:#.*|\s*)$/ => sub { },
);
EOF
-if ($target{build_scheme}->[0] eq "unified") {
+if ($builder eq "unified") {
my $recurse;
$recurse = sub {
my $indent = shift;
print OUT "1;\n";
close(OUT);
-die <<"EOF" if $target{build_scheme}->[0] ne "unified" && $srcdir ne $blddir;
+die <<"EOF" if $builder ne "unified" && $srcdir ne $blddir;
***** Trying building anywhere else than in the source tree will not
***** work for target $config{target}. To make it possible, it needs
EOF
-print "IsMK1MF =", ($target{build_scheme}->[0] eq "mk1mf" ? "yes" : "no"), "\n";
+print "IsMK1MF =", ($builder eq "mk1mf" ? "yes" : "no"), "\n";
print "CC =$target{cc}\n";
print "CFLAG =$config{cflags}\n";
print "LFLAG =$config{lflags}\n";
my %builders = (
unified => sub {
- die "unified build currently does nothing";
+ run_dofile(catfile($blddir, $target{build_file}),
+ $config{build_file_template},
+ catfile($srcdir, "Configurations", "common.tmpl"));
+
+ my $make_command = "$make PERL=\'$config{perl}\'";
+ my $make_targets = "";
+ $make_targets .= " depend"
+ if $config{depflags} ne $default_depflags && $make_depend;
+ (system $make_command.$make_targets) == 0
+ or die "make $make_targets failed"
+ if $make_targets ne "";
+ if ($config{depflags} ne $default_depflags && !$make_depend) {
+ $warn_make_depend++;
+ }
},
unixmake => sub {
build_Makefile();
my $make_command = "$make PERL=\'$config{perl}\'";
my $make_targets = "";
- $make_targets .= " depend" if $config{depflags} ne $default_depflags && $make_depend;
- (system $make_command.$make_targets) == 0 or die "make $make_targets failed"
+ $make_targets .= " depend"
+ if $config{depflags} ne $default_depflags && $make_depend;
+ (system $make_command.$make_targets) == 0
+ or die "make $make_targets failed"
if $make_targets ne "";
+
if ($config{depflags} ne $default_depflags && !$make_depend) {
$warn_make_depend++;
}
},
mk1mf => sub {
+ my $platform = shift;
# The only reason we do this is to have something to build MINFO from
build_Makefile();
close(OUT);
# create the ms/version32.rc file if needed
- if (! grep /^netware/, @{$target{build_scheme}}) {
+ if ($platform eq "netware") {
my ($v1, $v2, $v3, $v4);
if ($config{version_num} =~ /^0x([0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{1})L$/i) {
$v1=hex $1;
},
);
-my ($builder, @builder_opts) = @{$target{build_scheme}};
-$builders{$builder}->(@builder_opts);
+$builders{$builder}->($builder_platform, @builder_opts);
print <<"EOF";