[PATCH] Use pkg-config to detect libxml2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

Debian dropped[1] xml2-config from libxml2-dev in experimental,
favoring the use of pkg-config instead. This caused some packages to
fail to build, autofs among them[2].

I'm submitting the attached patch for your consideration and
review/comments. I realize this is a distro change and shouldn't
affect autofs building when everything is installed from source,
unless libxml2 upstream decides to follow suit and drop xml2-config as
well.

Thanks!


1. https://salsa.debian.org/xml-sgml-team/libxml2/commit/53de4f8ae1469e9068a6ab341836e523324c64c3
2. https://bugs.debian.org/949055
--- a/configure.in
+++ b/configure.in
@@ -211,7 +211,10 @@
 AC_SUBST(ENABLE_FEDFS)
 
 # LDAP SASL auth needs libxml and Kerberos
-AF_CHECK_LIBXML()
+PKG_CHECK_MODULES([XML],[libxml-2.0],,
+[
+HAVE_LIBXML=0
+])
 AF_CHECK_KRB5()
 
 AC_SEARCH_LIBS([versionsort],[])
@@ -345,7 +348,7 @@
 	fi
 fi
 
-AC_SUBST(XML_FLAGS)
+AC_SUBST(XML_CFLAGS)
 AC_SUBST(XML_LIBS)
 AC_SUBST(SASL_FLAGS)
 AC_SUBST(HAVE_SASL)
--- a/Makefile.conf.in
+++ b/Makefile.conf.in
@@ -36,7 +36,7 @@
 
 # SASL support: yes (1) no (0)
 XML_LIBS = @XML_LIBS@
-XML_FLAGS = @XML_FLAGS@
+XML_FLAGS = @XML_CFLAGS@
 SASL = @HAVE_SASL@
 LIBSASL= @LIBSASL@
 SASL_FLAGS = @SASL_FLAGS@
diff --git a/aclocal.m4 b/aclocal.m4
index ec362bb..33561aa 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -272,38 +272,6 @@ else
 fi])
 ])
 
-dnl --------------------------------------------------------------------------
-dnl AF_CHECK_LIBXML
-dnl
-dnl Check for lib xml
-dnl --------------------------------------------------------------------------
-AC_DEFUN([AF_CHECK_LIBXML],
-[AC_PATH_PROGS(XML_CONFIG, xml2-config, no)
-AC_MSG_CHECKING(for libxml2)
-if test "$XML_CONFIG" = "no"
-then
-  AC_MSG_RESULT(no)
-  HAVE_LIBXML=0
-else
-  AC_MSG_RESULT(yes)
-  HAVE_LIBXML=1
-  XML_LIBS=`$XML_CONFIG --libs`
-  XML_FLAGS=`$XML_CONFIG --cflags`
-  XML_VER=`$XML_CONFIG --version`
-  XML_MAJOR=`echo $XML_VER|cut -d\. -f1`
-  if test $XML_MAJOR -le 99
-  then
-    XML_MINOR=`echo $XML_VER|cut -d\. -f2`
-    if test $XML_MINOR -le 99
-    then
-      XML_REV=`echo $XML_VER|cut -d\. -f3`
-      if test $XML_REV -le 99; then
-        AC_DEFINE(LIBXML2_WORKAROUND,1, [Use libxml2 tsd usage workaround])
-      fi
-    fi
-  fi
-fi])
-
 dnl --------------------------------------------------------------------------
 dnl AF_CHECK_KRB5
 dnl

[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux