* configure.in:
authorJohn (J5) Palmieri <johnp@redhat.com>
Tue, 8 Aug 2006 21:30:31 +0000 (21:30 +0000)
committerJohn (J5) Palmieri <johnp@redhat.com>
Tue, 8 Aug 2006 21:30:31 +0000 (21:30 +0000)
* tools/Makefile.am:
* tools/dbus-launch.c:
* bus/Makefile.am:
  allow --with-dbus-daemondir switch to be used to make the
  daemon install to a seperate bindir like /usr/libexec
  (patch from Brian Cameron <brian dot cameron at sun dot com)

ChangeLog
bus/Makefile.am
configure.in
tools/Makefile.am
tools/dbus-launch.c

index 87b0589..6e65692 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-08-08  John (J5) Palmieri  <johnp@redhat.com>
 
+       * configure.in:
+       * tools/Makefile.am:
+       * tools/dbus-launch.c:
+       * bus/Makefile.am:
+       allow --with-dbus-daemondir switch to be used to make the
+       daemon install to a seperate bindir like /usr/libexec
+       (patch from Brian Cameron <brian dot cameron at sun dot com)
+
+2006-08-08  John (J5) Palmieri  <johnp@redhat.com>
+
        * bus/Makefile.am (install-data-hook): removed the slash after 
        $(DESTDIR) so we don't get the double slash which does not work
        in windows (patch from Andras Porjesz 
index 9815bfd..89bb523 100644 (file)
@@ -16,8 +16,6 @@ config_DATA=                                  \
        session.conf                            \
        system.conf
 
-bin_PROGRAMS=dbus-daemon
-
 if DBUS_USE_LIBXML
 XML_SOURCES=config-loader-libxml.c
 endif
@@ -79,7 +77,7 @@ endif
 
 ## we use noinst_PROGRAMS not check_PROGRAMS so that we build 
 ## even when not doing "make check"
-noinst_PROGRAMS=$(TESTS) 
+noinst_PROGRAMS=$(TESTS) dbus-daemon
 
 bus_test_SOURCES=                              \
        $(BUS_SOURCES)                          \
@@ -91,7 +89,15 @@ bus_test_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_BUS_LIBS)
 clean-local:
        /bin/rm *.bb *.bbg *.da *.gcov || true
 
+uninstall-hook:
+       rm -f $(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon
+
 install-data-hook:
+       if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \
+               $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
+               chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
+       fi
+       $(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR)
        $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
        $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
        $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
index 65570d6..b0c2849 100644 (file)
@@ -68,6 +68,7 @@ AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNI
 AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
+AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
 
 
 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files 
@@ -965,6 +966,15 @@ fi
 AC_SUBST(DBUS_USER)
 AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
 
+#### Directory to install dbus-daemon
+if test -z "$with_dbus_daemondir" ; then
+    DBUS_DAEMONDIR="${bindir}"
+else
+    DBUS_DAEMONDIR=$with_dbus_daemondir
+fi
+AC_SUBST(DBUS_DAEMONDIR)
+AC_DEFINE_UNQUOTED(DBUS_DAEMONDIR,"$DBUS_DAEMONDIR", [Directory for installing the DBUS daemon])
+
 #### Tell tests where to find certain stuff in builddir
 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
 
index e653dea..06d85b4 100644 (file)
@@ -1,4 +1,4 @@
-INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_X_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DDBUS_COMPILATION
+INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_X_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DDBUS_COMPILATION -DDBUS_DAEMONDIR=\"@DBUS_DAEMONDIR@\"
 
 bin_PROGRAMS=dbus-send dbus-monitor dbus-launch dbus-cleanup-sockets
 
index 757e833..3004099 100644 (file)
@@ -771,6 +771,25 @@ main (int argc, char **argv)
 
       verbose ("Calling exec()\n");
       
+      execl (DBUS_DAEMONDIR"/dbus-daemon",
+             DBUS_DAEMONDIR"/dbus-daemon",
+             "--fork",
+             "--print-pid", write_pid_fd_as_string,
+             "--print-address", write_address_fd_as_string,
+             config_file ? "--config-file" : "--session",
+             config_file, /* has to be last in this varargs list */
+             NULL);
+
+      fprintf (stderr,
+               "Failed to execute message bus daemon %s: %s.  Will try again without full path.\n",
+               DBUS_DAEMONDIR"/dbus-daemon", strerror (errno));
+
+      /*
+       * If it failed, try running without full PATH.  Note this is needed
+       * because the build process builds the run-with-tmp-session-bus.conf
+       * file and the dbus-daemon will not be in the install location during
+       * build time.
+       */
       execlp ("dbus-daemon",
               "dbus-daemon",
               "--fork",