@@ -7,8 +7,8 @@ dnl to use to control whether to install unit files.
77dnl
88dnl Provides the INN_LIB_SYSTEMD_DAEMON_OPTIONAL macro, which sets
99dnl SYSTEMD_CFLAGS and SYSTEMD_LIBS substitution variables if libsystemd is
10- dnl available and defines HAVE_SD_NOTIFY. Adds sd-daemon.c to LIBOBJS if
11- dnl libsystemd is not available. pkg-config support for libsystemd-daemon is
10+ dnl available and defines HAVE_SD_NOTIFY. Adds sd-daemon.c to LIBOBJS if
11+ dnl libsystemd is not available. pkg-config support for libsystemd-daemon is
1212dnl required for it to be detected.
1313dnl
1414dnl Depends on the Autoconf macros that come with pkg-config.
@@ -17,7 +17,7 @@ dnl The canonical version of this file is maintained in the rra-c-util
1717dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
1818dnl
1919dnl Written by Russ Allbery <eagle@eyrie.org>
20- dnl Copyright 2015, 2021, 2022 Russ Allbery <eagle@eyrie.org>
20+ dnl Copyright 2015, 2021, 2022, 2025 Russ Allbery <eagle@eyrie.org>
2121dnl Copyright 2013-2014
2222dnl The Board of Trustees of the Leland Stanford Junior University
2323dnl
2828dnl SPDX-License-Identifier: FSFULLR
2929
3030dnl Determine the systemd system unit directory, along with a configure flag
31- dnl to override, and sets @systemdsystemunitdir@. Provides the Automake
31+ dnl to override, and sets @systemdsystemunitdir@. Provides the Automake
3232dnl HAVE_SYSTEMD Automake conditional.
3333AC_DEFUN ( [ INN_WITH_SYSTEMD_UNITDIR] ,
34- [ AC_REQUIRE ( [ PKG_PROG_PKG_CONFIG ] )
34+ [ PKG_PROG_PKG_CONFIG( [ ] , [ PKG_CONFIG=false ] )
3535 AS_IF ( [ test x"$PKG_CONFIG" = x] , [ PKG_CONFIG=false] )
3636 AC_ARG_WITH ( [ systemdsystemunitdir] ,
3737 [ AS_HELP_STRING ( [ --with-systemdsystemunitdir=DIR] ,
@@ -45,12 +45,14 @@ AC_DEFUN([INN_WITH_SYSTEMD_UNITDIR],
4545 && test x"$with_systemdsystemunitdir" != xno] )] )
4646
4747dnl Check for libsystemd or libsystemd-daemon and define SYSTEMD_{CFLAGS,LIBS}
48- dnl if it is available. This is called INN_LIB_SYSTEMD_DAEMON_OPTIONAL since
48+ dnl if it is available. This is called INN_LIB_SYSTEMD_DAEMON_OPTIONAL since
4949dnl it was originally written when libsystemd-daemon was separate, and only
50- dnl checks for that library. It may eventually make sense to retire this in
50+ dnl checks for that library. It may eventually make sense to retire this in
5151dnl favor of a simple INN_LIB_SYSTEMD_OPTIONAL that isn't backward-compatible.
5252AC_DEFUN ( [ INN_LIB_SYSTEMD_DAEMON_OPTIONAL] ,
53- [ PKG_CHECK_EXISTS([ libsystemd] ,
53+ [ PKG_PROG_PKG_CONFIG([ ] , [ PKG_CONFIG=false] )
54+ AS_IF ( [ test x"$PKG_CONFIG" = x] , [ PKG_CONFIG=false] )
55+ PKG_CHECK_EXISTS([ libsystemd] ,
5456 [ PKG_CHECK_MODULES([ SYSTEMD] , [ libsystemd] )
5557 AC_DEFINE ( [ HAVE_SD_NOTIFY] , 1 , [ Define if sd_notify is available.] ) ] ,
5658 [ PKG_CHECK_EXISTS([ libsystemd-daemon] ,
0 commit comments