package/f2fs-tools: add lz4 and lzo optional dependencies

lz4 and lzo are optional dependencies (enabled by default) since bump to
version 1.14.0 in commit cf566658f2 and
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=b585244e726c1024f7b842033689992a383808cc

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Fabrice Fontaine 2022-10-29 19:00:22 +02:00 committed by Thomas Petazzoni
parent 1ce9af6ccf
commit 952fa08764
2 changed files with 105 additions and 1 deletions

View File

@ -0,0 +1,88 @@
From 32e7d272344024c216f155c3463dd2d548f3fafd Mon Sep 17 00:00:00 2001
From: Nick Hainke <vincent@systemli.org>
Date: Mon, 4 Jul 2022 11:29:19 +0200
Subject: configure.ac: fix cross compilation
AC_CHECK_LIB seems to not work correctly with OpenWrt. Add possibility
to disable lz4 and lzo2 manually.
Fixes errors in the form of:
Package f2fsck is missing dependencies for the following libraries:
liblz4.so.1
liblzo2.so.2
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[Retrieved from:
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=32e7d272344024c216f155c3463dd2d548f3fafd]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
configure.ac | 44 ++++++++++++++++++++++++++++++++++----------
1 file changed, 34 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index ea39461..dbe9ad3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,18 @@ AC_ARG_WITH([blkid],
[],
[with_blkid=check])
+AC_ARG_WITH([lzo2],
+ [AS_HELP_STRING([--without-lzo2],
+ [Ignore presence of liblzo2 and disable lzo2 support])],
+ [],
+ [with_lzo2=check])
+
+AC_ARG_WITH([lz4],
+ [AS_HELP_STRING([--without-lz4],
+ [Ignore presence of liblz4 and disable lz4 support])],
+ [],
+ [with_lz4=check])
+
# Checks for programs.
AC_PROG_CC
AM_PROG_AR
@@ -71,17 +83,29 @@ AS_IF([test "x$with_blkid" != xno],
fi
], -lblkid)])
-AC_CHECK_LIB([lzo2], [main],
- [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
- AC_DEFINE([HAVE_LIBLZO2], [1],
- [Define if you have liblzo2])
- ], [], [])
+AS_IF([test "x$with_lzo2" != xno],
+ [AC_CHECK_LIB([lzo2], [main],
+ [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
+ AC_DEFINE([HAVE_LIBLZO2], [1],
+ [Define if you have liblzo2])
+ ],
+ [if test "x$with_lzo2" != xcheck; then
+ AC_MSG_FAILURE(
+ [--with-lzo2 was given, but test for lzo2 failed])
+ fi
+ ], -llzo2)])
-AC_CHECK_LIB([lz4], [main],
- [AC_SUBST([liblz4_LIBS], ["-llz4"])
- AC_DEFINE([HAVE_LIBLZ4], [1],
- [Define if you have liblz4])
- ], [], [])
+AS_IF([test "x$with_lz4" != xno],
+ [AC_CHECK_LIB([lz4], [main],
+ [AC_SUBST([liblz4_LIBS], ["-llz4"])
+ AC_DEFINE([HAVE_LIBLZ4], [1],
+ [Define if you have liblz4])
+ ],
+ [if test "x$with_lz4" != xcheck; then
+ AC_MSG_FAILURE(
+ [--with-lz4 was given, but test for lz4 failed])
+ fi
+ ], -llz4)])
AS_IF([test "x$with_selinux" != xno],
[AC_CHECK_LIB([selinux], [getcon],
--
cgit

View File

@ -22,6 +22,20 @@ else
F2FS_TOOLS_CONF_OPTS += --without-selinux
endif
ifeq ($(BR2_PACKAGE_LZ4),y)
F2FS_TOOLS_CONF_OPTS += --with-lz4
F2FS_TOOLS_DEPENDENCIES += lz4
else
F2FS_TOOLS_CONF_OPTS += --without-lz4
endif
ifeq ($(BR2_PACKAGE_LZO),y)
F2FS_TOOLS_CONF_OPTS += --with-lzo2
F2FS_TOOLS_DEPENDENCIES += lzo
else
F2FS_TOOLS_CONF_OPTS += --without-lzo2
endif
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),y)
# util-linux is a dependency already, no need to list it again
F2FS_TOOLS_CONF_OPTS += --with-blkid
@ -34,7 +48,9 @@ endif
# blkid support even if we have host-util-linux
HOST_F2FS_TOOLS_CONF_OPTS = \
--without-selinux \
--without-blkid
--without-blkid \
--without-lz4 \
--without-lzo2
$(eval $(autotools-package))
$(eval $(host-autotools-package))