Skip to contentSkip to conversation

build: Allow systemd unit build without libsystemd

PATCH In review Achill Gilgenast 3 participants 5 messages Dec 8, 2025 – Jan 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Allow systemd unit build without libsystemd

Decouples libsystemd and systemd units from the same option and allows installation of services without systemd.pc by manually specifying the directories.

This is useful in Alpine Linux where we don't ship systemd, but allow systemd services to be subpackaged for downstream distributions like postmarketOS.
---
I'm by far no expert in autotools or bluez and how specific components are best categorized, so please let me know your feedback.

---
 Makefile.am    |  6 +++++-
 Makefile.mesh  |  4 +++-
 Makefile.obexd |  2 +-
 Makefile.tools |  4 ++--
 configure.ac   | 21 +++++++++++++++------
 5 files changed, 26 insertions(+), 11 deletions(-)
Makefile.am +5 -1
index e152ae64853c..d3cdb2890d32 100644
@@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf
 state_DATA =
 endif
 
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS
 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
 systemdsystemunit_DATA = src/bluetooth.service
+endif
 
+if SYSTEMD_USERUNITS
 systemduserunitdir = $(SYSTEMD_USERUNITDIR)
 systemduserunit_DATA =
+endif
 
+if SYSTEMD_UNITS
 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
 dbussystembus_DATA = src/org.bluez.service
 endif
Makefile.mesh +3 -1
index e4c9fa6a32e6..e9998a9cdd75 100644
@@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf
 conf_DATA += mesh/mesh-main.conf
 endif
 
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS
 systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+endif
+if SYSTEMD_UNITS
 dbussystembus_DATA += mesh/org.bluez.mesh.service
 endif
 
Makefile.obexd +1 -1
index 7ad74e1286b6..25aa8feb73d1 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 if OBEX
 
-if SYSTEMD
+if SYSTEMD_USERUNITS
 systemduserunit_DATA += obexd/src/obex.service
 
 obexd-add-service-symlink:
Makefile.tools +2 -2
index 561b03d0b95b..72dffe7cd005 100644
@@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger
 tools_btmon_logger_SOURCES = tools/btmon-logger.c
 tools_btmon_logger_LDADD = src/libshared-mainloop.la
 
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS
 systemdsystemunit_DATA += tools/bluetooth-logger.service
 endif
 endif
@@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c tools/missing.h
 
 tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
 tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS) $(DBUS_LIBS)
-if SYSTEMD
+if SYSTEMD_USERUNITS
 systemduserunit_DATA += tools/mpris-proxy.service
 endif
 
configure.ac +15 -6
index 16b81aca37e6..2d9352b59557 100644
@@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],
 			AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
 			[path to systemd system unit directory]),
 					[path_systemunitdir=${withval}])
-if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}"); then
 	AC_MSG_CHECKING([systemd system unit dir])
-	path_systemunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
 	if (test -z "${path_systemunitdir}"); then
-		AC_MSG_ERROR([systemd system unit directory is required])
+		path_systemunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
+		if (test -z "${path_systemunitdir}"); then
+			AC_MSG_ERROR([systemd system unit directory is required])
+		fi
 	fi
 	AC_MSG_RESULT([${path_systemunitdir}])
 fi
 AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}])
+AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" != "")
 
 AC_ARG_WITH([systemduserunitdir],
 			AS_HELP_STRING([--with-systemduserunitdir=DIR],
 			[path to systemd user unit directory]),
 					[path_userunitdir=${withval}])
-if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}"); then
 	AC_MSG_CHECKING([systemd user unit dir])
-	path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir systemd`"
 	if (test -z "${path_userunitdir}"); then
-		AC_MSG_ERROR([systemd user unit directory is required])
+		path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir systemd`"
+		if (test -z "${path_userunitdir}"); then
+			AC_MSG_ERROR([systemd user unit directory is required])
+		fi
 	fi
 	AC_MSG_RESULT([${path_userunitdir}])
 fi
 AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])
+AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")
+
+AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" != "" || test "${path_userunitdir}" != ""))
+
 
 AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles],
 			[do not install configuration and data files]),
