Passing Environment and ExtUtils::MakeMaker options to CPAN methods
am 05.08.2005 17:42:54 von gordon.marlerI'm trying to fully automate the installation of a long list of modules
using methods in CPAN::Shell, rather than running that shell
interactively. For modules that require no interaction, this has been
easy.
However, there are many modules that require you to set specific
environment variables and/or pass options to ExtUtils::MakeMaker on the
command line, such as in this example for the XML::LibXML module:
cpan> look XML::LibXML
$ XMLPREFIX=/usr/local/src/libxml2/2.6.13 \
/full/path/to/perl Makefile.PL \
LIBS='-L/usr/local/lib -R/usr/local/lib -L/usr/lib -lxml2 -lz -lm' \
INC='-I/usr/local/include/libxml2 -I/usr/include'
$ make
$ make test
$ make install
$ exit
After searching for solutions to accomplishing the same result using
CPAN::Shell, Module::Install, etc, I'm still not clear on how I'd pass
this information to the CPAN::Shell->make() method, for instance.
I'm sure it would be easy to pass the environment variable indirectly
by setting $ENV{XMLPREFIX} prior to calling CPAN::Shell->make(), but
that still leaves the options that need to be passed to
ExtUtils::MakeMaker.
Any pointers appreciated.