pandora_have_libtokyocabinet.m4 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. dnl Copyright (C) 2009 Sun Microsystems
  2. dnl This file is free software; Sun Microsystems
  3. dnl gives unlimited permission to copy and/or distribute it,
  4. dnl with or without modifications, as long as this notice is preserved.
  5. dnl Provides support for finding libtokyocabinet.
  6. dnl LIBTOKYOCABINET_CFLAGS will be set, in addition to LIBTOKYOCABINET and LTLIBTOKYOCABINET
  7. AC_DEFUN([_PANDORA_SEARCH_LIBTOKYOCABINET],[
  8. AC_REQUIRE([AC_LIB_PREFIX])
  9. dnl --------------------------------------------------------------------
  10. dnl Check for libtokyocabinet
  11. dnl --------------------------------------------------------------------
  12. AC_ARG_ENABLE([libtokyocabinet],
  13. [AS_HELP_STRING([--disable-libtokyocabinet],
  14. [Build with libtokyocabinet support @<:@default=on@:>@])],
  15. [ac_enable_libtokyocabinet="$enableval"],
  16. [ac_enable_libtokyocabinet="yes"])
  17. AS_IF([test "x$ac_enable_libtokyocabinet" = "xyes"],[
  18. AC_LIB_HAVE_LINKFLAGS(tokyocabinet,,[
  19. #include <tcutil.h>
  20. ],[
  21. const char *test= tcversion;
  22. ])
  23. ],[
  24. ac_cv_libtokyocabinet="no"
  25. ])
  26. AS_IF([test "${ac_cv_libtokyocabinet}" = "no" -a "${ac_enable_libtokyocabinet}" = "yes"],[
  27. PKG_CHECK_MODULES([LIBTOKYOCABINET], [libtokyocabinet], [
  28. ac_cv_libtokyocabinet=yes
  29. LTLIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
  30. LIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
  31. ],[])
  32. ])
  33. AM_CONDITIONAL(HAVE_LIBTOKYOCABINET, [test "${ac_cv_libtokyocabinet}" = "yes"])
  34. ])
  35. AC_DEFUN([PANDORA_HAVE_LIBTOKYOCABINET],[
  36. AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
  37. ])
  38. AC_DEFUN([PANDORA_REQUIRE_LIBTOKYOCABINET],[
  39. AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
  40. AS_IF([test "x${ac_cv_libtokyocabinet}" = "xno"],
  41. AC_MSG_ERROR([libtokyocabinet is required for ${PACKAGE}. On Debian systems this is found in libtokyocabinet-dev. On RedHat, in tokyocabinet-devel.]))
  42. ])