]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
autotools: fix AM_CONDITIONAL for HAVE_UDEV and HAVE_AUDIT
authorKarel Zak <kzak@redhat.com>
Mon, 27 Apr 2026 10:19:30 +0000 (12:19 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2026 09:16:23 +0000 (11:16 +0200)
Ensure AM_CONDITIONAL is always defined when entering the
else-branch, even when the library is not found. Previously,
when with_udev=auto (default) and libudev was not available,
the conditional was never defined, causing a configure error.

configure.ac

index c9b9b38a694316c8521944a8ea4f9e3703f520ed..34d6a2cd3e90fb51c33435f2093f24e8cdab3633 100644 (file)
@@ -1103,8 +1103,8 @@ AS_IF([test "x$with_audit" = xno], [
   )
   AS_IF([test "x$have_audit" = xyes], [
     AC_DEFINE([HAVE_LIBAUDIT], [1], [Define if audit is available])
-    AM_CONDITIONAL([HAVE_AUDIT], [true])
   ])
+  AM_CONDITIONAL([HAVE_AUDIT], [test "x$have_audit" = xyes])
 ])
 AC_SUBST([AUDIT_LIBS])
 
@@ -1123,8 +1123,8 @@ AS_IF([test "x$with_udev" = xno], [
   )
   AS_IF([test "x$have_udev" = xyes], [
     AC_DEFINE([HAVE_LIBUDEV], [1], [Define if udev is available])
-    AM_CONDITIONAL([HAVE_UDEV], [true])
   ])
+  AM_CONDITIONAL([HAVE_UDEV], [test "x$have_udev" = xyes])
 ])
 AC_SUBST([UDEV_LIBS])