Bug#660195: Passing variables down to recursive Makefile.PL invocations

Niko Tyni ntyni at debian.org
Sun Mar 4 07:16:46 UTC 2012


Hi makemaker people,

as discussed five years ago in [rt.cpan.org #28632], when building a
distribution with separate Makefile.PL files in subdirectories,
command line arguments to Makefile.PL are not passed through
to recursive invocations. This seems to be the case for the
current versions too, up to and including v6.63_02-9-g5072697 in
<http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker>.

I'm bringing this up here on the makemaker list as Michael Schwern
suggested so in the ticket.

To summarize, the top level invocation
 perl Makefile.PL LD=foo
will only affect the LD setting in the generated top-level Makefile but
not in the subdirectory Makefile, which is generated from the subdirectory
Makefile.PL.

We're facing this in Debian because we need a way to set security related
linker flags (-Wl,-z,relro to be precise) for the build, and the flags are
not propagated to subdirectories in distributions like Imager (on CPAN.)
That's http://bugs.debian.org/660195 (cc'd) FWIW.

I've looked into this (for the MM_Unix part), and I see two whitelists
of variables that do affect the recursively generated Makefiles or
the respective 'make' invocations. Any others seem to get ignored
in subdirectories.

- ExtUtils::MakeMaker::new() lists POLLUTE PERL_CORE LINKTYPE. POLLUTE
  has special handling, but the others get set in the 'MakeMaker
  constants' section of the generated subdirectory Makefile.
- ExtUtils::MM_Unix::passthru() lists LIB LIBPERL_A LINKTYPE OPTIMIZE
  PREFIX INSTALL_BASE. Those get added to the recursive make
  invocation command line in the top level Makefile (via the 'Makemaker
  subdirs' section and the PASTHRU variable.)

For the time being, I've patched the latter list for Debian to include
LD, but I was wondering how much of this is working as designed.
Why aren't all command line settings propagated?

There's a test case in the CPAN ticket so I'll spare the details,
but let me know if you need any.

Many thanks for your work on MakeMaker,
-- 
Niko Tyni   ntyni at debian.org






More information about the Perl-maintainers mailing list