changeset 86939:3adb90e40145

* configure.in: Add D-Bus checks. D-Bus is disabled by default. * configure: Regenerate. * Makefile.in (INFO_FILES): Add dbus.
author Michael Albinus <michael.albinus@gmx.de>
date Sun, 02 Dec 2007 15:46:00 +0000
parents 2c4cf44f634f
children 2dd672d9fe75
files ChangeLog Makefile.in configure configure.in
diffstat 4 files changed, 164 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 02 11:19:38 2007 +0000
+++ b/ChangeLog	Sun Dec 02 15:46:00 2007 +0000
@@ -1,3 +1,11 @@
+2007-12-02  Michael Albinus  <michael.albinus@gmx.de>
+
+	* configure.in: Add D-Bus checks.  D-Bus is disabled by default.
+
+	* configure: Regenerate.
+
+	* Makefile.in (INFO_FILES): Add dbus.
+
 2007-12-02  Romain Francoise  <romain@orebokech.com>
 
 	* make-dist: Fix last change.
--- a/Makefile.in	Sun Dec 02 11:19:38 2007 +0000
+++ b/Makefile.in	Sun Dec 02 15:46:00 2007 +0000
@@ -142,7 +142,7 @@
            eintr elisp emacs emacs-mime erc eshell eudc flymake forms	\
            gnus idlwave info message mh-e newsticker nxml-mode org	\
            pcl-cvs pgg rcirc reftex remember sc ses sieve speedbar	\
-           tramp vip viper widget woman smtpmail url
+           tramp vip viper widget woman smtpmail url @DBUS_INFO@
 
 # Directory for local state files for all programs.
 localstatedir=@localstatedir@
@@ -424,7 +424,7 @@
 ## Note that the Makefiles in the etc directory are potentially useful
 ## in an installed Emacs, so should not be excluded.
 
-## installuser: 
+## installuser:
 ## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
 ## Nuisance because i) it needs to be the user running install, so
 ## configure can't set it; ii) can't (?) use the result of rule
--- a/configure	Sun Dec 02 11:19:38 2007 +0000
+++ b/configure	Sun Dec 02 15:46:00 2007 +0000
@@ -412,10 +412,10 @@
 fi
 
 test \$exitcode = 0") || {
-  echo Please tell bug-autoconf@gnu.org about your system,
-  echo including any error possibly output before this message.
-  echo This can help us improve future autoconf versions.
-  echo Configuration will now proceed without shell functions.
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
 }
 
 
@@ -692,6 +692,9 @@
 RSVG_LIBS
 GTK_CFLAGS
 GTK_LIBS
+DBUS_CFLAGS
+DBUS_LIBS
+DBUS_INFO
 XFT_CFLAGS
 XFT_LIBS
 ALLOCA
@@ -1354,6 +1357,7 @@
   --without-xaw3d         don't use Xaw3d
   --without-xim           don't use X11 XIM
   --without-carbon        don't use Carbon GUI on Mac OS X
+  --without-dbus          don't use D-Bus
   --with-x                use the X Window System
 
 Some influential environment variables:
@@ -2004,6 +2008,12 @@
 fi
 
 
+# Check whether --with-dbus was given.
+if test "${with_dbus+set}" = set; then
+  withval=$with_dbus;
+fi
+
+
 # Check whether --enable-carbon-app was given.
 if test "${enable_carbon_app+set}" = set; then
   enableval=$enable_carbon_app;  carbon_appdir_x=${enableval}
@@ -11993,6 +12003,88 @@
   fi
 fi
 
+HAVE_DBUS=no
+if test "${with_dbus}" = "yes"; then
+   { echo "$as_me:$LINENO: checking for dbus_bus_get in -ldbus-1" >&5
+echo $ECHO_N "checking for dbus_bus_get in -ldbus-1... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dbus_1_dbus_bus_get+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbus-1  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dbus_bus_get ();
+int
+main ()
+{
+return dbus_bus_get ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dbus_1_dbus_bus_get=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dbus_1_dbus_bus_get=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dbus_1_dbus_bus_get" >&5
+echo "${ECHO_T}$ac_cv_lib_dbus_1_dbus_bus_get" >&6; }
+if test $ac_cv_lib_dbus_1_dbus_bus_get = yes; then
+  HAVE_DBUS=yes
+fi
+
+   if test "$HAVE_DBUS" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DBUS 1
+_ACEOF
+
+      DBUS_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
+
+      DBUS_LIBS="-ldbus-1"
+
+      DBUS_INFO="dbus"
+   fi
+fi
+
+
 ### Link with -lXft if available to work around a bug.
 HAVE_XFT=maybe
 if test "${HAVE_GTK}" = "yes"; then
@@ -18471,11 +18563,13 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
   ;
   return 0;
 }
@@ -18515,11 +18609,13 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #define _LARGEFILE_SOURCE 1
-#include <stdio.h>
-int
-main ()
-{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
   ;
   return 0;
 }
@@ -23819,6 +23915,11 @@
    echo
 fi
 
+if test "$HAVE_DBUS" = yes && test "${opsys}" != "gnu-linux"; then
+  echo "D-Bus integration has been tested for GNU/Linux only."
+  echo
+fi
+
 
 # Remove any trailing slashes in these variables.
 test "${prefix}" != NONE &&
@@ -24565,6 +24666,9 @@
 RSVG_LIBS!$RSVG_LIBS$ac_delim
 GTK_CFLAGS!$GTK_CFLAGS$ac_delim
 GTK_LIBS!$GTK_LIBS$ac_delim
