2 # Checks the location of the XML Catalog
4 # JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
5 # Defines XMLCATALOG and XML_CATALOG_FILE substitutions
6 AC_DEFUN([JH_PATH_XML_CATALOG],
8 # check for the presence of the XML catalog
9 AC_ARG_WITH([xml-catalog],
10 AC_HELP_STRING([--with-xml-catalog=CATALOG],
11 [path to xml catalog to use]),,
12 [with_xml_catalog=/etc/xml/catalog])
13 jh_found_xmlcatalog=true
14 XML_CATALOG_FILE="$with_xml_catalog"
15 AC_SUBST([XML_CATALOG_FILE])
16 AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
17 if test -f "$XML_CATALOG_FILE"; then
18 AC_MSG_RESULT([found])
20 jh_found_xmlcatalog=false
21 AC_MSG_RESULT([not found])
24 # check for the xmlcatalog program
25 AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
26 if test "x$XMLCATALOG" = xno; then
27 jh_found_xmlcatalog=false
30 if $jh_found_xmlcatalog; then
31 ifelse([$1],,[:],[$1])
33 ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
37 # Checks if a particular URI appears in the XML catalog
39 # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
40 AC_DEFUN([JH_CHECK_XML_CATALOG],
42 AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
43 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
44 if $jh_found_xmlcatalog && \
45 AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
46 AC_MSG_RESULT([found])
50 AC_MSG_RESULT([not found])
52 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
58 dnl REMOVE THIS WHEN introspection.m4 is widely available
60 dnl -*- mode: autoconf -*-
61 dnl Copyright 2009 Johan Dahlin
63 dnl This file is free software; the author(s) gives unlimited
64 dnl permission to copy and/or distribute it, with or without
65 dnl modifications, as long as this notice is preserved.
70 m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
72 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
73 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
74 AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
76 dnl enable/disable introspection
77 m4_if([$2], [require],
79 enable_introspection=yes
81 AC_ARG_ENABLE(introspection,
82 AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
83 [Enable introspection for this build]),,
84 [enable_introspection=auto])
87 AC_MSG_CHECKING([for gobject-introspection])
89 dnl presence/version checking
90 AS_CASE([$enable_introspection],
92 found_introspection="no (disabled, use --enable-introspection to enable)"
95 PKG_CHECK_EXISTS([gobject-introspection-1.0],,
96 AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
97 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
98 found_introspection=yes,
99 AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
102 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
105 AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
108 AC_MSG_RESULT([$found_introspection])
110 INTROSPECTION_SCANNER=
111 INTROSPECTION_COMPILER=
112 INTROSPECTION_GENERATE=
113 INTROSPECTION_GIRDIR=
114 INTROSPECTION_TYPELIBDIR=
115 if test "x$found_introspection" = "xyes"; then
116 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
117 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
118 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
119 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
120 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
121 INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
122 INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
123 INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
125 AC_SUBST(INTROSPECTION_SCANNER)
126 AC_SUBST(INTROSPECTION_COMPILER)
127 AC_SUBST(INTROSPECTION_GENERATE)
128 AC_SUBST(INTROSPECTION_GIRDIR)
129 AC_SUBST(INTROSPECTION_TYPELIBDIR)
130 AC_SUBST(INTROSPECTION_CFLAGS)
131 AC_SUBST(INTROSPECTION_LIBS)
132 AC_SUBST(INTROSPECTION_MAKEFILE)
134 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
139 dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
141 AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
143 _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
147 dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
150 AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
152 _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])