210-build_always_use_internal_lz4.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --- a/configure.ac
  2. +++ b/configure.ac
  3. @@ -1068,62 +1068,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],
  11. - [have_lz4="yes"],
  12. - [] # If this fails, we will do another test next
  13. - )
  14. - fi
  15. saved_CFLAGS="${CFLAGS}"
  16. saved_LIBS="${LIBS}"
  17. CFLAGS="${CFLAGS} ${LZ4_CFLAGS}"
  18. LIBS="${LIBS} ${LZ4_LIBS}"
  19. - # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars
  20. - # are used, check the version directly in the LZ4 include file
  21. - if test "${have_lz4}" != "yes"; then
  22. - AC_CHECK_HEADERS([lz4.h],
  23. - [have_lz4h="yes"],
  24. - [])
  25. -
  26. - if test "${have_lz4h}" = "yes" ; then
  27. - AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1])
  28. - AC_COMPILE_IFELSE(
  29. - [AC_LANG_PROGRAM([[
  30. -#include <lz4.h>
  31. - ]],
  32. - [[
  33. -/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */
  34. -#if LZ4_VERSION_NUMBER < 10701L
  35. -#error LZ4 is too old
  36. -#endif
  37. - ]]
  38. - )],
  39. - [
  40. - AC_MSG_RESULT([ok])
  41. - have_lz4="yes"
  42. - ],
  43. - [AC_MSG_RESULT([system LZ4 library is too old])]
  44. - )
  45. - fi
  46. - fi
  47. -
  48. - # if LZ4_LIBS is set, we assume it will work, otherwise test
  49. - if test -z "${LZ4_LIBS}"; then
  50. - AC_CHECK_LIB([lz4],
  51. - [LZ4_compress],
  52. - [LZ4_LIBS="-llz4"],
  53. - [have_lz4="no"])
  54. - fi
  55. -
  56. - if test "${have_lz4}" != "yes" ; then
  57. - AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
  58. - AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
  59. - LZ4_LIBS=""
  60. - fi
  61. + AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
  62. + AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
  63. + LZ4_LIBS=""
  64. OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
  65. OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
  66. AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library])