diff options
-rw-r--r-- | lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm b/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm index 6a6f452e..1d73685a 100644 --- a/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm +++ b/lib/Debian/Debhelper/Buildsystem/perl_makemaker.pm @@ -8,7 +8,7 @@ package Debian::Debhelper::Buildsystem::perl_makemaker; use strict; use warnings; -use Debian::Debhelper::Dh_Lib qw(compat); +use Debian::Debhelper::Dh_Lib qw(compat is_cross_compiling perl_cross_incdir); use parent qw(Debian::Debhelper::Buildsystem::makefile); use Config; @@ -51,12 +51,23 @@ sub configure { if ($ENV{CFLAGS} && ! compat(8)) { push @flags, "OPTIMIZE=$ENV{CFLAGS} $ENV{CPPFLAGS}"; } + my $cross_flag; + if (is_cross_compiling()) { + my $incdir = perl_cross_incdir(); + $cross_flag = "-I$incdir" if defined $incdir; + } if ($ENV{LDFLAGS} && ! compat(8)) { - push @flags, "LD=$Config{ld} $ENV{CFLAGS} $ENV{LDFLAGS}"; + my $ld = $Config{ld}; + $ld = qx/perl $cross_flag -MConfig -e 'print \$Config{ld}'/ + if is_cross_compiling() and defined $cross_flag; + push @flags, "LD=$ld $ENV{CFLAGS} $ENV{LDFLAGS}"; } push(@perl_flags, '-I.') if compat(10); + push @perl_flags, $cross_flag + if is_cross_compiling() and defined $cross_flag; + $this->doit_in_sourcedir("perl", @perl_flags, "Makefile.PL", "INSTALLDIRS=vendor", # if perl_build is not tested first, need to pass packlist # option to handle fallthrough case |