Merge Monty
[m6w6/libmemcached] / m4 / pandora_have_libdrizzle.m4
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
6 AC_DEFUN([_PANDORA_SEARCH_LIBDRIZZLE],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libdrizzle
11 dnl --------------------------------------------------------------------
12
13 AC_LIB_HAVE_LINKFLAGS(drizzle,,[
14 #include <libdrizzle/drizzle_client.h>
15 ],[
16 drizzle_st drizzle;
17 drizzle_version();
18 ])
19
20 AM_CONDITIONAL(HAVE_LIBDRIZZLE, [test "x${ac_cv_libdrizzle}" = "xyes"])
21
22 ])
23
24 AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
25 AC_REQUIRE([_PANDORA_SEARCH_LIBDRIZZLE])
26 ])
27
28 AC_DEFUN([PANDORA_REQUIRE_LIBDRIZZLE],[
29 AC_REQUIRE([PANDORA_HAVE_LIBDRIZZLE])
30 AS_IF([test x$ac_cv_libdrizzle = xno],
31 AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}]))
32 ])
33
34 AC_DEFUN([PANDORA_LIBDRIZZLE_NOVCOL],[
35 AC_CACHE_CHECK([if libdrizzle still has virtual columns],
36 [pandora_cv_libdrizzle_vcol],
37 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
38 #include <libdrizzle/drizzle.h>
39 int foo= DRIZZLE_COLUMN_TYPE_DRIZZLE_VIRTUAL;
40 ]])],
41 [pandora_cv_libdrizzle_vcol=yes],
42 [pandora_cv_libdrizzle_vcol=no])])
43 AS_IF([test "$pandora_cv_libdrizzle_vcol" = "yes"],[
44 AC_MSG_ERROR([Your version of libdrizzle is too old. ${PACKAGE} requires at least version 0.4])
45 ])
46 ])