diff options
Diffstat (limited to 'Configurations/windows-makefile.tmpl')
-rw-r--r-- | Configurations/windows-makefile.tmpl | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 9250b989ca..c05d03f369 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -790,12 +790,44 @@ EOF my $dofile = abs2rel(rel2abs(catfile($config{sourcedir}, "util", "dofile.pl")), rel2abs($config{builddir})); - 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); + my @perlmodules = (); + my %perlmoduleincs = (); + my %perlmoduledeps = (); + foreach my $x (('configdata.pm', @{$args{deps}})) { + # Compute (i)nclusion directory, (m)odule name and (d)ependency + my $i, $m, $d; + if ($x =~ /\|/) { + $i = $`; + $d = $'; + + # Massage the module part to become a real perl module spec + $m = $d; + $m =~ s|\.pm$||; + # Directory specs are :: in perl package names + $m =~ s|/|::|g; + + # Full file name of the dependency + $d = catfile($i, $d) if $i; + } elsif ($x =~ /\.pm$/) { + $i = dirname($x); + $m = basename($x, '.pm'); + $d = $x; + } else { + # All other dependencies are simply collected + $d = $x; + } + push @perlmodules, '"-M'.$m.'"' if $m; + $perlmoduledeps{$d} = 1; + $perlmoduleincs{'"-I'.$i.'"'} = 1 if $i; + } + + # Because of the special treatment of dependencies, we need to + # recompute $deps completely + my $deps + = join(" ", compute_platform_depends(@{$args{generator_deps}}, + sort keys %perlmoduledeps)); + my $perlmodules = join(' ', '', ( sort keys %perlmoduleincs ), @perlmodules); + return <<"EOF"; $args{src}: "$gen0" $deps "\$(PERL)"$perlmodules "$dofile" "-o$target{build_file}" "$gen0"$gen_args > \$@ |