aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2021-03-04 14:23:39 +0100
committerSean Young <sean@mess.org>2021-04-09 13:08:07 +0100
commit3f61e353424fb9ea3dce742022b94dfd7ea1ed9f (patch)
tree6b7276637b89f4f14e19e90c3e1b24ed0f7b9572
parent5d8c459c1bf9c91779419c3f0c26a9caa30d9d27 (diff)
downloadv4l-utils-3f61e353424fb9ea3dce742022b94dfd7ea1ed9f.tar.gz
configure.ac: autodetect availability of systemd
Import systemd's official suggestion [1] how this should be handled in packages using autoconf. A side effect of this is the removal of the hardcoded fallback path "/lib/systemd/system" which leaks build host information when cross compiling v4l-utils and therefore defeats reproducible builds. [1] https://www.freedesktop.org/software/systemd/man/daemon.html#Installing%20systemd%20Service%20Files Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sean Young <sean@mess.org>
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 727730c5..8470116d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -388,7 +388,15 @@ AC_ARG_WITH(udevdir,
AC_ARG_WITH(systemdsystemunitdir,
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [set systemd system unit directory]),
[],
- [with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd || echo /lib/systemd/system`])
+ [with_systemdsystemunitdir=auto])
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"],
+ [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+ AS_IF([test "x$def_systemdsystemunitdir" = "x"],
+ [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+ [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
+ with_systemdsystemunitdir=no],
+ [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
# Generic check: works with most distributions
def_gconv_dir=`for i in /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib; do if @<:@ -d \$i/gconv @:>@; then echo \$i/gconv; break; fi; done`