For one of my XS based Perl modules that depends on a C library, I use Dist::Zilla
together with with the MakeMaker::Awesome
plugin to create my Makefile.PL
.
In order to pass options to Makefile.PL
(especially INC
and LIBS
), I used to set the PERL_MM_OPT
environment variable which worked fine so far.
Now I want to use Devel::CheckLib
to check for the presence of the C library. Devel::CheckLib
also supports INC
and LIBS
when supplied via the command line, but it doesn't read these options from PERL_MM_OPT
.
How can I make dzil test
pass command line arguments to Makefile.PL
?
From a quick look at the source of the MakeMaker::Runner
plugin this doesn't seem to be supported. Is there another work-around?
Passing arguments to Makefile.PL
simply isn't supported by dzil
and probably will never be. As a work-around, I add the contents of PERL_MM_OPT
to a local copy of @ARGV
before calling into Devel::CheckLib
:
{
local @ARGV;
unshift(@ARGV, ExtUtils::MakeMaker::_shellwords($ENV{PERL_MM_OPT} || ''));
check_lib_or_exit(...);
}
Ugly, but works.