]> git.donarmstrong.com Git - debhelper.git/commitdiff
pass dpkg-buildflags to makemaker build system
authorSteve Langasek <steve.langasek@canonical.com>
Wed, 28 Sep 2011 19:37:42 +0000 (12:37 -0700)
committerJoey Hess <joey@kitenet.net>
Thu, 29 Sep 2011 19:34:36 +0000 (15:34 -0400)
The standard way to pass build flags to makemaker perl build systems is to
set the OPTIMIZE variable on the commandline; CFLAGS in the environment gets
ignored entirely.  So pass the CFLAGS from the environment to Makefile.PL so
makemaker packages can also benefit from dpkg-buildflags.

Debian/Debhelper/Buildsystem/perl_makemaker.pm

index 72f8d8c51bcc73b13dde7f26c1280a86e6044ddf..0e9ff4c5bca4796b01ba9290c66c847b542d861e 100644 (file)
@@ -39,17 +39,22 @@ sub new {
 
 sub configure {
        my $this=shift;
+       my @flags;
        # If set to a true value then MakeMaker's prompt function will
        # # always return the default without waiting for user input.
        $ENV{PERL_MM_USE_DEFAULT}=1;
        # This prevents  Module::Install from interactive behavior.
        $ENV{PERL_AUTOINSTALL}="--skipdeps";
 
+        if ($ENV{CFLAGS}) {
+                push @flags, "OPTIMIZE=$ENV{CFLAGS}";
+        }
+
        $this->doit_in_sourcedir("perl", "Makefile.PL", "INSTALLDIRS=vendor",
                # if perl_build is not tested first, need to pass packlist
                # option to handle fallthrough case
                (compat(7) ? "create_packlist=0" : ()),
-               @_);
+               @flags, @_);
 }
 
 sub install {