commit 719498e7cfbceffa01eff37263c55ceaf1623379
Author: David Vossel <dvossel@redhat.com>
Date: Wed Feb 5 17:42:01 2014 -0600
Low: services: Keep dbus build support optional
(cherry picked from commit e4d030a6d278fb3a43aa9c7eb359b488673f504a)
diff --git a/configure.ac b/configure.ac
index f90ccdc..cad5190 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1162,6 +1162,8 @@ HAVE_upstart=0
HAVE_systemd=0
PKG_CHECK_MODULES(DBUS, dbus-1, ,HAVE_dbus=0)
+AM_CONDITIONAL(BUILD_DBUS, test $HAVE_dbus = 1)
+
if test $HAVE_dbus = 1; then
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1`"
fi
diff --git a/include/portability.h b/include/portability.h
index 4eb6eaa..b1302d2 100644
--- a/include/portability.h
+++ b/include/portability.h
@@ -177,7 +177,7 @@ g_list_free_full(GList * list, GDestroyNotify free_func)
}
# endif
-# ifndef HAVE_DBUSBASICVALUE
+# if defined(BUILD_DBUS) && !defined(HAVE_DBUSBASICVALUE)
# include <stdint.h>
# include <dbus/dbus.h>
/**
diff --git a/lib/services/Makefile.am b/lib/services/Makefile.am
index 6ed4d01..96ccdb0 100644
--- a/lib/services/Makefile.am
+++ b/lib/services/Makefile.am
@@ -23,11 +23,15 @@ INCLUDES = -I$(top_builddir)/include
lib_LTLIBRARIES = libcrmservice.la
noinst_HEADERS = upstart.h systemd.h services_private.h
-libcrmservice_la_SOURCES = services.c services_linux.c dbus.c
+libcrmservice_la_SOURCES = services.c services_linux.c
libcrmservice_la_LDFLAGS = -version-info 1:0:0
libcrmservice_la_CFLAGS = $(GIO_CFLAGS) -DOCF_ROOT_DIR=\"@OCF_ROOT_DIR@\"
libcrmservice_la_LIBADD = $(GIO_LIBS) $(top_builddir)/lib/common/libcrmcommon.la $(DBUS_LIBS)
+if BUILD_DBUS
+libcrmservice_la_SOURCES += dbus.c
+endif
+
if BUILD_UPSTART
libcrmservice_la_SOURCES += upstart.c
endif