btrfs-progs: build: make libudev selectable

Previously the build would be optional based on what is installed on the
system. Add an option to make this selectable by user, ie. to allow
build without libudev even if it is installed on the system.

For most users and distros libudev dependency should be ok, but we've
had requests to disable various features (embedded, systems with
non-systemd user space base system) so let's do the same.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-10-05 16:43:02 +02:00
parent c6c2e3da0a
commit 1d0fa3781e
2 changed files with 13 additions and 5 deletions

View File

@ -22,6 +22,12 @@ dependencies are not desired.
- libsodium
- libkcapi
Optionally, multipath device detection requires libudev and running udev
daemon, as it's the only source of the path information. Static build has a
fallback and does not need static version of libudev.
- libudev
For zoned device support, the system headers installed in /usr/include/linux
must be 5.10 or newer.

View File

@ -317,13 +317,14 @@ fi
AS_IF([test "x$enable_zstd" = xyes], [BTRFSRESTORE_ZSTD=1], [BTRFSRESTORE_ZSTD=0])
AC_SUBST(BTRFSRESTORE_ZSTD)
PKG_CHECK_EXISTS([libudev], [pkg_config_libudev=yes], [pkg_config_libudev=no])
if test "x$pkg_config_libudev" = xyes; then
AC_ARG_ENABLE([libudev],
AS_HELP_STRING([--disable-libudev], [build without libudev support (for multipath)]),
[], [enable_libudev=yes]
)
if test "x$enable_libudev" = xyes; then
PKG_CHECK_MODULES([LIBUDEV], [libudev])
AC_DEFINE([HAVE_LIBUDEV], [1], [Define to 1 if libudev is available])
else
AC_MSG_CHECKING([for LIBUDEV])
AC_MSG_RESULT([no])
fi
AC_ARG_ENABLE([python],
@ -430,6 +431,7 @@ AC_MSG_RESULT([
Python bindings: ${enable_python}
Python interpreter: ${PYTHON}
crypto provider: ${cryptoprovider} ${cryptoproviderversion}
libudev: ${enable_libudev}
zoned device: ${enable_zoned}
${experimental_msg}
Type 'make' to compile.