On Thu, Aug 09, 2012 at 06:38:09AM -0700, Bill Moseley wrote:
> On Thu, Aug 9, 2012 at 3:48 AM, Shlomi Fish <[email protected]> wrote:
>
> > > perl Makefile.PL CC=whatever
> > >
> >
> > Many thanks, that worked like a charm. I believed I tried it, but maybe
> > I only tried setting the "CC" environment variable.
> >
>
>
> Why can't those variables be added via the environment?
>
> Or more related to a recent issue I had:
>
> If I'm installing a CPAN module via "cpan" or "cpanm" (or even as a
> dependency to some other module installed that way), how can I pass needed
> parameters to Makefile.PL?
>
> My specific situation is I'm setting up an environment for developers, and
> the goal is for them to check out some project and run Makefile.PL (or use
> cpanm --installdeps) to bring in all CPAN dependencies, but some of those
> dependencies need parameters passed to Makefile.PL.
>
> I can't seem to find it right now but isn't there a way to have site config
> files perl distribution to configure the build process -- such as to answer
> questions given during Makefile.PL?
This is a CPAN question.
But yes, the Distroprefs mechanism is perfectly suited to supply
additional parameters to one of the installation commands on
a distro by distro basis.
You would have to place a YAML file (or Data::Dumper output
file) in your preferences directory ("o conf prefs_dir" in a
cpan shell queries/sets the location), where you set a value for
"commandline" in the "pl" stage. Examples can be found in the
distroprefs subdirectory of the CPAN distro.
Have fun!
-Martin