CMAKE_BUILD_TYPE set dbus build mode - one of Debug|Release|RelWithDebInfo|MinSizeRel
DBUS_BUILD_TESTS enable unit test code default=ON
- DBUS_BUILD_X11 Build X11-dependent code default=ON
+ DBUS_BUILD_X11 Build with X11 autolaunch support default=ON
HAVE_CONSOLE_OWNER_FILE enable console owner file (solaris only) ) default=ON
DBUS_DISABLE_ASSERTS Disable assertion checking default=OFF
DBUS_DISABLE_CHECKS Disable public API sanity checking default=OFF
AC_SUBST(DBUS_TEST_LIBS)
### X11 detection
-if test x$dbus_win = xyes ; then
- enable_x11=no
-else
-AC_PATH_XTRA
+DBUS_X_LIBS=
+DBUS_X_CFLAGS=
+
+AC_ARG_ENABLE([x11-autolaunch],
+ AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
+ [], [enable_x11_autolaunch=auto])
+
+if test "x$dbus_win" = xyes; then
+ if test "x$enable_x11_autolaunch" = xyes; then
+ AC_MSG_ERROR([X11 auto-launch is not supported on Windows])
+ fi
-## for now enable_x11 just tracks have_x11,
-## there's no --enable-x11
-if test x$no_x = xyes ; then
- have_x11=no
- enable_x11=no
+ enable_x11_autolaunch=no
+fi
+
+if test "x$enable_x11_autolaunch" = xno; then
+ have_x11=no
else
- have_x11=yes
- enable_x11=yes
+ AC_PATH_XTRA
+
+ if test "x$no_x" = xyes; then
+ have_x11=no
+ else
+ have_x11=yes
+ DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+ DBUS_X_CFLAGS="$X_CFLAGS"
+ fi
fi
-if test x$enable_x11 = xyes ; then
- AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
- DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
- DBUS_X_CFLAGS="$X_CFLAGS"
+if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
+ AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
else
- DBUS_X_LIBS=
- DBUS_X_CFLAGS=
+ # move from "auto" to "yes" or "no" if necessary
+ enable_x11_autolaunch="$have_x11"
fi
-AC_SUBST(DBUS_X_CFLAGS)
-AC_SUBST(DBUS_X_LIBS)
+if test "x$enable_x11_autolaunch" = xyes ; then
+ AC_DEFINE([DBUS_BUILD_X11], [1], [Define to enable X11 auto-launch])
fi
+AC_SUBST([DBUS_X_CFLAGS])
+AC_SUBST([DBUS_X_LIBS])
#### gcc warning flags
DBusString *address,
DBusError *error)
{
+#ifdef DBUS_BUILD_X11
+ /* Perform X11-based autolaunch. (We also support launchd-based autolaunch,
+ * but that's done elsewhere, and if it worked, this function wouldn't
+ * be called.) */
+ const char *display;
static char *argv[6];
int i;
DBusString uuid;
if (display == NULL || display[0] == '\0')
{
dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
- "Unable to autolaunch a dbus-daemon without DISPLAY set");
+ "Unable to autolaunch a dbus-daemon without a $DISPLAY for X11");
return FALSE;
}
out:
_dbus_string_free (&uuid);
return retval;
+#else
+ dbus_set_error_const (error, DBUS_ERROR_NOT_SUPPORTED,
+ "Using X11 for dbus-daemon autolaunch was disabled at compile time, "
+ "set your DBUS_SESSION_BUS_ADDRESS instead");
+ return FALSE;
+#endif
}
/**