Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
authorMatthias Clasen <matthiasc@src.gnome.org>
Sun, 10 Aug 2003 22:24:17 +0000 (22:24 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 10 Aug 2003 22:24:17 +0000 (22:24 +0000)
* acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
acinclude.m4

index ec843b5..e087bf5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-11  Matthias Clasen  <maclas@gmx.de>
+
+       * acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
+       gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)
+
 2003-08-10  Tor Lillqvist  <tml@iki.fi>
 
        * glib/gutils.c (g_getenv): Don't use a cache of variable name to
index ec843b5..e087bf5 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Matthias Clasen  <maclas@gmx.de>
+
+       * acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
+       gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)
+
 2003-08-10  Tor Lillqvist  <tml@iki.fi>
 
        * glib/gutils.c (g_getenv): Don't use a cache of variable name to
index ec843b5..e087bf5 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Matthias Clasen  <maclas@gmx.de>
+
+       * acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
+       gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)
+
 2003-08-10  Tor Lillqvist  <tml@iki.fi>
 
        * glib/gutils.c (g_getenv): Don't use a cache of variable name to
index ec843b5..e087bf5 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Matthias Clasen  <maclas@gmx.de>
+
+       * acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
+       gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)
+
 2003-08-10  Tor Lillqvist  <tml@iki.fi>
 
        * glib/gutils.c (g_getenv): Don't use a cache of variable name to
index ec843b5..e087bf5 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Matthias Clasen  <maclas@gmx.de>
+
+       * acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
+       gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)
+
 2003-08-10  Tor Lillqvist  <tml@iki.fi>
 
        * glib/gutils.c (g_getenv): Don't use a cache of variable name to
index ec843b5..e087bf5 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Matthias Clasen  <maclas@gmx.de>
+
+       * acinclude.m4: Copy newer versions of JH_CHECK_XML_CATALOG and JH_PATH_XML_CATALOG from
+       gtk-doc to enable configuring without xmlcatalog in PATH.  (#119115)
+
 2003-08-10  Tor Lillqvist  <tml@iki.fi>
 
        * glib/gutils.c (g_getenv): Don't use a cache of variable name to
index 4d01801..f686739 100644 (file)
@@ -126,19 +126,50 @@ if test $ac_cv_func_printf_unix98 = yes; then
 fi
 ])# AC_FUNC_PRINTF_UNIX98
 
+# Checks the location of the XML Catalog
+# Usage:
+#   JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# Defines XMLCATALOG and XML_CATALOG_FILE substitutions
+AC_DEFUN([JH_PATH_XML_CATALOG],
+[
+  # check for the presence of the XML catalog
+  AC_ARG_WITH([xml-catalog],
+              AC_HELP_STRING([--with-xml-catalog=CATALOG],
+                             [path to xml catalog to use]),,
+              [with_xml_catalog=/etc/xml/catalog])
+  jh_found_xmlcatalog=true
+  XML_CATALOG_FILE="$with_xml_catalog"
+  AC_SUBST([XML_CATALOG_FILE])
+  AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
+  if test -f "$XML_CATALOG_FILE"; then
+    AC_MSG_RESULT([found])
+  else
+    jh_found_xmlcatalog=false
+    AC_MSG_RESULT([not found])
+  fi
+
+  # check for the xmlcatalog program
+  AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
+  if test "x$XMLCATALOG" = xno; then
+    jh_found_xmlcatalog=false
+  fi
+
+  if $jh_found_xmlcatalog; then
+    ifelse([$1],,[:],[$1])
+  else
+    ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
+  fi
+])
+
 # Checks if a particular URI appears in the XML catalog
 # Usage:
 #   JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 AC_DEFUN([JH_CHECK_XML_CATALOG],
 [
-  AC_ARG_WITH([xml-catalog],
-               AC_HELP_STRING([--with-xml-catalog=CATALOG],
-                              [path to xml catalog to use]),,
-               [with_xml_catalog=/etc/xml/catalog])
-  XML_CATALOG_FILE="$with_xml_catalog"  
-  AC_PATH_PROG(XMLCATALOG, xmlcatalog, /bin/false)
+  AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
   AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
-  if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
+  if $jh_found_xmlcatalog && \
+     AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
     AC_MSG_RESULT([found])
     ifelse([$3],,,[$3
 ])dnl