syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I can run perl Makefile.PL LIBS="-L/location -lmylib" and that will set LIBS as desired for the top level Makefile.PL. But the argument doesn't get passed on to any Makefile.PL in the distro's sub directories.

What do I need to do to ensure that the subdir Makefile.PL's also receive that command line argument ?

(This relates to one of my own modules, so there's no problem with making modifications to the existing Makefile.PL's if that's what's needed. It's just a matter of finding out what needs to be done. Perhaps someone knows of a distro that already caters for this.)

Cheers,
Rob

Replies are listed 'Best First'.
Re: MakeMaker, and passing command line arguments along.
by Anonymous Monk on Apr 16, 2010 at 08:47 UTC
      Its an open bug?

      Thanks for that. One of those links led me to XML::Parser and how it deals with the problem. And then I remembered that some of Tassilo von Parseval's modules parse the command line for INC and LIBS args, so I took a look at his Unix::Statgrab Makefile.PL.

      Seems to work fine if the top level Makefile.PL does:
      our %args = map { split /\s*=\s*/ } @ARGV; our $LIBS_LOC = $args{ LIBS } || "-lgmp"; our $INC_LOC = $args{ INC };
      and then the subdir Makefile.PL simply has to specify:
      WriteMakfile( .... LIBS => $LIBS_LOC, INC => $INC_LOC, .... );
      I haven't yet looked at any caveats with that approach. I'll get to that now.

      Thanks again.

      Cheers,
      Rob