diff configure.ac @ 11146:1c5398ccbeb0

[gaim-migrate @ 13217] Gaim-DBUS signal export works with DBUS >= 0.35 Various gaim API functions available through DBUS committer: Tailor Script <tailor@pidgin.im>
author Piotr Zielinski <zielaj>
date Fri, 22 Jul 2005 19:47:29 +0000
parents df3b825c1b46
children 616feca04ada
line wrap: on
line diff
--- a/configure.ac	Fri Jul 22 07:11:08 2005 +0000
+++ b/configure.ac	Fri Jul 22 19:47:29 2005 +0000
@@ -310,12 +310,12 @@
 
 AC_ARG_ENABLE(dbus,     [  --enable-dbus           enable DBUS support],,enable_dbus=no)
 
-if test "x$enable_dbus" = "xyes"; then
+if test "x$enable_dbus" = "xyes" ; then
    AC_CHECK_PROG(enable_dbus, dbus-binding-tool, yes, no)
 fi
 
-if test "x$enable_dbus" = "xyes"; then
-   	PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.34 dbus-glib-1 >= 0.34],
+if test "x$enable_dbus" = "xyes" ; then
+   	PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.35 dbus-glib-1 >= 0.35],
 	[
 		AC_SUBST(DBUS_CFLAGS)
 		AC_SUBST(DBUS_LIBS)
@@ -331,7 +331,35 @@
 	fi
 fi
 
-if test "x$enable_dbus" = "xyes"; then
+dnl  Why do we need python?  
+
+dnl  Python scripts are used to auto-generate about 3000 lines of C
+dnl  and XML code that wraps (part of) the existing Gaim API so that
+dnl  it is now accessible through DBUS.
+
+dnl  Python is only required if --enable-dbus is used, and only for
+dnl  the build process to generate the code, not for running gaim.
+dnl  This autogenerated code is system-independent, so in principle we
+dnl  can generate all of it before shipping.  But I thought adding
+dnl  auto-generated stuff to the CVS is inelegant.  Alternatively,
+dnl  these python scripts could be rewritten in C (brrrr ...).
+
+if test "x$enable_dbus" = "xyes" ; then
+        AC_PATH_PROG([PYTHON], [python], [no])
+	if test "x$PYTHON" = "xno" ; then
+		AC_MSG_WARN([python interpreter not found in your path])
+		enable_dbus=no
+	fi
+fi
+
+if test "x$enable_dbus" = "xyes" ; then
+	if $PYTHON -c "import sys; sys.exit(sys.version[[:3]] >= '2.4')" ; then
+		AC_MSG_WARN([python version >= 2.4 required])
+		enable_dbus=no
+	fi	
+fi
+
+if test "x$enable_dbus" = "xyes" ; then
    	AC_DEFINE(HAVE_DBUS, 1, [Define if we're using DBUS.])
 	echo "Building with DBUS support"
 else