aboutsummaryrefslogtreecommitdiffstats
path: root/macros/gnome-xml-check.m4
blob: 9406b640ccdd7bf81db0fd99eece8a5a55ce26db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
dnl
dnl Check for availability of the libxml library
dnl the XML parser uses libz if available too
dnl

AC_DEFUN([GNOME_XML_HOOK],[
    dnl Checks for zlib library.
    Z_LIBS=
    AC_CHECK_LIB(z, inflate,
      AC_CHECK_HEADER(zlib.h, Z_LIBS="-lz"))

    AC_REQUIRE([GNOME_INIT_HOOK])
    GNOME_XML_LIB=""
    AC_CHECK_LIB(xml, xmlNewDoc, GNOME_XML_LIB="-lxml",
                 GNOME_XML_LIB="itwwci", -L$gnome_prefix $Z_LIBS)
    AC_SUBST(GNOME_XML_LIB)
    AC_PROVIDE([GNOME_XML_HOOK])

    if test "$GNOME_XML_LIB" = "itwwci"; then
        if test x$2 = xfailure; then
            AC_MSG_ERROR(Could not find xml)
        fi
    fi
])

AC_DEFUN([GNOME_XML_CHECK], [
    GNOME_XML_HOOK([],failure)
])