New file to check for libxml.

2000-01-12  Martin Baulig  <martin@home-of-linux.org>

	* xml.m4: New file to check for libxml.

	* configure.in: Call `LIBGTOP_XML_HOOK' from `xml.m4' and
	add libxml libraries to `LIBGTOP_EXTRA_LIBS' when found.
This commit is contained in:
Martin Baulig
2000-01-12 16:13:56 +00:00
committed by Martin Baulig
parent fe86288e76
commit bb15be7198
3 changed files with 46 additions and 1 deletions

36
xml.m4 Normal file
View File

@@ -0,0 +1,36 @@
dnl
dnl LIBGTOP_XML_HOOK (script-if-xml-found, failflag)
dnl
dnl If failflag is "failure", script aborts due to lack of XML
dnl
dnl Check for availability of the libxml library
dnl the XML parser uses libz if available too
dnl
AC_DEFUN([LIBGTOP_XML_HOOK],[
LIBGTOP_XML_LIB=
AC_PATH_PROG(XML_CONFIG,xml-config,no)
if test "$XML_CONFIG" = no; then
if test x$2 = xfailure; then
AC_MSG_ERROR(Could not find xml-config)
else
AC_MSG_WARN(Could not find xml-config)
fi
else
AC_CHECK_LIB(xml, xmlNewDoc, [
$1
LIBGTOP_XML_LIB=`$XML_CONFIG --libs`
], [
if test x$2 = xfailure; then
AC_MSG_ERROR(Could not link sample xml program)
else
AC_MSG_WARN(Could not link sample xml program)
fi
], `$XML_CONFIG --libs`)
fi
AC_SUBST(LIBGTOP_XML_LIB)
])
AC_DEFUN([LIBGTOP_XML_CHECK], [
LIBGTOP_XML_HOOK([],failure)
])