Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 1 | From 3f61e353424fb9ea3dce742022b94dfd7ea1ed9f Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de> |
| 3 | Date: Thu, 4 Mar 2021 14:23:39 +0100 |
| 4 | Subject: [PATCH] configure.ac: autodetect availability of systemd |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Import systemd's official suggestion [1] how this should be handled in packages |
| 10 | using autoconf. A side effect of this is the removal of the hardcoded fallback |
| 11 | path "/lib/systemd/system" which leaks build host information when cross |
| 12 | compiling v4l-utils and therefore defeats reproducible builds. |
| 13 | |
| 14 | [1] https://www.freedesktop.org/software/systemd/man/daemon.html#Installing%20systemd%20Service%20Files |
| 15 | |
| 16 | Upstream-Status: Backport [https://git.linuxtv.org/v4l-utils.git/commit/?id=3f61e353424fb9ea3dce742022b94dfd7ea1ed9f] |
| 17 | |
| 18 | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> |
| 19 | Signed-off-by: Sean Young <sean@mess.org> |
| 20 | --- |
| 21 | configure.ac | 10 +++++++++- |
| 22 | 1 file changed, 9 insertions(+), 1 deletion(-) |
| 23 | |
| 24 | diff --git a/configure.ac b/configure.ac |
| 25 | index 727730c5ccf4..8470116df4b1 100644 |
| 26 | --- a/configure.ac |
| 27 | +++ b/configure.ac |
| 28 | @@ -388,7 +388,15 @@ AC_ARG_WITH(udevdir, |
| 29 | AC_ARG_WITH(systemdsystemunitdir, |
| 30 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [set systemd system unit directory]), |
| 31 | [], |
| 32 | - [with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd || echo /lib/systemd/system`]) |
| 33 | + [with_systemdsystemunitdir=auto]) |
| 34 | +AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], |
| 35 | + [def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 36 | + AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 37 | + [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 38 | + [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 39 | + with_systemdsystemunitdir=no], |
| 40 | + [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 41 | +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 42 | |
| 43 | # Generic check: works with most distributions |
| 44 | 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` |
| 45 | -- |
| 46 | 2.29.2 |
| 47 | |