I'm having trouble finding the right mix of environment vars and MakeMaker/Module::Build directives to build CPAN modules in a specific environment, and I could use some help.

The setup:

  1. I am using a compiled-from source perl, configured during the build process to be installed in /tmp/foo/.
  2. I have a build script that iterates through a set of CPAN modules in a directory, and builds/installs them in another path (/tmp/cpan) using /tmp/foo/bin/perl in the build process.

This works fine, with CPAN modules using both MakeMaker and Module::Build.

Now the problem:

perl, compiled and installed to /tmp/foo, might get moved to /tmp/bar. No recompilation of perl is possible at this point.

The build script must work now with /tmp/bar/bin/perl to build CPAN modules.

And this is where I'm getting stuck. Pure-perl modules seem to be ok with an updated $PERL5LIB, but modules that require C header files don't want to cooperate. I keep running into problems with modules being unable to find CORE/perl.h.

Adding LIB, PERL_LIB, or PERL_ARCHLIB directives to the call to Makefile.PL doesn't work, and I'm stuck at this point.

Suggestions very much appreciated!


In reply to Need help with environment vars and building CPAN modules by swngnmonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.