Merge from Trond
[m6w6/libmemcached] / m4 / pandora_have_libsqlite3.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_LIBSQLITE3],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libsqlite3
11 dnl --------------------------------------------------------------------
12
13 AC_ARG_ENABLE([libsqlite3],
14 [AS_HELP_STRING([--disable-libsqlite3],
15 [Build with libsqlite3 support @<:@default=on@:>@])],
16 [ac_enable_libsqlite3="$enableval"],
17 [ac_enable_libsqlite3="yes"])
18
19 AS_IF([test "x$ac_enable_libsqlite3" = "xyes"],[
20 AC_LIB_HAVE_LINKFLAGS(sqlite3,,[
21 #include <stdio.h>
22 #include <sqlite3.h>
23 ],[
24 sqlite3 *db;
25 sqlite3_open(NULL, &db);
26 ])
27 ],[
28 ac_cv_libsqlite3="no"
29 ])
30
31 AM_CONDITIONAL(HAVE_LIBSQLITE3, [test "x${ac_cv_libsqlite3}" = "xyes"])
32 ])
33
34 AC_DEFUN([PANDORA_HAVE_LIBSQLITE3],[
35 AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
36 ])
37
38 AC_DEFUN([PANDORA_REQUIRE_LIBSQLITE3],[
39 AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
40 AS_IF([test "x${ac_cv_libsqlite3}" = "xno"],
41 AC_MSG_ERROR([libsqlite3 is required for ${PACKAGE}]))
42 ])