1
dnl Copyright (C) 2009 Sun Microsystems, Inc.
2
dnl This file is free software; Sun Microsystems, Inc.
3
dnl gives unlimited permission to copy and/or distribute it,
4
dnl with or without modifications, as long as this notice is preserved.
6
dnl Provides support for finding libtokyocabinet.
7
dnl LIBTOKYOCABINET_CFLAGS will be set, in addition to LIBTOKYOCABINET and LTLIBTOKYOCABINET
9
AC_DEFUN([_PANDORA_SEARCH_LIBTOKYOCABINET],[
10
AC_REQUIRE([AC_LIB_PREFIX])
12
dnl --------------------------------------------------------------------
13
dnl Check for libtokyocabinet
14
dnl --------------------------------------------------------------------
16
AC_ARG_ENABLE([libtokyocabinet],
17
[AS_HELP_STRING([--disable-libtokyocabinet],
18
[Build with libtokyocabinet support @<:@default=on@:>@])],
19
[ac_enable_libtokyocabinet="$enableval"],
20
[ac_enable_libtokyocabinet="yes"])
22
AS_IF([test "x$ac_enable_libtokyocabinet" = "xyes"],[
23
AC_LIB_HAVE_LINKFLAGS(tokyocabinet,,[
27
const char *test= tcversion;
28
bool ret= tcadboptimize(NULL, "params");
31
ac_cv_libtokyocabinet="no"
34
AS_IF([test "${ac_cv_libtokyocabinet}" = "no" -a "${ac_enable_libtokyocabinet}" = "yes"],[
36
PKG_CHECK_MODULES([LIBTOKYOCABINET], [libtokyocabinet >= 1.4.15], [
37
ac_cv_libtokyocabinet=yes
38
LTLIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
39
LIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
43
AM_CONDITIONAL(HAVE_LIBTOKYOCABINET, [test "${ac_cv_libtokyocabinet}" = "yes"])
46
AC_DEFUN([PANDORA_HAVE_LIBTOKYOCABINET],[
47
AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
50
AC_DEFUN([PANDORA_REQUIRE_LIBTOKYOCABINET],[
51
AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
52
AS_IF([test "x${ac_cv_libtokyocabinet}" = "xno"],
53
AC_MSG_ERROR([libtokyocabinet is required for ${PACKAGE}. On Debian systems this is found in libtokyocabinet-dev. On RedHat, in tokyocabinet-devel.]))