[PATCH 13/19] remove DBUS_DAEMON_EXECUTABLE_NAME, we already have DBUS_DAEMON_NAME, and use the specified name for the executable when building with cmake

Romain Pokrzywka romain at kdab.com
Wed Feb 3 12:27:47 PST 2010


---
 bus/Makefile.am          |    2 +-
 cmake/CMakeLists.txt     |    5 ++---
 cmake/bus/CMakeLists.txt |    1 +
 configure.in             |    2 ++
 dbus/dbus-sysdeps-win.c  |    6 +-----
 tools/dbus-launch-win.c  |   12 +++++-------
 6 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/bus/Makefile.am b/bus/Makefile.am
index 72233f1..c44fe6a 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -3,7 +3,7 @@ configdir=$(sysconfdir)/dbus-1
 
 INCLUDES=-I$(top_srcdir) $(DBUS_BUS_CFLAGS) @PIE_CFLAGS@		\
 	-DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\"	\
-	-DDAEMON_NAME=\"dbus-daemon\"  -DDBUS_COMPILATION
+	-DDBUS_COMPILATION
 
 EFENCE=
 
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index b667bd2..4d6db09 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -467,9 +467,7 @@ else (WIN32)
   set (DBUS_DATADIR ${EXPANDED_DATADIR})
 endif (WIN32)
 
-set (DAEMON_NAME dbus-daemon)
-add_definitions( -DDBUS_DAEMON_EXECUTABLE_NAME=\\"dbus-daemon\\" )
-
+set(DBUS_DAEMON_NAME dbus-daemon CACHE STRING "The name of the dbus daemon executable")
 
 ########### create config.h ###############
 
@@ -557,6 +555,7 @@ message("        Building Doxygen docs:    ${DBUS_ENABLE_DOXYGEN_DOCS}         "
 #message("        Building XML docs:        ${enable_xml_docs}                  ")
 #message("        Gettext libs (empty OK):  ${INTLLIBS}                         ")
 message("        Using XML parser:         ${XML_LIB}                          ")
+message("        Daemon executable name:   ${DBUS_DAEMON_NAME}")
 if (WIN32)
 message("        System bus address:       ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}  ")
 message("        Session bus address:      ${DBUS_SESSION_BUS_DEFAULT_ADDRESS} ")
diff --git a/cmake/bus/CMakeLists.txt b/cmake/bus/CMakeLists.txt
index 0473eb2..f7f29db 100644
--- a/cmake/bus/CMakeLists.txt
+++ b/cmake/bus/CMakeLists.txt
@@ -81,6 +81,7 @@ set(DBUS_LIBRARIES dbus-1 dbus-internal)
 
 add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
 target_link_libraries(dbus-daemon ${DBUS_LIBRARIES} ${XML_LIBRARY})
+set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
 
 install_targets(/bin dbus-daemon)
 install_files(/etc FILES ${config_DATA})
diff --git a/configure.in b/configure.in
index bda6716..c037ec3 100644
--- a/configure.in
+++ b/configure.in
@@ -25,6 +25,8 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext d
  ## must come before we use the $USE_MAINTAINER_MODE variable later
 AM_MAINTAINER_MODE
 
+AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
+
 # libtool versioning - this applies to libdbus
 #
 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index f45d809..07df7dd 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -2944,11 +2944,7 @@ _dbus_get_autolaunch_address (DBusString *address,
   LPSTR lpFile;
   char dbus_exe_path[MAX_PATH];
   char dbus_args[MAX_PATH * 2];
-#ifdef _DEBUG
-  const char * daemon_name = "dbus-daemond.exe";
-#else
-  const char * daemon_name = "dbus-daemon.exe";
-#endif
+  const char * daemon_name = DBUS_DAEMON_NAME ".exe";
 
   mutex = _dbus_global_lock ( cDBusAutolaunchMutex );
 
diff --git a/tools/dbus-launch-win.c b/tools/dbus-launch-win.c
index 352a28d..140238e 100644
--- a/tools/dbus-launch-win.c
+++ b/tools/dbus-launch-win.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
+#include <config.h>
 #include <windows.h>
 #include <stdio.h>
 #include <string.h>
@@ -90,12 +91,9 @@ int main(int argc,char **argv)
       showConsole = 1; 
 #endif
   GetModuleFileName(NULL,dbusDaemonPath,sizeof(dbusDaemonPath));
-
-#ifdef _DEBUG
-      daemon_name = "dbus-daemond.exe";
-#else
-      daemon_name = "dbus-daemon.exe";
-#endif
+  
+  daemon_name = DBUS_DAEMON_NAME ".exe";
+  
   if ((p = _mbsrchr (dbusDaemonPath, '\\'))) 
     {
       *(p+1)= '\0';
@@ -134,7 +132,7 @@ int main(int argc,char **argv)
   if (result == 0) 
     {
       if (verbose)
-          fprintf(stderr, "Could not start dbus-daemon error=%d",GetLastError());
+          fprintf(stderr, "Could not start " DBUS_DAEMON_NAME ". error=%d",GetLastError());
       return 4;
     }
    
-- 
1.6.4.msysgit.0


--------------010102030105080700010509--


More information about the dbus mailing list