Skip to content

Commit e9a4dc7

Browse files
committed
Fix libsystemd detection, failed --with=systemd=foo in distcheck
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 1d93c4e commit e9a4dc7

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

configure.ac

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ AS_IF([test "x$PKG_CONFIG" = "x"], [
9191

9292
with_libsystemd=no
9393
AS_IF([test "x$with_systemd" = "xyes" -o "x$with_systemd" = "xauto"], [
94-
PKG_CHECK_MODULES([libsystemd], [libsystemd], [with_libsystemd=yes], [true])
95-
def_systemd=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
96-
AS_IF([test "x$def_systemd" = "x"],
97-
[AS_IF([test "x$with_systemd" = "xyes"],
98-
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
99-
with_systemd=no], [with_systemd="$def_systemd"])])
100-
101-
AS_IF([test "x$with_systemd" != "xno"],
102-
[AC_SUBST([systemddir], [$with_systemd])])
94+
def_systemd=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
95+
AS_IF([test "x$def_systemd" = "x"], [
96+
AS_IF([test "x$with_systemd" = "xyes"],[
97+
AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
98+
with_systemd=no], [with_systemd="$def_systemd"])])
99+
100+
AS_IF([test "x$with_systemd" != "xno"], [
101+
PKG_CHECK_MODULES([libsystemd], [libsystemd], [with_libsystemd=yes], [true])
102+
AC_SUBST([systemddir], [$with_systemd])])
103103
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" != "xno"])
104104

105-
AS_IF([test "x$with_libsystemd" != "xno"],
106-
AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define to 1 if you have libsystemd-dev])
107-
AC_SUBST([DAEMON_TYPE], "Notify"),
108-
AC_SUBST([DAEMON_TYPE], "Simple"))
105+
AS_IF([test "x$with_libsystemd" != "xno"], [
106+
AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define to 1 if you have libsystemd-dev])
107+
AC_SUBST([DAEMON_TYPE], "Notify")], [
108+
AC_SUBST([DAEMON_TYPE], "Simple")])
109109
AM_CONDITIONAL([HAVE_LIBSYSTEMD], [test "x$with_libsystemd" != "xno"])
110110

111111
# Check if we need -lpthread (building statically) and -lrt (older GLIBC)

0 commit comments

Comments
 (0)