On 05/12/2025 1:13 pm, Mykola Kvach wrote:
> From: Mykola Kvach <[email protected]>
>
> Using PKG_CHECK_VAR() to obtain SYSTEMD_SLEEP_DIR reintroduced a build-time
> dependency on systemd-devel. This breaks --enable-systemd builds that only
> need the initscripts.
>
> Use the same defaulting scheme as other systemd paths: if SYSTEMD_SLEEP_DIR
> isn't provided, set it to "$(prefix)/lib/systemd/system-sleep/".
>
> Fixes: e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on 
> suspend/resume")
> Reported-by: Marek Marczykowski-Górecki <[email protected]>
> Signed-off-by: Mykola Kvach <[email protected]>
> ---
> Build in which the regression was detected:
> https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/10959608099
> ---
>  m4/systemd.m4 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/m4/systemd.m4 b/m4/systemd.m4
> index c47a25ef93..ee684d3391 100644
> --- a/m4/systemd.m4
> +++ b/m4/systemd.m4
> @@ -77,7 +77,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
>       ], [])
>  
>       AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [
> -         PKG_CHECK_VAR([SYSTEMD_SLEEP_DIR], [systemd], [systemdsleepdir])
> +         SYSTEMD_SLEEP_DIR="\$(prefix)/lib/systemd/system-sleep/"
>       ], [])
>  
>       AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [

Actually on second thoughts...  The build failure was hitting this
second check, not the PKG_CHECK_VAR() itself.

If systemd-devel is installed, we should use what it provides.  So,
can't we just do this:

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index c47a25ef9393..5fb5a7089ee3 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -81,7 +81,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
        ], [])
 
        AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [
-           AC_MSG_ERROR([SYSTEMD_SLEEP_DIR is unset])
+           SYSTEMD_SLEEP_DIR="\$(prefix)/lib/systemd/system-sleep/"
        ], [])
 ])

 
?

~Andrew

Reply via email to