[gtk-doc] configure: search for xml catalog in XDG_DATA_DIRS
- From: Stefan Kost <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] configure: search for xml catalog in XDG_DATA_DIRS
- Date: Thu, 2 Jan 2014 17:30:21 +0000 (UTC)
commit a551ffe1de2dddf8b7d17349efe2daceab4bb862
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Dec 29 00:36:05 2013 -0500
configure: search for xml catalog in XDG_DATA_DIRS
Detect the xml catalog file in either /etc/xml/catalog (currently the
only place we check) and also in XDG_DATA_DIRS/xml/catalog.
This will help find the XML catalog on systems that have it in
/usr/local/share/xml/catalog (like the BSDs) and will also help to find
it in the case that we've installed docbook ourselves as part of
bootstrapping jhbuild (like on Mac OS).
--with-xml-catalog is still supported and, if given, we will only
attempt to use the given path and not guess others.
https://bugzilla.gnome.org/show_bug.cgi?id=721228
m4/gtkdoc_jh_path_xml_catalog.m4 | 41 +++++++++++++++++++++++++++++++------
1 files changed, 34 insertions(+), 7 deletions(-)
---
diff --git a/m4/gtkdoc_jh_path_xml_catalog.m4 b/m4/gtkdoc_jh_path_xml_catalog.m4
index 1618906..cca2267 100644
--- a/m4/gtkdoc_jh_path_xml_catalog.m4
+++ b/m4/gtkdoc_jh_path_xml_catalog.m4
@@ -8,17 +8,44 @@ AC_DEFUN([JH_PATH_XML_CATALOG],
AC_ARG_WITH([xml-catalog],
AS_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])
+ [with_xml_catalog=''])
+ AC_MSG_CHECKING([for XML catalog])
+ if test -n "$with_xml_catalog"; then
+ dnl path was explicitly given. check that it exists.
+ if test -f "$with_xml_catalog"; then
+ jh_found_xmlcatalog=true
+ else
+ jh_found_xmlcatalog=false
+ fi
else
+ dnl if one was not explicitly specified, try some guesses
+ dnl we look first in /etc/xml/catalog, then XDG_DATA_DIRS/xml/catalog
+ if test -z "$XDG_DATA_DIRS"; then
+ dnl if we have no XDG_DATA_DIRS, use the default
+ jh_xml_catalog_searchdirs="/etc:/usr/local/share:/usr/share"
+ else
+ jh_xml_catalog_searchdirs="/etc:$XDG_DATA_DIRS"
+ fi
jh_found_xmlcatalog=false
+ dnl take care to iterate based on ':', allowing whitespace to appear in paths
+ jh_xml_catalog_saved_ifs="$IFS"
+ IFS=':'
+ for d in $jh_xml_catalog_searchdirs; do
+ if test -f "$d/xml/catalog"; then
+ with_xml_catalog="$d/xml/catalog"
+ jh_found_xmlcatalog=true
+ break
+ fi
+ done
+ IFS="$jh_xml_catalog_saved_ifs"
+ fi
+ if $jh_found_xmlcatalog; then
+ AC_MSG_RESULT([$with_xml_catalog])
+ else
AC_MSG_RESULT([not found])
fi
+ XML_CATALOG_FILE="$with_xml_catalog"
+ AC_SUBST([XML_CATALOG_FILE])
dnl check for the xmlcatalog program
AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]