Initial revision
[gpiv.git] / macros / gnome-xml-check.m4
blob4bc91d124d5ccf25858e29b81405444c78494efa
1 dnl
2 dnl GNOME_XML_HOOK (script-if-xml-found, failflag)
3 dnl
4 dnl If failflag is "failure", script aborts due to lack of XML
5 dnl 
6 dnl Check for availability of the libxml library
7 dnl the XML parser uses libz if available too
8 dnl
10 AC_DEFUN([GNOME_XML_HOOK],[
11         AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
12         if test "$GNOME_CONFIG" = no; then
13                 if test x$2 = xfailure; then
14                         AC_MSG_ERROR(Could not find gnome-config)
15                 fi
16         fi
17         AC_CHECK_LIB(xml, xmlNewDoc, [
18                 $1
19                 GNOME_XML_LIB=`$GNOME_CONFIG --libs xml`
20         ], [
21                 if test x$2 = xfailure; then 
22                         AC_MSG_ERROR(Could not link sample xml program)
23                 fi
24         ], `$GNOME_CONFIG --libs xml`)
25         AC_SUBST(GNOME_XML_LIB)
28 AC_DEFUN([GNOME_XML_CHECK], [
29         GNOME_XML_HOOK([],failure)