1 # autoconf 2.13 / 2.50 compatibility macro
3 # GLIB_AC_DIVERT_BEFORE_HELP(STUFF)
4 # ---------------------------------
5 # Put STUFF early enough so that they are available for $ac_help expansion.
6 # Handle both classic (<= v2.13) and modern autoconf
7 AC_DEFUN([GLIB_AC_DIVERT_BEFORE_HELP],
8 [ifdef([m4_divert_text], [m4_divert_text([NOTICE],[$1])],
9 [ifdef([AC_DIVERT], [AC_DIVERT([NOTICE],[$1])],
10 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
14 # GTK_ADD_LIB(VAR,LIBNAME)
15 # ---------------------------------
16 # Helper macro to add a -lBlah to a variable, avoiding repeats
17 # Note that this needs to be quoted when used in an enclosing macro
18 AC_DEFUN([GTK_ADD_LIB],
26 # Checks the location of the XML Catalog
28 # JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
29 # Defines XMLCATALOG and XML_CATALOG_FILE substitutions
30 AC_DEFUN([JH_PATH_XML_CATALOG],
32 # check for the presence of the XML catalog
33 AC_ARG_WITH([xml-catalog],
34 AC_HELP_STRING([--with-xml-catalog=CATALOG],
35 [path to xml catalog to use]),,
36 [with_xml_catalog=/etc/xml/catalog])
37 jh_found_xmlcatalog=true
38 XML_CATALOG_FILE="$with_xml_catalog"
39 AC_SUBST([XML_CATALOG_FILE])
40 AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
41 if test -f "$XML_CATALOG_FILE"; then
42 AC_MSG_RESULT([found])
44 jh_found_xmlcatalog=false
45 AC_MSG_RESULT([not found])
48 # check for the xmlcatalog program
49 AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
50 if test "x$XMLCATALOG" = xno; then
51 jh_found_xmlcatalog=false
54 if $jh_found_xmlcatalog; then
55 ifelse([$1],,[:],[$1])
57 ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
61 # Checks if a particular URI appears in the XML catalog
63 # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
64 AC_DEFUN([JH_CHECK_XML_CATALOG],
66 AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
67 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
68 if $jh_found_xmlcatalog && \
69 AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
70 AC_MSG_RESULT([found])
74 AC_MSG_RESULT([not found])
76 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],