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