68 lines
2.4 KiB
Diff
68 lines
2.4 KiB
Diff
From c03a8cab17c22f03dfebe910a567c9d547d173e1 Mon Sep 17 00:00:00 2001
|
|
From: Nikolay Borisov <nborisov@suse.com>
|
|
Date: Thu, 30 Sep 2021 15:06:32 +0300
|
|
Subject: [PATCH 1/3] btrfs-progs: Add optional dependency on libudev
|
|
|
|
This is needed for future code which will make btrfs-progs' device
|
|
scanning logic a little smarter by filtering out path device in
|
|
multipath setups. libudev is added as an optional dependency since the
|
|
library doesn't have a static version so making it a hard dependency
|
|
means forfeiting static build support. To alleviate this a fallback code
|
|
will be added for the static build case which doesn't rely on libudev.
|
|
|
|
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
|
|
---
|
|
Makefile | 2 +-
|
|
Makefile.inc.in | 2 +-
|
|
configure.ac | 9 +++++++++
|
|
3 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/Makefile b/Makefile
|
|
index 93fe4c2b3e08..e96f66a36b46 100644
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -129,7 +129,7 @@ LIBS = $(LIBS_BASE) $(LIBS_CRYPTO)
|
|
LIBBTRFS_LIBS = $(LIBS_BASE) $(LIBS_CRYPTO)
|
|
|
|
# Static compilation flags
|
|
-STATIC_CFLAGS = $(CFLAGS) -ffunction-sections -fdata-sections
|
|
+STATIC_CFLAGS = $(CFLAGS) -ffunction-sections -fdata-sections -DSTATIC_BUILD
|
|
STATIC_LDFLAGS = -static -Wl,--gc-sections
|
|
STATIC_LIBS = $(STATIC_LIBS_BASE)
|
|
|
|
diff --git a/Makefile.inc.in b/Makefile.inc.in
|
|
index 9f49337147b8..c995aef97219 100644
|
|
--- a/Makefile.inc.in
|
|
+++ b/Makefile.inc.in
|
|
@@ -27,7 +27,7 @@ CRYPTO_CFLAGS = @GCRYPT_CFLAGS@ @SODIUM_CFLAGS@ @KCAPI_CFLAGS@
|
|
SUBST_CFLAGS = @CFLAGS@
|
|
SUBST_LDFLAGS = @LDFLAGS@
|
|
|
|
-LIBS_BASE = @UUID_LIBS@ @BLKID_LIBS@ -L. -pthread
|
|
+LIBS_BASE = @UUID_LIBS@ @BLKID_LIBS@ @LIBUDEV_LIBS@ -L. -pthread
|
|
LIBS_COMP = @ZLIB_LIBS@ @LZO2_LIBS@ @ZSTD_LIBS@
|
|
LIBS_PYTHON = @PYTHON_LIBS@
|
|
LIBS_CRYPTO = @GCRYPT_LIBS@ @SODIUM_LIBS@ @KCAPI_LIBS@
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 038c2688421c..d0ceb0d70d16 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -304,6 +304,15 @@ PKG_STATIC(UUID_LIBS_STATIC, [uuid])
|
|
PKG_CHECK_MODULES(ZLIB, [zlib])
|
|
PKG_STATIC(ZLIB_LIBS_STATIC, [zlib])
|
|
|
|
+PKG_CHECK_EXISTS([libudev], [pkg_config_libudev=yes], [pkg_config_libudev=no])
|
|
+if test "x$pkg_config_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([zstd],
|
|
AS_HELP_STRING([--disable-zstd], [build without zstd support]),
|
|
[], [enable_zstd=yes]
|
|
--
|
|
2.25.1
|
|
|