1
dnl Copyright (C) 2009 Sun Microsystems
2
dnl This file is free software; Sun Microsystems
3
dnl gives unlimited permission to copy and/or distribute it,
4
dnl with or without modifications, as long as this notice is preserved.
6
dnl Provides support for finding libxml2.
7
dnl LIBXML2_CFLAGS will be set, in addition to LIBXML2 and LTLIBXML2
9
AC_DEFUN([_PANDORA_SEARCH_LIBXML2],[
10
AC_REQUIRE([AC_LIB_PREFIX])
12
dnl --------------------------------------------------------------------
14
dnl --------------------------------------------------------------------
16
AC_ARG_ENABLE([libxml2],
17
[AS_HELP_STRING([--disable-libxml2],
18
[Build with libxml2 support @<:@default=on@:>@])],
19
[ac_enable_libxml2="$enableval"],
20
[ac_enable_libxml2="yes"])
22
AS_IF([test "x$ac_enable_libxml2" = "xyes"],[
23
AC_LIB_HAVE_LINKFLAGS(xml2,,[
24
#include <libxml/xmlversion.h>
26
const char *test= LIBXML_DOTTED_VERSION;
32
AS_IF([test "${ac_cv_libxml2}" = "no" -a "${ac_enable_libxml2}" = "yes"],[
34
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [
36
LTLIBXML2=${LIBXML2_LIBS}
37
LIBXML2=${LIBXML2_LIBS}
41
AM_CONDITIONAL(HAVE_LIBXML2, [test "${ac_cv_libxml2}" = "yes"])
44
AC_DEFUN([PANDORA_HAVE_LIBXML2],[
45
AC_REQUIRE([_PANDORA_SEARCH_LIBXML2])
48
AC_DEFUN([PANDORA_REQUIRE_LIBXML2],[
49
AC_REQUIRE([_PANDORA_SEARCH_LIBXML2])
50
AS_IF([test "x${ac_cv_libxml2}" = "xno"],
51
AC_MSG_ERROR([libxml2 is required for ${PACKAGE}. On Debian systems this is found in libxml2-dev. On RedHat, libxml2-devel.]))