Subject: | Use Alien::LibXML to locate libxml libs, headers, etc |
This is a long-term wish for XML::LibXML's Makefile.PL, to help it
build on Windows and other platforms where the presence of libxml2 can
be less relied upon.
Alien::LibXML is a distribution (currently only devel releases on CPAN,
nothing usable yet) that aims to, by hook or by crook, get the libxml2
C library installed onto a computer. If libxml2 is already installed,
then it will be satisfied. Otherwise, it will attempt to download it
from the xmlsoft.org FTP site, compile and install it (somewhere hidden
away in the Perl lib dirs). Perhaps in the future, it may also attempt
to download pre-built binaries for some platforms (e.g. Win32).
Once Alien::LibXML is installed on a system, you can do this:
use Alien::LibXML;
use Text::ParseWords qw(shellwords);
my @cflags = shellwords( Alien::LibXML->cflags );
my @libs = shellwords( Alien::LibXML->libs );
So my wish is for XML::LibXML's Makefile.PL to make use of
Alien::LibXML. In particular, what I'd suggest is that early on in
Makefile.PL, it checks to see if Alien::LibXML is available, and if so,
just uses it, rather than shelling out to `xml-config`.
if (eval { require Alien::LibXML }) {
$config{LIBS} = Alien::LibXML->libs;
$config{INC} = Alien::LibXML->cflags;
}
else {
# current process goes here
}
And also, reference Alien::LibXML as a possible solution in error
messages where XML::LibXML doesn't end up compiling.
As I said, this is very long term. Alien::LibXML is nowhere near a
reliable state yet.