From 24435a9d560b38f0f70ab35a695d4bf8910905e6 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Mon, 1 Jul 2013 20:51:36 +0800 Subject: [PATCH 1/2] Build: fix build option for x11 autolaunch support First, "--disable-x11-autolaunch" in fact can not disable x11-autolaunch in autotools build system. Second, there is no configrable option for x11 autolaunch in cmake. This patch fixes them both. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66453 Signed-off-by: Chengwei Yang --- cmake/CMakeLists.txt | 11 +++++++++-- cmake/config.h.cmake | 6 +----- configure.ac | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index aecc74c..40defee 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -334,10 +334,15 @@ endif(CMAKE_COMPILER_IS_GNUCC AND NOT DBUS_ENABLE_ANSI) set (DBUS_HAVE_ATOMIC_INT ${atomic_int} CACHE STRING "Some atomic integer implementation present") set (DBUS_USE_ATOMIC_INT_486 ${atomic_int_486} CACHE STRING "Use atomic integer implementation for 486") +option (DBUS_ENABLE_X11_AUTOLAUNCH "Build with X11 autolaunch support" ON) + if(X11_FOUND) - option (DBUS_BUILD_X11 "Build with X11 autolaunch support " ON) + option (DBUS_BUILD_X11 "Build with X11 support " ON) endif(X11_FOUND) +if (NOT DBUS_BUILD_X11 AND DBUS_ENABLE_X11_AUTOLAUNCH) + message(FATAL_ERROR "X11 auto-launch requires X headers/libraries") +endif (NOT DBUS_BUILD_X11 AND DBUS_ENABLE_X11_AUTOLAUNCH) # test binary names if (WIN32) # Automake calls this EXEEXT, and CMake doesn't have a standard name @@ -535,7 +540,9 @@ message(" Building w/o checks: ${DBUS_DISABLE_CHECKS} " message(" Building bus stats API: ${DBUS_ENABLE_STATS} ") message(" installing system libs: ${DBUS_INSTALL_SYSTEM_LIBS} ") message(" Building inotify support: ${DBUS_BUS_ENABLE_INOTIFY} ") -message(" Building kqueue support: ${DBUS_BUS_ENABLE_KQUEUE} ") +message(" Building kqueue support: ${DBUS_BUS_ENABLE_KQUEUE} ") +message(" Building X11 code: ${DBUS_BUILD_X11} ") +message(" Building X11 autolaunch: ${DBUS_ENABLE_X11_AUTOLAUNCH} ") message(" Building Doxygen docs: ${DBUS_ENABLE_DOXYGEN_DOCS} ") message(" Building XML docs: ${DBUS_ENABLE_XML_DOCS} ") message(" Daemon executable name: ${DBUS_DAEMON_NAME}") diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index a961d1a..7ccc0d3 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -80,11 +80,7 @@ #endif #cmakedefine DBUS_BUILD_X11 1 -/* For the moment, the cmake build system doesn't have an equivalent of - * the autoconf build system's --disable-x11-autolaunch */ -#ifdef DBUS_BUILD_X11 -# define DBUS_ENABLE_X11_AUTOLAUNCH 1 -#endif +#cmakedefine DBUS_ENABLE_X11_AUTOLAUNCH 1 #define DBUS_DEFAULT_MESSAGE_UNIX_FDS @DEFAULT_MESSAGE_UNIX_FDS@ diff --git a/configure.ac b/configure.ac index c80fcfc..badc804 100644 --- a/configure.ac +++ b/configure.ac @@ -1266,7 +1266,7 @@ DBUS_X_CFLAGS= AC_ARG_ENABLE([x11-autolaunch], AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]), - [], [enable_x11_autolaunch=auto]) + [enable_x11_autolaunch=$enableval], [enable_x11_autolaunch=auto]) if test "x$dbus_win" = xyes; then if test "x$enable_x11_autolaunch" = xyes; then @@ -1843,6 +1843,7 @@ echo " Building kqueue support: ${have_kqueue} Building systemd support: ${have_systemd} Building X11 code: ${have_x11} + Building X11 autolaunch: ${enable_x11_autolaunch} Building Doxygen docs: ${enable_doxygen_docs} Building XML docs: ${enable_xml_docs} Building cache support: ${enable_userdb_cache} -- 1.7.9.5