Signature · 1 line
2.52.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1031211

---Test result---

Test Summary:

CheckPatch                    PENDING   0.29 seconds
GitLint                       PENDING   0.34 seconds
BuildEll                      PASS      20.27 seconds
BluezMake                     PASS      629.09 seconds
MakeCheck                     PASS      21.85 seconds
MakeDistcheck                 PASS      243.05 seconds
CheckValgrind                 PASS      305.13 seconds
CheckSmatch                   PASS      365.47 seconds
bluezmakeextell               PASS      185.64 seconds
IncrementalBuild              PENDING   0.36 seconds
ScanBuild                     PASS      1063.33 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Achill Gilgenast
Quoted 9 lines · Achill Gilgenast

Decouples libsystemd and systemd units from the same option and allows
installation of services without systemd.pc by manually specifying the
directories.

This is useful in Alpine Linux where we don't ship systemd, but allow systemd services to be subpackaged for downstream distributions like postmarketOS.

For what it's worth, this was already implemented in the meson port:
https://github.com/hadess/bluez/commit/b8d12fa7eb9a5b7071eb130344a0816c46c87db8

Quoted 156 lines

---
I'm by far no expert in autotools or bluez and how specific components
are best categorized, so please let me know your feedback.
---
 Makefile.am    |  6 +++++-
 Makefile.mesh  |  4 +++-
 Makefile.obexd |  2 +-
 Makefile.tools |  4 ++--
 configure.ac   | 21 +++++++++++++++------

 5 files changed, 26 insertions(+), 11 deletions(-)
Makefile.am +0 -0
index e152ae64853c..d3cdb2890d32 100644
@@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf

 state_DATA =
 endif

Makefile.am +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
 systemdsystemunit_DATA = src/bluetooth.service
+endif

+if SYSTEMD_USERUNITS
 systemduserunitdir = $(SYSTEMD_USERUNITDIR)
 systemduserunit_DATA =
+endif

+if SYSTEMD_UNITS
 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
 dbussystembus_DATA = src/org.bluez.service
 endif

Makefile.mesh +0 -0
index e4c9fa6a32e6..e9998a9cdd75 100644
@@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf

 conf_DATA += mesh/mesh-main.conf
 endif

Makefile.mesh +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunit_DATA += mesh/bluetooth-mesh.service

Makefile.mesh +2 -0
+endif
+if SYSTEMD_UNITS

 dbussystembus_DATA += mesh/org.bluez.mesh.service endif

Makefile.obexd +0 -0
index 7ad74e1286b6..25aa8feb73d1 100644
@@ -1,7 +1,7 @@
  # SPDX-License-Identifier: GPL-2.0

 if OBEX

Makefile.obexd +1 -1
-if SYSTEMD
+if SYSTEMD_USERUNITS

 systemduserunit_DATA += obexd/src/obex.service

 obexd-add-service-symlink:

Makefile.tools +0 -0
index 561b03d0b95b..72dffe7cd005 100644
@@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger

 tools_btmon_logger_SOURCES = tools/btmon-logger.c tools_btmon_logger_LDADD = src/libshared-mainloop.la

Makefile.tools +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunit_DATA += tools/bluetooth-logger.service endif
 endif

Makefile.tools +0 -0
@@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c

tools/missing.h

 tools_mpris_proxy_SOURCES = tools/mpris-proxy.c tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS) $(DBUS_LIBS)

Makefile.tools +1 -1
-if SYSTEMD
+if SYSTEMD_USERUNITS

 systemduserunit_DATA += tools/mpris-proxy.service endif

configure.ac +0 -0
index 16b81aca37e6..2d9352b59557 100644
@@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],

  AS_HELP_STRING([--with- systemdsystemunitdir=DIR],
  [path to systemd system unit directory]), [path_systemunitdir=${withva l}])
-if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}"); then
  AC_MSG_CHECKING([systemd system unit dir])

configure.ac +0 -1
-	path_systemunitdir="`$PKG_CONFIG --

variable=systemdsystemunitdir systemd`"
  if (test -z "${path_systemunitdir}"); then

configure.ac +0 -1
-		AC_MSG_ERROR([systemd system unit directory is

required])

configure.ac +1 -0
+		path_systemunitdir="`$PKG_CONFIG --

