]> Pileus Git - ~andy/gtk/blob - acinclude.m4
Requires glib-2.3.0, pango-1.2.0.
[~andy/gtk] / acinclude.m4
1 # autoconf 2.13 / 2.50 compatibility macro
2
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
11 $1
12 AC_DIVERT_POP()])])])
13
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],
19 [ case "$$1 " in
20     *-l$2[[\ \  ]]*)               ;;
21     *)               $1="-l$2 $$1" ;;
22   esac
23 ])
24
25 # Checks the location of the XML Catalog
26 # Usage:
27 #   JH_PATH_XML_CATALOG
28 # Defines XMLCATALOG and XML_CATALOG_FILE substitutions
29 AC_DEFUN([JH_PATH_XML_CATALOG],
30 [
31   # check for the presence of the XML catalog
32   AC_ARG_WITH([xml-catalog],
33               AC_HELP_STRING([--with-xml-catalog=CATALOG],
34                              [path to xml catalog to use]),,
35               [with_xml_catalog=/etc/xml/catalog])
36   XML_CATALOG_FILE="$with_xml_catalog"
37   AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
38   if test -f "$XML_CATALOG_FILE"; then
39     AC_MSG_RESULT([found])
40   else
41     AC_MSG_RESULT([not found])
42     AC_MSG_ERROR([XML catalog not found])
43   fi
44   AC_SUBST([XML_CATALOG_FILE])
45
46   # check for the xmlcatalog program
47   AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
48   if test "x$XMLCATALOG" = xno; then
49     AC_MSG_ERROR([could not find xmlcatalog program])
50   fi
51 ])
52
53 # Checks if a particular URI appears in the XML catalog
54 # Usage:
55 #   JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
56 AC_DEFUN([JH_CHECK_XML_CATALOG],
57 [
58   AC_REQUIRE([JH_PATH_XML_CATALOG])dnl
59   AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
60   if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
61     AC_MSG_RESULT([found])
62     ifelse([$3],,,[$3
63 ])dnl
64   else
65     AC_MSG_RESULT([not found])
66     ifelse([$4],,
67        [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
68        [$4])
69   fi
70 ])