]> www.fi.muni.cz Git - evince.git/blobdiff - configure.ac
Fix DBUS configure checks.
[evince.git] / configure.ac
index 70084aa479fa4550f1a77ef870ad871107942698..dbf81579ff4f3dea0d04b9f2ea32a10f510371f9 100644 (file)
@@ -50,25 +50,32 @@ PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= $POPPLER_REQUIRED)
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
 AC_SUBST(GLIB_GENMARSHAL)
 
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
 AC_SUBST(GLIB_GENMARSHAL)
 
-AC_ARG_ENABLE([dbus],
-        AS_HELP_STRING([--enable-dbus],[Enable DBUS (default=no)]),
-        [enable_dbus=$enableval],
-        [enable_dbus=no])
+PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
+       [enable_dbus=yes],[enable_dbus=no])
+AC_SUBST([DBUS_CFLAGS])
+AC_SUBST([DBUS_LIBS])
 
 
-AC_MSG_RESULT([$enable_dbus])
+if test "x$enable_dbus" = "xno"; then
+       AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
+fi
 
 if test "x$enable_dbus" = "xyes" ; then
 
 if test "x$enable_dbus" = "xyes" ; then
+        AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
+
+        if test x$DBUS_BINDING_TOOL = "xno" ; then
+               AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
+        fi                                            
+
         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
        AC_DEFINE([ENABLE_METADATA],[1],[Define if metadata support is enabled])
         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
        AC_DEFINE([ENABLE_METADATA],[1],[Define if metadata support is enabled])
-        PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
 
        DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0.\([[0-9]]*\)/\1/'`
        AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
 
        DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0.\([[0-9]]*\)/\1/'`
        AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
-       AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
 fi
 
 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
 AM_CONDITIONAL([ENABLE_METADATA], [test "x$enable_dbus" = "xyes"])
 fi
 
 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
 AM_CONDITIONAL([ENABLE_METADATA], [test "x$enable_dbus" = "xyes"])
+AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
 
 dnl Check for Nautilus property page build
 AC_ARG_ENABLE(nautilus,
 
 dnl Check for Nautilus property page build
 AC_ARG_ENABLE(nautilus,