build: Only require augeas and hivex if also building the daemon

These libraries are only needed if building the daemon (so not if
using ./configure --disable-daemon).  Move the tests so we only check
for these libraries if the daemon is enabled in the build.

The daemon also requires ocaml-augeas (it uses both the augeas C
library directly and the OCaml bindings for augeas, for reasons).
However that test is already disabled if the daemon is not being
built.

Reported-by: Mohamed Akram
Fixes: commit dfa9dee775
Fixes: commit 8a723ca62e
Fixes: commit 228d49bb84
Fixes: https://github.com/libguestfs/libguestfs/issues/184
This commit is contained in:
Richard W.M. Jones
2025-04-22 12:14:33 +01:00
parent 2b2be31af0
commit 0423f2cec3
2 changed files with 12 additions and 12 deletions

View File

@@ -58,8 +58,20 @@ if test "x$enable_daemon" = "xyes"; then
fi
AC_MSG_RESULT([$DAEMON_SUPERMIN_DIR])
AC_SUBST([DAEMON_SUPERMIN_DIR])
dnl Check for Augeas >= 1.2.0 (required, daemon only).
PKG_CHECK_MODULES([AUGEAS],[augeas >= 1.2.0])
dnl hivex library (required, daemon only)
PKG_CHECK_MODULES([HIVEX], [hivex],[
AC_SUBST([HIVEX_CFLAGS])
AC_SUBST([HIVEX_LIBS])
AC_DEFINE([HAVE_HIVEX],[1],[hivex library found at compile time.])
],
[AC_MSG_FAILURE([hivex library is required])])
fi
AM_CONDITIONAL([INSTALL_DAEMON],[test "x$enable_install_daemon" = "xyes"])
AM_CONDITIONAL([HAVE_HIVEX],[test "x$HIVEX_LIBS" != "x"])
dnl POSIX acl library (highly recommended)
AC_CHECK_LIB([acl],[acl_from_text],[
@@ -77,15 +89,6 @@ AC_CHECK_LIB([cap],[cap_from_text],[
], [])
],[AC_MSG_WARN([Linux capabilities library (libcap) not found])])
dnl hivex library (required)
PKG_CHECK_MODULES([HIVEX], [hivex],[
AC_SUBST([HIVEX_CFLAGS])
AC_SUBST([HIVEX_LIBS])
AC_DEFINE([HAVE_HIVEX],[1],[hivex library found at compile time.])
],
[AC_MSG_FAILURE([hivex library is required])])
AM_CONDITIONAL([HAVE_HIVEX],[test "x$HIVEX_LIBS" != "x"])
dnl librpm library (optional)
PKG_CHECK_MODULES([LIBRPM], [rpm >= 4.6.0],[
AC_SUBST([LIBRPM_CFLAGS])

View File

@@ -251,9 +251,6 @@ PKG_CHECK_MODULES([PCRE2], [libpcre2-8], [], [
dnl Check for zstd (required since OCaml 5.1)
PKG_CHECK_MODULES([LIBZSTD], [libzstd])
dnl Check for Augeas >= 1.2.0 (required).
PKG_CHECK_MODULES([AUGEAS],[augeas >= 1.2.0])
dnl Check for aug_source function, added in Augeas 1.8.0.
old_LIBS="$LIBS"
LIBS="$AUGEAS_LIBS"