1 dnl call this macro with the minimum required version as an argument
2 dnl this macro sets and AC_SUBSTs XML_CFLAGS and XML_LIBS
3 dnl it also sets LIBXML_PKG, used for the pkg-config file
5 AC_DEFUN([AG_GST_LIBXML2_CHECK],
7 dnl Minimum required version of libxml2
8 dnl default to 2.4.9 if not specified
9 LIBXML2_REQ=ifelse([$1],,2.4.9,[$1])
13 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ,
18 if test "x$HAVE_LIBXML2" = "xyes"; then
19 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
21 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
23 dnl this is for the .pc file
24 LIBXML_PKG=', libxml-2.0'
29 dnl XML_LIBS might pull in -lz without zlib actually being on the system, so
30 dnl try linking with these LIBS and CFLAGS
31 ac_save_CFLAGS=$CFLAGS
33 CFLAGS="$CFLAGS $XML_CFLAGS"
34 LIBS="$LIBS $XML_LIBS"
36 #include <libxml/tree.h>
41 AC_MSG_NOTICE([Test xml2 program linked]),
42 AC_MSG_ERROR([Could not link libxml2 test program. Check if you have the necessary dependencies.])
44 CFLAGS="$ac_save_CFLAGS"