variable=systemdsystemunitdir systemd`"

configure.ac +2 -0
+		if (test -z "${path_systemunitdir}"); then
+			AC_MSG_ERROR([systemd system unit directory

is required])

configure.ac +1 -0
+		fi

  fi
  AC_MSG_RESULT([${path_systemunitdir}])
 fi
 AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}]) +AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" != "")

 AC_ARG_WITH([systemduserunitdir], AS_HELP_STRING([--with- systemduserunitdir=DIR],
  [path to systemd user unit directory]), [path_userunitdir=${withval} ])
-if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}"); then
  AC_MSG_CHECKING([systemd user unit dir])

configure.ac +0 -1
-	path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir

systemd`"
  if (test -z "${path_userunitdir}"); then

configure.ac +0 -1
-		AC_MSG_ERROR([systemd user unit directory is

required])

configure.ac +1 -0
+		path_userunitdir="`$PKG_CONFIG --

variable=systemduserunitdir systemd`"

configure.ac +2 -0
+		if (test -z "${path_userunitdir}"); then
+			AC_MSG_ERROR([systemd user unit directory is

required])

configure.ac +1 -0
+		fi

  fi AC_MSG_RESULT([${path_userunitdir}]) fi
 AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])

configure.ac +3 -0
+AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")
+
+AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" != "" ||

test "${path_userunitdir}" != ""))
+

 AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles], [do not install configuration and data files]),

#3 lore raw
Quoted 7 lines · Bastien Nocera
Quoted 6 lines · Achill Gilgenast

Decouples libsystemd and systemd units from the same option and allows
installation of services without systemd.pc by manually specifying the
directories.

Quoted 6 lines
Quoted 3 lines

This is useful in Alpine Linux where we don't ship systemd, but allow systemd services to be subpackaged for downstream distributions like postmarketOS.

For what it's worth, this was already implemented in the meson port:
https://github.com/hadess/bluez/commit/b8d12fa7eb9a5b7071eb130344a0816c46c87db8

Oh cool, I had no idea that a meson port existed. Do you know when this will hit master?

Quoted 157 lines
Quoted 157 lines

---
I'm by far no expert in autotools or bluez and how specific components
are best categorized, so please let me know your feedback.
---
 Makefile.am    |  6 +++++-
 Makefile.mesh  |  4 +++-
 Makefile.obexd |  2 +-
 Makefile.tools |  4 ++--
 configure.ac   | 21 +++++++++++++++------

 5 files changed, 26 insertions(+), 11 deletions(-)
Makefile.am +0 -0
index e152ae64853c..d3cdb2890d32 100644
@@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf

 state_DATA =
 endif

Makefile.am +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
 systemdsystemunit_DATA = src/bluetooth.service
+endif

+if SYSTEMD_USERUNITS
 systemduserunitdir = $(SYSTEMD_USERUNITDIR)
 systemduserunit_DATA =
+endif

+if SYSTEMD_UNITS
 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
 dbussystembus_DATA = src/org.bluez.service
 endif

Makefile.mesh +0 -0
index e4c9fa6a32e6..e9998a9cdd75 100644
@@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf

 conf_DATA += mesh/mesh-main.conf
 endif

Makefile.mesh +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunit_DATA += mesh/bluetooth-mesh.service

Makefile.mesh +2 -0
+endif
+if SYSTEMD_UNITS

 dbussystembus_DATA += mesh/org.bluez.mesh.service endif

Makefile.obexd +0 -0
index 7ad74e1286b6..25aa8feb73d1 100644
@@ -1,7 +1,7 @@
  # SPDX-License-Identifier: GPL-2.0

 if OBEX

Makefile.obexd +1 -1
-if SYSTEMD
+if SYSTEMD_USERUNITS

 systemduserunit_DATA += obexd/src/obex.service

 obexd-add-service-symlink:

Makefile.tools +0 -0
index 561b03d0b95b..72dffe7cd005 100644
@@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger

 tools_btmon_logger_SOURCES = tools/btmon-logger.c tools_btmon_logger_LDADD = src/libshared-mainloop.la

Makefile.tools +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunit_DATA += tools/bluetooth-logger.service endif
 endif

Makefile.tools +0 -0
@@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c

tools/missing.h

 tools_mpris_proxy_SOURCES = tools/mpris-proxy.c tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS) $(DBUS_LIBS)

Makefile.tools +1 -1
-if SYSTEMD
+if SYSTEMD_USERUNITS

 systemduserunit_DATA += tools/mpris-proxy.service endif

configure.ac +0 -0
index 16b81aca37e6..2d9352b59557 100644
@@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],

  AS_HELP_STRING([--with- systemdsystemunitdir=DIR],
  [path to systemd system unit directory]), [path_systemunitdir=${withva l}])
-if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}"); then
  AC_MSG_CHECKING([systemd system unit dir])

configure.ac +0 -1
-	path_systemunitdir="`$PKG_CONFIG --

