make D-BUS optional

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Michael Gehring 2008-05-30 21:20:23 +02:00 committed by Julien Danjou
parent b7a57f2a62
commit 2cb52ca2d1
3 changed files with 36 additions and 3 deletions

2
README
View File

@ -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)

View File

@ -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

27
dbus.c
View File

@ -18,6 +18,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include "config.h"
#ifdef HAVE_DBUS
#include <dbus/dbus.h>
@ -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