2 # Checks the location of the XML Catalog
4 # JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
5 # Defines XMLCATALOG and XML_CATALOG_FILE substitutions
6 AC_DEFUN([JH_PATH_XML_CATALOG],
8 # check for the presence of the XML catalog
9 AC_ARG_WITH([xml-catalog],
10 AC_HELP_STRING([--with-xml-catalog=CATALOG],
11 [path to xml catalog to use]),,
12 [with_xml_catalog=/etc/xml/catalog])
13 jh_found_xmlcatalog=true
14 XML_CATALOG_FILE="$with_xml_catalog"
15 AC_SUBST([XML_CATALOG_FILE])
16 AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
17 if test -f "$XML_CATALOG_FILE"; then
18 AC_MSG_RESULT([found])
20 jh_found_xmlcatalog=false
21 AC_MSG_RESULT([not found])
24 # check for the xmlcatalog program
25 AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
26 if test "x$XMLCATALOG" = xno; then
27 jh_found_xmlcatalog=false
30 if $jh_found_xmlcatalog; then
31 ifelse([$1],,[:],[$1])
33 ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
37 # Checks if a particular URI appears in the XML catalog
39 # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
40 AC_DEFUN([JH_CHECK_XML_CATALOG],
42 AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
43 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
44 if $jh_found_xmlcatalog && \
45 AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
46 AC_MSG_RESULT([found])
50 AC_MSG_RESULT([not found])
52 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],