diff --git a/README b/README index 5af4d3537..941668555 100644 --- a/README +++ b/README @@ -11,7 +11,7 @@ In order to build awesome itself, you need header files and libs of: - pango and pangocairo - glib - GTK+ or Imlib2 (use --with-imlib2 with ./configure) - - dbus + - dbus (optional, use --with-dbus=no with ./configure to disable) In order to build the awesome man pages, you need these tools: - asciidoc (recent version) diff --git a/configure.ac b/configure.ac index fc706e590..085a588b5 100644 --- a/configure.ac +++ b/configure.ac @@ -125,8 +125,14 @@ PKG_CHECK_MODULES([glib], [glib-2.0],, [AC_MSG_ERROR([awesome requires glib-2.0.])]) PKG_CHECK_MODULES([gthread], [gthread-2.0],, [AC_MSG_ERROR([awesome requires gthread-2.0.])]) -PKG_CHECK_MODULES([dbus], [dbus-1],, - [AC_MSG_ERROR([awesome requires dbus-1.])]) + +AC_ARG_WITH([dbus], AS_HELP_STRING([--with-dbus], [Build with D-BUS (default: enabled)]), [], [with_dbus=yes]) +if test "x$with_dbus" == "xyes"; then + PKG_CHECK_MODULES([dbus], [dbus-1],, + [AC_MSG_ERROR([awesome requires dbus-1.])]) + AC_DEFINE([WITH_DBUS],1,[Defined to use D-BUS]) +fi + AC_ARG_WITH([imlib2], AS_HELP_STRING([--with-imlib2], [Build with Imlib2 (default: disabled)])) if test "x$with_imlib2" == "xyes"; then diff --git a/dbus.c b/dbus.c index 049e7e7eb..d91af9eb6 100644 --- a/dbus.c +++ b/dbus.c @@ -18,6 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ +#include "config.h" + +#ifdef HAVE_DBUS #include @@ -189,4 +192,28 @@ a_dbus_cleanup(void) dbus_connection = NULL; } +#else /* HAVE_DBUS */ + +#include "dbus.h" + +void +a_dbus_process_requests(int *fd __attribute__((unused))) +{ + /* empty */ +} + +bool +a_dbus_init(int *fd) +{ + *fd = -1; + return false; +} + +void +a_dbus_cleanup(void) +{ + /* empty */ +} + +#endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80