ath25: Replace fall through comment with fallthrough;
[openwrt/staging/ldir.git] / package / utils / f2fs-tools / patches / 101-configure.ac-fix-cross-compilation.patch
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
5
6 AC_CHECK_LIB seems to not work correctly with OpenWrt. Add possibility
7 to disable lz4 and lzo2 manually.
8
9 Fixes errors in the form of:
10 Package f2fsck is missing dependencies for the following libraries:
11 liblz4.so.1
12 liblzo2.so.2
13
14 Signed-off-by: Nick Hainke <vincent@systemli.org>
15 ---
16 configure.ac | 44 ++++++++++++++++++++++++++++++++++----------
17 1 file changed, 34 insertions(+), 10 deletions(-)
18
19 --- a/configure.ac
20 +++ b/configure.ac
21 @@ -50,6 +50,18 @@ AC_ARG_WITH([blkid],
22 [],
23 [with_blkid=check])
24
25 +AC_ARG_WITH([lzo2],
26 + [AS_HELP_STRING([--without-lzo2],
27 + [Ignore presence of liblzo2 and disable lzo2 support])],
28 + [],
29 + [with_lzo2=check])
30 +
31 +AC_ARG_WITH([lz4],
32 + [AS_HELP_STRING([--without-lz4],
33 + [Ignore presence of liblz4 and disable lz4 support])],
34 + [],
35 + [with_lz4=check])
36 +
37 # Checks for programs.
38 AC_PROG_CC
39 AM_PROG_AR
40 @@ -71,17 +83,29 @@ AS_IF([test "x$with_blkid" != xno],
41 fi
42 ], -lblkid)])
43
44 -AC_CHECK_LIB([lzo2], [main],
45 - [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
46 - AC_DEFINE([HAVE_LIBLZO2], [1],
47 - [Define if you have liblzo2])
48 - ], [], [])
49 -
50 -AC_CHECK_LIB([lz4], [main],
51 - [AC_SUBST([liblz4_LIBS], ["-llz4"])
52 - AC_DEFINE([HAVE_LIBLZ4], [1],
53 - [Define if you have liblz4])
54 - ], [], [])
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])
60 + ],
61 + [if test "x$with_lzo2" != xcheck; then
62 + AC_MSG_FAILURE(
63 + [--with-lzo2 was given, but test for lzo2 failed])
64 + fi
65 + ], -llzo2)])
66 +
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])
72 + ],
73 + [if test "x$with_lz4" != xcheck; then
74 + AC_MSG_FAILURE(
75 + [--with-lz4 was given, but test for lz4 failed])
76 + fi
77 + ], -llz4)])
78
79 AS_IF([test "x$with_selinux" != xno],
80 [AC_CHECK_LIB([selinux], [getcon],