Commit dab11e2e authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Zeeshan Ali

build: Option to disable the backend build

With xdg-app, we will want to bundle the client convenience library with
applications that require GeoClue, without having them ship all the
backend service files, which will be shipped in the core OS.

Introduce a --disable-backend build option that implements this policy.

https://bugs.freedesktop.org/show_bug.cgi?id=93889
parent 384e3e00
......@@ -7,7 +7,13 @@ else
LIBGEOCLUE_DIR =
endif
SUBDIRS = build-aux public-api src data $(LIBGEOCLUE_DIR) demo po docs
if BUILD_BACKEND
BACKEND_DIR = src
else
BACKEND_DIR =
endif
SUBDIRS = build-aux public-api $(BACKEND_DIR) data $(LIBGEOCLUE_DIR) demo po docs
INTLTOOL_FILES = \
intltool-extract.in \
......
......@@ -125,11 +125,6 @@ if test "x$build_modem_source" = "xyes"; then
fi
AM_CONDITIONAL([BUILD_MODEM_SOURCE], [test "x$build_modem_source" = "xyes"])
# Check for ModemManager if one of the sources requires it
if test "x$require_modemmanager" = "xyes"; then
PKG_CHECK_MODULES(ModemManager, mm-glib >= $LIBMM_GLIB_MIN_VERSION)
fi
# Network NMEA Source
AC_ARG_ENABLE(nmea-source,
AS_HELP_STRING([--disable-nmea-source],
......@@ -143,12 +138,28 @@ else
fi
AM_CONDITIONAL([BUILD_NMEA_SOURCE], [test "x$build_nmea_source" = "xyes"])
if test "x$build_nmea_source" = "xyes"; then
# Check for avahi-client and avahi-glib
PKG_CHECK_MODULES(NMEA_SOURCE, [
avahi-client >= $AVAHI_MIN_VERSION
avahi-glib >= $AVAHI_MIN_VERSION])
# Backend build
AC_ARG_ENABLE(backend,
AS_HELP_STRING([--disable-backend], [Disable backend]),
[build_backend=$enableval], [build_backend=yes])
if test "x$build_backend" = "xyes"; then
# Check for ModemManager if one of the sources requires it
if test "x$require_modemmanager" = "xyes"; then
PKG_CHECK_MODULES(ModemManager, mm-glib >= $LIBMM_GLIB_MIN_VERSION)
fi
if test "x$build_nmea_source" = "xyes"; then
# Check for avahi-client and avahi-glib
PKG_CHECK_MODULES(NMEA_SOURCE, [
avahi-client >= $AVAHI_MIN_VERSION
avahi-glib >= $AVAHI_MIN_VERSION])
fi
AC_DEFINE([BUILD_BACKEND], [1], [Build backend?])
else
AC_DEFINE([BUILD_BACKEND], [0], [Build backend?])
fi
AM_CONDITIONAL([BUILD_BACKEND], [test "x$build_backend" = "xyes"])
# Demo agent
AC_ARG_ENABLE(demo-agent,
......@@ -253,6 +264,7 @@ AC_MSG_NOTICE([
c compiler: ${CC} ${CFLAGS}
systemdsystemunitdir: ${systemdsystemunitdir}
Backend: ${build_backend}
Convenience library: ${build_libgeoclue}
Introspection: ${build_introspection}
3G source: ${build_3g_source}
......
systemconfdir = $(sysconfdir)/geoclue
service_in_files = org.freedesktop.GeoClue2.service.in
systemconf_in_files = geoclue.conf.in
systemdservice_in_files = geoclue.service.in
if BUILD_BACKEND
systemconfdir = $(sysconfdir)/geoclue
systemconf_DATA = $(systemconf_in_files:.conf.in=.conf)
if BUILD_DEMO_AGENT
......@@ -13,7 +17,6 @@ $(systemconf_DATA): $(systemconf_in_files) Makefile
endif
servicedir = $(datadir)/dbus-1/system-services
service_in_files = org.freedesktop.GeoClue2.service.in
service_DATA = $(service_in_files:.service.in=.service)
$(service_DATA): $(service_in_files) Makefile
......@@ -25,8 +28,6 @@ dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = org.freedesktop.GeoClue2.conf \
org.freedesktop.GeoClue2.Agent.conf
systemdservice_in_files = geoclue.service.in
if HAVE_SYSTEMD
systemdservicedir = $(systemdsystemunitdir)
systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
......@@ -35,6 +36,7 @@ $(systemdservice_DATA): $(systemdservice_in_files) Makefile
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< | \
sed -e "s|\@dbus_srv_user\@|$(dbus_srv_user)|" > $@
endif
endif
DISTCLEANFILES = $(service_DATA) \
$(systemconf_DATA) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment