summaryrefslogtreecommitdiffstats
path: root/Configurations/descrip.mms.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'Configurations/descrip.mms.tmpl')
-rw-r--r--Configurations/descrip.mms.tmpl49
1 files changed, 23 insertions, 26 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 3e389215e1..cdc341f9e7 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -762,6 +762,17 @@ reconfigure reconf :
use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
use File::Spec::Unix;
+ # Helper function to convert dependencies in platform agnostic form to
+ # dependencies in platform form.
+ sub compute_platform_depends {
+ map { my $x = $_;
+
+ grep { $x eq $_ } @{$unified_info{programs}} and platform->bin($x)
+ or grep { $x eq $_ } @{$unified_info{modules}} and platform->dso($x)
+ or grep { $x eq $_ } @{$unified_info{libraries}} and platform->lib($x)
+ or platform->convertext($x); } @_;
+ }
+
# Helper function to figure out dependencies on libraries
# It takes a list of library names and outputs a list of dependencies
sub compute_lib_depends {
@@ -852,7 +863,7 @@ EOF
sub generatetarget {
my %args = @_;
- my $deps = join(" ", @{$args{deps}});
+ my $deps = join(" ", compute_platform_depends(@{$args{deps}}));
return <<"EOF";
$args{target} : $deps
EOF
@@ -864,7 +875,9 @@ EOF
my $gen_args = join('', map { " $_" }
@{$args{generator}}[1..$#{$args{generator}}]);
my $gen_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
- my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
+ my $deps = join(", -\n\t\t",
+ compute_platform_depends(@{$args{generator_deps}},
+ @{$args{deps}}));
if ($args{src} =~ /\.html$/) {
#
@@ -957,38 +970,22 @@ EOF
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
"util", "dofile.pl")),
rel2abs($config{builddir}));
- my @modules = ( 'configdata.pm',
- grep { $_ =~ m|\.pm$| } @{$args{deps}} );
- my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
- $deps = join(' ', $deps, @modules);
- @modules = map { '"-M'.basename($_, '.pm').'"' } @modules;
- my $modules = join(' ', '', sort keys %moduleincs, @modules);
+ my @perlmodules = ( 'configdata.pm',
+ grep { $_ =~ m|\.pm$| } @{$args{deps}} );
+ my %perlmoduleincs = map { '"-I'.dirname($_).'"' => 1 } @perlmodules;
+ $deps = join(' ', $deps, compute_platform_depends(@perlmodules));
+ @perlmodules = map { '"-M'.basename($_, '.pm').'"' } @perlmodules;
+ my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules);
return <<"EOF";
$args{src} : $gen0 $deps
- \$(PERL)$modules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
+ \$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
EOF
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
#
# Generic generator using OpenSSL programs
#
- # Redo $deps, because programs aren't expected to have deps of their
- # own. This is a little more tricky, though, because running programs
- # may have dependencies on all sorts of files, so we search through
- # our database of programs and modules to see if our dependencies
- # are one of those.
- $deps = join(' ', map { my $x = $_;
- if (grep { $x eq $_ }
- @{$unified_info{programs}}) {
- platform->bin($x);
- } elsif (grep { $x eq $_ }
- @{$unified_info{modules}}) {
- platform->dso($x);
- } else {
- $x;
- }
- } @{$args{deps}});
- # Also redo $gen0, to ensure that we have the proper extension
+ # Redo $gen0, to ensure that we have the proper extension
$gen0 = platform->bin($gen0);
return <<"EOF";
$args{src} : $gen0 $deps