1 From 821a1d3fcce31c234512a8f4dc4fc97dfbd7ae32 Mon Sep 17 00:00:00 2001
2 From: Nick Hainke <vincent@systemli.org>
3 Date: Mon, 4 Jul 2022 09:46:10 +0200
4 Subject: [PATCH] configure.ac: fix cross compilation
6 AC_CHECK_LIB seems to not work correctly with OpenWrt. Add possibility
7 to disable lz4 and lzo2 manually.
9 Fixes errors in the form of:
10 Package f2fsck is missing dependencies for the following libraries:
14 Signed-off-by: Nick Hainke <vincent@systemli.org>
16 configure.ac | 44 ++++++++++++++++++++++++++++++++++----------
17 1 file changed, 34 insertions(+), 10 deletions(-)
21 @@ -50,6 +50,18 @@ AC_ARG_WITH([blkid],
26 + [AS_HELP_STRING([--without-lzo2],
27 + [Ignore presence of liblzo2 and disable lzo2 support])],
32 + [AS_HELP_STRING([--without-lz4],
33 + [Ignore presence of liblz4 and disable lz4 support])],
37 # Checks for programs.
40 @@ -71,17 +83,29 @@ AS_IF([test "x$with_blkid" != xno],
44 -AC_CHECK_LIB([lzo2], [main],
45 - [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
46 - AC_DEFINE([HAVE_LIBLZO2], [1],
47 - [Define if you have liblzo2])
50 -AC_CHECK_LIB([lz4], [main],
51 - [AC_SUBST([liblz4_LIBS], ["-llz4"])
52 - AC_DEFINE([HAVE_LIBLZ4], [1],
53 - [Define if you have liblz4])
55 +AS_IF([test "x$with_lzo2" != xno],
56 + [AC_CHECK_LIB([lzo2], [main],
57 + [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
58 + AC_DEFINE([HAVE_LIBLZO2], [1],
59 + [Define if you have liblzo2])
61 + [if test "x$with_lzo2" != xcheck; then
63 + [--with-lzo2 was given, but test for lzo2 failed])
67 +AS_IF([test "x$with_lz4" != xno],
68 + [AC_CHECK_LIB([lz4], [main],
69 + [AC_SUBST([liblz4_LIBS], ["-llz4"])
70 + AC_DEFINE([HAVE_LIBLZ4], [1],
71 + [Define if you have liblz4])
73 + [if test "x$with_lz4" != xcheck; then
75 + [--with-lz4 was given, but test for lz4 failed])
79 AS_IF([test "x$with_selinux" != xno],
80 [AC_CHECK_LIB([selinux], [getcon],