2 dnl Populate XML_CFLAGS and XML_LIBS with infomation for
3 dnl linking with libxml2
4 AC_DEFUN([XIPH_PATH_XML],
6 AC_MSG_RESULT([checking for XML configuration])
7 AC_ARG_VAR([XMLCONFIG],[XML configuration program])
8 AC_ARG_WITH(xml-config,
9 [AC_HELP_STRING([--with-xml-config=PATH],
10 [use xml-config in PATH to find libxml])],
11 [XMLCONFIG="$withval"],
12 [AC_PATH_PROGS(XMLCONFIG, [xml2-config xml-config], "")]
14 if test "x$XMLCONFIG" = "x"; then
15 AC_MSG_ERROR([XML configuration could not be found])
17 if ! test -x "$XMLCONFIG"; then
18 AC_MSG_ERROR([$XMLCONFIG cannot be executed])
20 XML_LIBS="$($XMLCONFIG --libs)"
21 XML_CFLAGS="$($XMLCONFIG --cflags)"
22 ac_xml_save_LIBS="$LIBS"
23 ac_xml_save_CFLAGS="$CFLAGS"
24 LIBS="$XML_LIBS $LIBS"
25 CFLAGS="$CFLAGS $XML_CFLAGS"
26 AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([Unable to link with libxml])])
27 CFLAGS="$ac_xml_save_CFLAGS"
28 LIBS="$ac_xml_save_LIBS"
32 dnl Populate XSLT_CFLAGS and XSLT_LIBS with infomation for
33 dnl linking with libxml2
34 AC_DEFUN([XIPH_PATH_XSLT],
36 AC_ARG_VAR([XSLTCONFIG],[XSLT configuration program])
37 AC_ARG_WITH(xslt-config,
38 [AC_HELP_STRING([--with-xslt-config=PATH],
39 [use xslt-config in PATH to find libxslt])],
40 [XSLTCONFIG="$withval"],
41 [AC_PATH_PROGS(XSLTCONFIG, [xslt-config], "")]
43 if test "x$XSLTCONFIG" = "x"; then
44 AC_MSG_ERROR([XSLT configuration could not be found])
46 if ! test -x "$XSLTCONFIG"; then
47 AC_MSG_ERROR([$XSLTCONFIG cannot be executed])
49 XSLT_LIBS="$($XSLTCONFIG --libs)"
50 XSLT_CFLAGS="$($XSLTCONFIG --cflags)"
51 ac_xslt_save_LIBS="$LIBS"
52 ac_xslt_save_CFLAGS="$CFLAGS"
53 LIBS="$XSLT_LIBS $LIBS"
54 CFLAGS="$CFLAGS $XSLT_CFLAGS"
55 AC_CHECK_FUNC(xsltParseStylesheetFile,,[AC_MSG_ERROR([Unable to link with libxslt])])
56 CFLAGS="$ac_xslt_save_CFLAGS"
57 LIBS="$ac_xslt_save_LIBS"