+DBUS_CFLAGS!$DBUS_CFLAGS$ac_delim
+DBUS_LIBS!$DBUS_LIBS$ac_delim
+DBUS_INFO!$DBUS_INFO$ac_delim
 XFT_CFLAGS!$XFT_CFLAGS$ac_delim
 XFT_LIBS!$XFT_LIBS$ac_delim
 ALLOCA!$ALLOCA$ac_delim
@@ -24583,9 +24687,6 @@
 locallisppath!$locallisppath$ac_delim
 lisppath!$lisppath$ac_delim
 x_default_search_path!$x_default_search_path$ac_delim
-etcdir!$etcdir$ac_delim
-archlibdir!$archlibdir$ac_delim
-bitmapdir!$bitmapdir$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -24627,6 +24728,9 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+etcdir!$etcdir$ac_delim
+archlibdir!$archlibdir$ac_delim
+bitmapdir!$bitmapdir$ac_delim
 gamedir!$gamedir$ac_delim
 gameuser!$gameuser$ac_delim
 c_switch_system!$c_switch_system$ac_delim
@@ -24641,7 +24745,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 12; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
--- a/configure.in	Sun Dec 02 11:19:38 2007 +0000
+++ b/configure.in	Sun Dec 02 15:46:00 2007 +0000
@@ -118,6 +118,7 @@
 EMACS_ARG_N([xaw3d],[don't use Xaw3d])
 EMACS_ARG_N([xim],[don't use X11 XIM])
 EMACS_ARG_N([carbon],[don't use Carbon GUI on Mac OS X])
+EMACS_ARG_N([dbus],[don't use D-Bus])
 
 AC_ARG_ENABLE(carbon-app,
 [AS_HELP_STRING([--enable-carbon-app@<:@=DIR@:>@],
@@ -1199,7 +1200,7 @@
     machine=amdx86-64 opsys=gnu-linux
   ;;
 
-  ## Tensilica Xtensa Linux-based GNU system    
+  ## Tensilica Xtensa Linux-based GNU system
   xtensa-*-linux-gnu* )
     machine=xtensa opsys=gnu-linux
     ;;
@@ -1357,11 +1358,11 @@
 
 ## Need makeinfo >= 4.6 (?) to build the manuals.
 AC_PATH_PROG(MAKEINFO, makeinfo, no)
-dnl By this stage, configure has already checked for egrep and set EGREP, 
+dnl By this stage, configure has already checked for egrep and set EGREP,
 dnl or exited with an error if no egrep was found.
 if test "$MAKEINFO" != "no" && \
   test x"`$MAKEINFO --version 2> /dev/null | $EGREP 'texinfo[[^0-9]]*([[1-4]][[0-9]]+|[[5-9]]|4\.[[6-9]]|4\.[[1-5]][[0-9]]+)'`" = x; then
-   MAKEINFO=no    
+   MAKEINFO=no
 fi
 
 if test "$MAKEINFO" = "no"; then
@@ -1553,7 +1554,7 @@
 AC_SYS_LARGEFILE
 
 
-### The standard library on x86-64 GNU/Linux distributions can 
+### The standard library on x86-64 GNU/Linux distributions can
 ### be located in either /usr/lib64 or /usr/lib.
 case "${canonical}" in
   x86_64-*-linux-gnu* )
@@ -1904,7 +1905,7 @@
       no ) USE_X_TOOLKIT=none ;;
 dnl If user did not say whether to use a toolkit, make this decision later:
 dnl use the toolkit if we have gtk, or X11R5 or newer.
-      * ) 
+      * )
           if test x"$with_gtk" = xyes; then
              USE_X_TOOLKIT=none
           else
@@ -1923,7 +1924,7 @@
 if test "$window_system" = none && test "X$with_x" != "Xno"; then
    AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
    if test "$HAVE_XSERVER" = true ||
-      test -n "$DISPLAY" || 
+      test -n "$DISPLAY" ||
       test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
         AC_MSG_ERROR([You seem to be running X, but no X development libraries
 were found.  You should install the relevant development files for X
@@ -2258,6 +2259,25 @@
   fi
 fi
 
+dnl D-Bus has been tested under GNU/Linux only.  Must be adapted for
+dnl other platforms.  Support for higher D-Bus versions but 1.0 is
+dnl also not configured.
+HAVE_DBUS=no
+if test "${with_dbus}" = "yes"; then
+   AC_CHECK_LIB(dbus-1, dbus_bus_get, HAVE_DBUS=yes)
+   if test "$HAVE_DBUS" = yes; then
+      AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
+      DBUS_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
+      AC_SUBST(DBUS_CFLAGS)
+      DBUS_LIBS="-ldbus-1"
+      AC_SUBST(DBUS_LIBS)
+      DBUS_INFO="dbus"
+   fi
+fi
+dnl This must be substituted always, because the top level Makefile
+dnl cannot check for $HAVE_DBUS.
+AC_SUBST(DBUS_INFO)
+
 ### Link with -lXft if available to work around a bug.
 HAVE_XFT=maybe
 if test "${HAVE_GTK}" = "yes"; then
@@ -3475,7 +3495,12 @@
 known problems.  It is not recommended for use by non-developers.
 Read the emacs-devel archives for more information."
    echo
-fi 
+fi
+
+if test "$HAVE_DBUS" = yes && test "${opsys}" != "gnu-linux"; then
+  echo "D-Bus integration has been tested for GNU/Linux only."
+  echo
+fi
 
 
 # Remove any trailing slashes in these variables.