variable=systemdsystemunitdir systemd`"
  if (test -z "${path_systemunitdir}"); then

configure.ac +0 -1
-		AC_MSG_ERROR([systemd system unit directory is

required])

configure.ac +1 -0
+		path_systemunitdir="`$PKG_CONFIG --

variable=systemdsystemunitdir systemd`"

configure.ac +2 -0
+		if (test -z "${path_systemunitdir}"); then
+			AC_MSG_ERROR([systemd system unit directory

is required])

configure.ac +1 -0
+		fi

  fi
  AC_MSG_RESULT([${path_systemunitdir}])
 fi
 AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}]) +AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" != "")

 AC_ARG_WITH([systemduserunitdir], AS_HELP_STRING([--with- systemduserunitdir=DIR],
  [path to systemd user unit directory]), [path_userunitdir=${withval} ])
-if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}"); then
  AC_MSG_CHECKING([systemd user unit dir])

configure.ac +0 -1
-	path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir

systemd`"
  if (test -z "${path_userunitdir}"); then

configure.ac +0 -1
-		AC_MSG_ERROR([systemd user unit directory is

required])

configure.ac +1 -0
+		path_userunitdir="`$PKG_CONFIG --

variable=systemduserunitdir systemd`"

configure.ac +2 -0
+		if (test -z "${path_userunitdir}"); then
+			AC_MSG_ERROR([systemd user unit directory is

required])

configure.ac +1 -0
+		fi

  fi AC_MSG_RESULT([${path_userunitdir}]) fi
 AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])

configure.ac +3 -0
+AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")
+
+AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" != "" ||

test "${path_userunitdir}" != ""))
+

 AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles], [do not install configuration and data files]),

#4 lore raw
Quoted 15 lines · Achill Gilgenast
Quoted 14 lines · Bastien Nocera
Quoted 12 lines · Achill Gilgenast

Decouples libsystemd and systemd units from the same option and allows
installation of services without systemd.pc by manually specifying
the
directories.

This is useful in Alpine Linux where we don't ship systemd, but allow
systemd services to be subpackaged for downstream distributions like
postmarketOS.

Quoted 7 lines
Quoted 3 lines

For what it's worth, this was already implemented in the meson port:
https://github.com/hadess/bluez/commit/b8d12fa7eb9a5b7071eb130344a0816c46c87db8

Oh cool, I had no idea that a meson port existed. Do you know when this
will hit master?

Hey,

Sorry I missed your original reply. It's unfortunately not my decision whether and when the meson port lands, we just keep making it a little bit better each day, whether it's to allow writing Rust plugins, or speeding up the test suite.

Cheers

Quoted 170 lines
Quoted 170 lines
Quoted 170 lines

---
I'm by far no expert in autotools or bluez and how specific components
are best categorized, so please let me know your feedback.
---
 Makefile.am    |  6 +++++-
 Makefile.mesh  |  4 +++-
 Makefile.obexd |  2 +-
 Makefile.tools |  4 ++--
 configure.ac   | 21 +++++++++++++++------

 5 files changed, 26 insertions(+), 11 deletions(-)
Makefile.am +0 -0
index e152ae64853c..d3cdb2890d32 100644
@@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf

 state_DATA =
 endif

Makefile.am +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
 systemdsystemunit_DATA = src/bluetooth.service
+endif

+if SYSTEMD_USERUNITS
 systemduserunitdir = $(SYSTEMD_USERUNITDIR)
 systemduserunit_DATA =
+endif

+if SYSTEMD_UNITS
 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
 dbussystembus_DATA = src/org.bluez.service
 endif

Makefile.mesh +0 -0
index e4c9fa6a32e6..e9998a9cdd75 100644
@@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf

 conf_DATA += mesh/mesh-main.conf
 endif

Makefile.mesh +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunit_DATA += mesh/bluetooth-mesh.service

Makefile.mesh +2 -0
+endif
+if SYSTEMD_UNITS

 dbussystembus_DATA += mesh/org.bluez.mesh.service endif

Makefile.obexd +0 -0
index 7ad74e1286b6..25aa8feb73d1 100644
@@ -1,7 +1,7 @@
  # SPDX-License-Identifier: GPL-2.0

 if OBEX

Makefile.obexd +1 -1
-if SYSTEMD
+if SYSTEMD_USERUNITS

 systemduserunit_DATA += obexd/src/obex.service

 obexd-add-service-symlink:

Makefile.tools +0 -0
index 561b03d0b95b..72dffe7cd005 100644
@@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger

 tools_btmon_logger_SOURCES = tools/btmon-logger.c tools_btmon_logger_LDADD = src/libshared-mainloop.la

Makefile.tools +1 -1
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS

 systemdsystemunit_DATA += tools/bluetooth-logger.service endif
 endif

Makefile.tools +0 -0
@@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c

tools/missing.h

 tools_mpris_proxy_SOURCES = tools/mpris-proxy.c tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS)
$(DBUS_LIBS)

Makefile.tools +1 -1
-if SYSTEMD
+if SYSTEMD_USERUNITS

 systemduserunit_DATA += tools/mpris-proxy.service endif

configure.ac +0 -0
index 16b81aca37e6..2d9352b59557 100644
@@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],

  AS_HELP_STRING([--with- systemdsystemunitdir=DIR],
  [path to systemd system unit directory]),
  [path_systemunitdir=${wi thva
l}])
-if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}");
then
  AC_MSG_CHECKING([systemd system unit dir])

configure.ac +0 -1
-	path_systemunitdir="`$PKG_CONFIG --

