summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2002-08-10 22:29:54 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2002-08-10 22:29:54 +0000
commit49b94b4d92a9621d42aa6c80bd720e2abc747fe4 (patch)
tree05bd207950ddc64379269268b4cb439274297861
parent59ed6821982c4f5f989b1a635e34dc782d0a8e32 (diff)
xml check fix cross your fingers
Original commit message from CVS: xml check fix cross your fingers
-rw-r--r--m4/gst-libxml2.m449
1 files changed, 34 insertions, 15 deletions
diff --git a/m4/gst-libxml2.m4 b/m4/gst-libxml2.m4
index 4cda73c..9041ec9 100644
--- a/m4/gst-libxml2.m4
+++ b/m4/gst-libxml2.m4
@@ -1,17 +1,36 @@
-AC_DEFUN(GST_LIBXML2_CHECK, [
-dnl Minimum required version of libxml2
-LIBXML2_REQ="2.4.0"
-AC_SUBST(LIBXML2_REQ)
+AC_DEFUN(GST_LIBXML2_CHECK,
+[
+ dnl Minimum required version of libxml2
+ LIBXML2_REQ="2.4.0"
+ AC_SUBST(LIBXML2_REQ)
-dnl check for libxml2
-LIBXML_PKG=', libxml-2.0'
-PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
-if test "x$HAVE_LIBXML2" = "xyes"; then
- AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
-else
- AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
-fi
-AC_SUBST(LIBXML_PKG)
-AC_SUBST(XML_LIBS)
-AC_SUBST(XML_CFLAGS)
+ dnl check for libxml2
+ PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ,
+ HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+ if test "x$HAVE_LIBXML2" = "xyes"; then
+ AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
+ else
+ AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
+ fi
+ AC_SUBST(LIBXML_PKG)
+ AC_SUBST(XML_LIBS)
+ AC_SUBST(XML_CFLAGS)
+
+ dnl XML_LIBS might pull in -lz without zlib actually being on the system, so
+ dnl try linking with these LIBS and CFLAGS
+ ac_save_CFLAGS=$CFLAGS
+ ac_save_LIBS=$LIBS
+ CFLAGS="$CFLAGS $XML_CFLAGS"
+ LIBS="$LIBS $XML_LIBS"
+ AC_TRY_LINK([
+#include <libxml/tree.h>
+#include <stdio.h>
+],[
+/* function body */
+],
+ AC_MSG_NOTICE([Test xml2 program linked]),
+ AC_MSG_ERROR([Could not link libxml2 test program. Check if you have the necessary dependencies.])
+ )
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
])