210-build_always_use_internal_lz4.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -1077,68 +1077,15 @@ dnl
  4. AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4])
  5. AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4])
  6. if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then
  7. - if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then
  8. - # if the user did not explicitly specify flags, try to autodetect
  9. - PKG_CHECK_MODULES([LZ4],
  10. - [liblz4 >= 1.7.1 liblz4 < 100],
  11. - [have_lz4="yes"],
  12. - [LZ4_LIBS="-llz4"] # If this fails, we will do another test next.
  13. - # We also add set LZ4_LIBS otherwise the
  14. - # linker will not know about the lz4 library
  15. - )
  16. - fi
  17. saved_CFLAGS="${CFLAGS}"
  18. saved_LIBS="${LIBS}"
  19. CFLAGS="${CFLAGS} ${LZ4_CFLAGS}"
  20. LIBS="${LIBS} ${LZ4_LIBS}"
  21. - # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars
  22. - # are used, check the version directly in the LZ4 include file
  23. - if test "${have_lz4}" != "yes"; then
  24. - AC_CHECK_HEADERS([lz4.h],
  25. - [have_lz4h="yes"],
  26. - [])
  27. -
  28. - if test "${have_lz4h}" = "yes" ; then
  29. - AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1])
  30. - AC_COMPILE_IFELSE(
  31. - [AC_LANG_PROGRAM([[
  32. -#include <lz4.h>
  33. - ]],
  34. - [[
  35. -/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */
  36. -#if LZ4_VERSION_NUMBER < 10701L
  37. -#error LZ4 is too old
  38. -#endif
  39. - ]]
  40. - )],
  41. - [
  42. - AC_MSG_RESULT([ok])
  43. - have_lz4="yes"
  44. - ],
  45. - [AC_MSG_RESULT([system LZ4 library is too old])]
  46. - )
  47. - fi
  48. - fi
  49. -
  50. - # Double check we have a few needed functions
  51. - if test "${have_lz4}" = "yes" ; then
  52. - AC_CHECK_LIB([lz4],
  53. - [LZ4_compress_default],
  54. - [],
  55. - [have_lz4="no"])
  56. - AC_CHECK_LIB([lz4],
  57. - [LZ4_decompress_safe],
  58. - [],
  59. - [have_lz4="no"])
  60. - fi
  61. -
  62. - if test "${have_lz4}" != "yes" ; then
  63. - AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
  64. - AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
  65. - LZ4_LIBS=""
  66. - fi
  67. + AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
  68. + AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
  69. + LZ4_LIBS=""
  70. OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
  71. OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
  72. AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library])