101-configure.ac-fix-cross-compilation.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 821a1d3fcce31c234512a8f4dc4fc97dfbd7ae32 Mon Sep 17 00:00:00 2001
  2. From: Nick Hainke <[email protected]>
  3. Date: Mon, 4 Jul 2022 09:46:10 +0200
  4. Subject: [PATCH] configure.ac: fix cross compilation
  5. AC_CHECK_LIB seems to not work correctly with OpenWrt. Add possibility
  6. to disable lz4 and lzo2 manually.
  7. Fixes errors in the form of:
  8. Package f2fsck is missing dependencies for the following libraries:
  9. liblz4.so.1
  10. liblzo2.so.2
  11. Signed-off-by: Nick Hainke <[email protected]>
  12. ---
  13. configure.ac | 44 ++++++++++++++++++++++++++++++++++----------
  14. 1 file changed, 34 insertions(+), 10 deletions(-)
  15. --- a/configure.ac
  16. +++ b/configure.ac
  17. @@ -50,6 +50,18 @@ AC_ARG_WITH([blkid],
  18. [],
  19. [with_blkid=check])
  20. +AC_ARG_WITH([lzo2],
  21. + [AS_HELP_STRING([--without-lzo2],
  22. + [Ignore presence of liblzo2 and disable lzo2 support])],
  23. + [],
  24. + [with_lzo2=check])
  25. +
  26. +AC_ARG_WITH([lz4],
  27. + [AS_HELP_STRING([--without-lz4],
  28. + [Ignore presence of liblz4 and disable lz4 support])],
  29. + [],
  30. + [with_lz4=check])
  31. +
  32. # Checks for programs.
  33. AC_PROG_CC
  34. AM_PROG_AR
  35. @@ -71,17 +83,29 @@ AS_IF([test "x$with_blkid" != xno],
  36. fi
  37. ], -lblkid)])
  38. -AC_CHECK_LIB([lzo2], [main],
  39. - [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
  40. - AC_DEFINE([HAVE_LIBLZO2], [1],
  41. - [Define if you have liblzo2])
  42. - ], [], [])
  43. -
  44. -AC_CHECK_LIB([lz4], [main],
  45. - [AC_SUBST([liblz4_LIBS], ["-llz4"])
  46. - AC_DEFINE([HAVE_LIBLZ4], [1],
  47. - [Define if you have liblz4])
  48. - ], [], [])
  49. +AS_IF([test "x$with_lzo2" != xno],
  50. + [AC_CHECK_LIB([lzo2], [main],
  51. + [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
  52. + AC_DEFINE([HAVE_LIBLZO2], [1],
  53. + [Define if you have liblzo2])
  54. + ],
  55. + [if test "x$with_lzo2" != xcheck; then
  56. + AC_MSG_FAILURE(
  57. + [--with-lzo2 was given, but test for lzo2 failed])
  58. + fi
  59. + ], -llzo2)])
  60. +
  61. +AS_IF([test "x$with_lz4" != xno],
  62. + [AC_CHECK_LIB([lz4], [main],
  63. + [AC_SUBST([liblz4_LIBS], ["-llz4"])
  64. + AC_DEFINE([HAVE_LIBLZ4], [1],
  65. + [Define if you have liblz4])
  66. + ],
  67. + [if test "x$with_lz4" != xcheck; then
  68. + AC_MSG_FAILURE(
  69. + [--with-lz4 was given, but test for lz4 failed])
  70. + fi
  71. + ], -llz4)])
  72. AS_IF([test "x$with_selinux" != xno],
  73. [AC_CHECK_LIB([selinux], [getcon],