Skip to content

Commit

Permalink
configure.ac: refine D-Bus install directories
Browse files Browse the repository at this point in the history
For the D-Bus system service directory, we can rely on pkg-config
to query the target directory, instead of constructing our own
assumption.

For D-Bus policy directory, there is no such pkg-config variable.
However, D-Bus' $datadir might be different from ours, so use
D-Bus' ones.

To use pkg-config to obtain these values, we need libdbus-1-dev
package installed, so add this new requirement to documentation
and CI build script.

We also need to tell the build system that these directories
should be treated relative when doing 'make distcheck'.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
  • Loading branch information
mhei authored and jluebbe committed Oct 22, 2019
1 parent 59bcced commit 7698cad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -80,7 +80,7 @@ jobs:
before_script:
- docker exec -it cross uname -a
- docker exec -it cross apt-get update
- docker exec -it cross apt-get install -y build-essential automake libtool libglib2.0-dev libcurl3-dev libssl-dev libjson-glib-dev
- docker exec -it cross apt-get install -y build-essential automake libtool libglib2.0-dev libcurl3-dev libssl-dev libjson-glib-dev libdbus-1-dev
script:
- docker exec -it cross ./autogen.sh
- docker exec -it cross ./configure
Expand Down
5 changes: 4 additions & 1 deletion Makefile.am
Expand Up @@ -235,7 +235,10 @@ EXTRA_DIST += docs/extensions
EXTRA_DIST += docs/release-checklist.txt
EXTRA_DIST += $(wildcard docs/*.rst)

AM_DISTCHECK_CONFIGURE_FLAGS = "--without-systemdunitdir"
AM_DISTCHECK_CONFIGURE_FLAGS = \
--without-systemdunitdir \
--with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
--with-dbussystemservicedir=$$dc_install_base/$(dbussystemdir)

CLEANFILES = $(gdbus_installer_generated) \
$(nodist_systemdunit_DATA) \
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Expand Up @@ -121,13 +121,14 @@ Host (Build) Prerequisites

- automake
- libtool
- libdbus-1-dev
- libglib2.0-dev
- libcurl3-dev
- libssl-dev

::

sudo apt-get install automake libtool libglib2.0-dev libcurl3-dev libssl-dev
sudo apt-get install automake libtool libdbus-1-dev libglib2.0-dev libcurl3-dev libssl-dev

If you intend to use json-support you also need

Expand Down
5 changes: 3 additions & 2 deletions configure.ac
Expand Up @@ -50,6 +50,7 @@ AS_IF([test "x$enable_service" != "xno"], [

# Checks for libraries.
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.45.8 gio-2.0 gio-unix-2.0])
PKG_CHECK_MODULES([DBUS1], [dbus-1])

AC_ARG_ENABLE([network],
AS_HELP_STRING([--disable-network], [Disable network update mode])
Expand Down Expand Up @@ -89,14 +90,14 @@ AM_CONDITIONAL(SYSTEMD, test -n "${with_systemdunitdir}")
AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
[with_dbuspolicydir=${datadir}/dbus-1/system.d])
[with_dbuspolicydir="$($PKG_CONFIG --variable=datadir dbus-1)/dbus-1/system.d"])
DBUS_POLICYDIR="${with_dbuspolicydir}"
AC_SUBST(DBUS_POLICYDIR)

AC_ARG_WITH([dbussystemservicedir],
AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
[],
[with_dbussystemservicedir=${datadir}/dbus-1/system-services])
[with_dbussystemservicedir="$($PKG_CONFIG --variable=system_bus_services_dir dbus-1)"])
DBUS_SYSTEMSERVICEDIR="${with_dbussystemservicedir}"
AC_SUBST(DBUS_SYSTEMSERVICEDIR)

Expand Down

0 comments on commit 7698cad

Please sign in to comment.