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

I'm building XML::Parser, but I'm not sure if this problem is specific to XML::Parser or applies to MakeMaker in general. It has a top-level Makefile.PL, and another one in a subdirectory - Expat/Makefile.PL. When I run perl Makefile.PL LDFLAGS=... at the top level, both Makefiles get built, but the one in Expat/ doesn't use my LDFLAGS. Expat/Makefile has a comment showing the MakeMaker ARGV, which includes my LDFLAGS, but the actual LDFLAGS Makefile variable only includes the flags from Perl's Config.pm.

Is there something I can do when invoking perl Makefile.PL that will get my LDFLAGS to appear in Expat/Makefile as well as the top-level Makefile?

Replies are listed 'Best First'.
Re: passing variable assignments to Makefile.PL in a subdirectory
by syphilis (Archbishop) on Dec 26, 2008 at 07:29 UTC
    According to the top level Makefile.PL (for XML-Parser-2.36):
    If expat is installed, but in a non-standard directory, then use the following options to Makefile.PL: EXPATLIBPATH=... To set the directory in which to find libexpat EXPATINCPATH=... To set the directory in which to find expat.h For example: perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/i +nclude Note that if you build against a shareable library in a non-standard l +ocation you may (on some platforms) also have to set your LD_LIBRARY_PATH envi +ronment variable at run time for perl to find the library.
    That's all I've ever needed to do. (Admittedly I haven't checked to see whether that advice is still current.)

    Cheers,
    Rob
Re: passing variable assignments to Makefile.PL in a subdirectory
by Anonymous Monk on Dec 25, 2008 at 22:58 UTC
    Edit Makefile.PL