lzo.m4 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. dnl Check to find the lzo headers/libraries
  2. AC_DEFUN([tinc_LZO],
  3. [
  4. AC_ARG_ENABLE([lzo],
  5. AS_HELP_STRING([--disable-lzo], [disable lzo compression support]))
  6. AS_IF([test "x$enable_lzo" != "xno"], [
  7. AC_DEFINE(HAVE_LZO, 1, [enable lzo compression support])
  8. AC_ARG_WITH(lzo,
  9. AS_HELP_STRING([--with-lzo=DIR], [lzo base directory, or:]),
  10. [lzo="$withval"
  11. CPPFLAGS="$CPPFLAGS -I$withval/include"
  12. LDFLAGS="$LDFLAGS -L$withval/lib"]
  13. )
  14. AC_ARG_WITH(lzo-include,
  15. AS_HELP_STRING([--with-lzo-include=DIR], [lzo headers directory]),
  16. [lzo_include="$withval"
  17. CPPFLAGS="$CPPFLAGS -I$withval"]
  18. )
  19. AC_ARG_WITH(lzo-lib,
  20. AS_HELP_STRING([--with-lzo-lib=DIR], [lzo library directory]),
  21. [lzo_lib="$withval"
  22. LDFLAGS="$LDFLAGS -L$withval"]
  23. )
  24. AC_CHECK_LIB(lzo2, lzo1x_1_compress,
  25. [LIBS="$LIBS -llzo2"],
  26. [AC_CHECK_LIB(lzo, lzo1x_1_compress,
  27. [LIBS="$LIBS -llzo"],
  28. [AC_MSG_ERROR("lzo libraries not found."); break]
  29. )]
  30. )
  31. AC_CHECK_HEADERS(lzo/lzo1x.h,
  32. [AC_DEFINE(LZO1X_H, [<lzo/lzo1x.h>], [Location of lzo1x.h])],
  33. [AC_CHECK_HEADERS(lzo2/lzo1x.h,
  34. [AC_DEFINE(LZO1X_H, [<lzo2/lzo1x.h>], [Location of lzo1x.h])],
  35. [AC_CHECK_HEADERS(lzo1x.h,
  36. [AC_DEFINE(LZO1X_H, [<lzo1x.h>], [Location of lzo1x.h])],
  37. [AC_MSG_ERROR("lzo header files not found."); break]
  38. )]
  39. )]
  40. )
  41. ])
  42. ])