CC: | vovkasm [...] gmail.com |
Subject: | [patch] fix configure error |
When xml2-config returns many paths (ex. "-I/usr/local/include/libxml2 -
I/usr/local/include" on FreeBSD), configure fails.
Because:
$incpath = "-I/usr/local/include/libxml2 -I/usr/local/include";
$incpath =~ s#(\b|\A)-I##g;
now $incpath is "/usr/local/include/libxml2 -I/usr/local/include"
correct regexp would be s#(\A|\s)-I#$1#g;
Plus in that case we need pass array to check_lib_or_exit (according to
Devel::CheckLib docs...)
Attached patch fixes that.
Subject: | xml-libxml-2.0005-fix-multi-incpaths.patch |
diff --git a/Makefile.PL b/Makefile.PL
index 764e80e..3106bbc 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -357,12 +357,12 @@ if ($ldflags) {
}
my $incpath = $config{INC};
-$incpath =~ s#(\b|\A)-I##g;
+$incpath =~ s#(\A|\s)\s*-I#$1#g;
check_lib_or_exit(
# fill in what you prompted the user for here
lib => [qw(xml2)],
- incpath => $incpath,
+ incpath => [split(/\s/,$incpath)],
header =>
[
'libxml/c14n.h',