in reply to How to get Ext::Liblist to recognise different library paths?

http://cpansearch.perl.org/src/MSERGEANT/XML-Parser-2.36/Makefile.PL
EXPATLIBPATH=... To set the directory in which to find libexpat EXPATINCPATH=... To set the directory in which to find expat.h

Replies are listed 'Best First'.
Re^2: How to get Ext::Liblist to recognise different library paths?
by syphilis (Archbishop) on Dec 10, 2009 at 10:37 UTC
    To elaborate a little ... during the Makefile.PL stage you should see a message that tells you to start the build process with perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/include when libexpat is not found. (This is assuming that libexpat is in /home/me/lib and expat.h is in /home/me/include ... modify as necessary.)

    I personally prefer to take a different approach with the appalling Makefile.PL that ships with the XML::Parser source distro - I simply replace it with a Makefile.PL that contains:
    use ExtUtils::MakeMaker; WriteMakefile( NAME => 'XML::Parser', VERSION_FROM => 'Parser.pm', PREREQ_PM => { LWP => 0, #for tests } );
    If the expat library is in a location that EU::MM finds by default, then it's just a matter of starting with perl Makefile.PL.
    Otherwise, we have to run perl Makefile.PL LIBS=-L/home/me/lib INC=-I/home/me/include (again, modify those paths as necessary).

    Why the author insists on putting so much unnecessary crud (that doesn't even work properly !) into his Makefile.PL is completely and utterly beyond my comprehension.

    Cheers,
    Rob

    Update: I think I was mistaken about my simplified Makefile.PL working when libexpat is not found by default. (I think some other modifications to either the top level Makefile.PL or Expat/Makefile.PL are also needed.)
    Probably simplest to just use the original Makefile.PL and go with the EXPATINCPATH/EXPATLIBPATH kludge when libexpat is not found by default.