pandora_have_libcassandra.m4 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. dnl Copyright (C) 2010 Padraig O'Sullivan
  2. dnl This file is free software;
  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. AC_DEFUN([_PANDORA_SEARCH_LIBCASSANDRA],[
  6. AC_REQUIRE([AC_LIB_PREFIX])
  7. dnl --------------------------------------------------------------------
  8. dnl Check for libcassandra
  9. dnl --------------------------------------------------------------------
  10. AC_ARG_ENABLE([libcassandra],
  11. [AS_HELP_STRING([--disable-libcassandra],
  12. [Build with libcassandra support @<:@default=on@:>@])],
  13. [ac_enable_libcassandra="$enableval"],
  14. [ac_enable_libcassandra="yes"])
  15. AS_IF([test "x$ac_enable_libcassandra" = "xyes"],[
  16. AC_LANG_PUSH([C++])
  17. AC_LIB_HAVE_LINKFLAGS(cassandra,[thrift],[
  18. #include <libcassandra/cassandra_factory.h>
  19. ],[
  20. libcassandra::CassandraFactory fact("localhost", 9306);
  21. ])
  22. AC_LANG_POP()
  23. ],[
  24. ac_cv_libcassandra="no"
  25. ])
  26. AM_CONDITIONAL(HAVE_LIBCASSANDRA, [test "x${ac_cv_libcassandra}" = "xyes"])
  27. ])
  28. AC_DEFUN([PANDORA_HAVE_LIBCASSANDRA],[
  29. AC_REQUIRE([_PANDORA_SEARCH_LIBCASSANDRA])
  30. ])
  31. AC_DEFUN([PANDORA_REQUIRE_LIBCASSANDRA],[
  32. AC_REQUIRE([PANDORA_HAVE_LIBCASSANDRA])
  33. AS_IF([test "x$ac_cv_libcassandra" = "xno"],[
  34. PANDORA_MSG_ERROR([libcassandra is required for ${PACKAGE}])
  35. ])
  36. ])