variable=systemdsystemunitdir systemd`"
  if (test -z "${path_systemunitdir}"); then

configure.ac +0 -1
-		AC_MSG_ERROR([systemd system unit directory is

required])

configure.ac +1 -0
+		path_systemunitdir="`$PKG_CONFIG --

variable=systemdsystemunitdir systemd`"

configure.ac +2 -0
+		if (test -z "${path_systemunitdir}"); then
+			AC_MSG_ERROR([systemd system unit

directory
is required])

configure.ac +1 -0
+		fi

  fi
  AC_MSG_RESULT([${path_systemunitdir}])
 fi
 AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}]) +AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" !=
"")

 AC_ARG_WITH([systemduserunitdir], AS_HELP_STRING([--with- systemduserunitdir=DIR],
  [path to systemd user unit directory]), [path_userunitdir=${with val}
])
-if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}");
then
  AC_MSG_CHECKING([systemd user unit dir])

configure.ac +0 -1
-	path_userunitdir="`$PKG_CONFIG --

variable=systemduserunitdir
systemd`"
  if (test -z "${path_userunitdir}"); then

configure.ac +0 -1
-		AC_MSG_ERROR([systemd user unit directory is

required])

configure.ac +1 -0
+		path_userunitdir="`$PKG_CONFIG --

variable=systemduserunitdir systemd`"

configure.ac +2 -0
+		if (test -z "${path_userunitdir}"); then
+			AC_MSG_ERROR([systemd user unit

directory is
required])

configure.ac +1 -0
+		fi

  fi
  AC_MSG_RESULT([${path_userunitdir}])
 fi
 AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}]) +AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")

configure.ac +2 -0
+
+AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" !=

"" ||
test "${path_userunitdir}" != ""))
+

 AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles], [do not install configuration and data files]),