1 | ########################################################
|
---|
2 | # Compile with SQLITE3 support?
|
---|
3 |
|
---|
4 | SQLITE3_LIBS=""
|
---|
5 | with_sqlite3_support=no
|
---|
6 | AC_MSG_CHECKING([for SQLITE3 support])
|
---|
7 |
|
---|
8 | AC_ARG_WITH(sqlite3,
|
---|
9 | AS_HELP_STRING([--with-sqlite3],[SQLITE3 backend support (default=no)]),
|
---|
10 | [ case "$withval" in
|
---|
11 | yes|no|auto)
|
---|
12 | with_sqlite3_support=$withval
|
---|
13 | ;;
|
---|
14 | esac ])
|
---|
15 |
|
---|
16 | AC_MSG_RESULT($with_sqlite3_support)
|
---|
17 |
|
---|
18 | if test x"$with_sqlite3_support" != x"no"; then
|
---|
19 | ##################################################################
|
---|
20 | # first test for sqlite3.h
|
---|
21 | AC_CHECK_HEADERS(sqlite3.h)
|
---|
22 |
|
---|
23 | if test x"$ac_cv_header_sqlite3_h" != x"yes"; then
|
---|
24 | if test x"$with_sqlite3_support" = x"yes"; then
|
---|
25 | AC_MSG_ERROR(sqlite3.h is needed for SQLITE3 support)
|
---|
26 | else
|
---|
27 | AC_MSG_WARN(sqlite3.h is needed for SQLITE3 support)
|
---|
28 | fi
|
---|
29 |
|
---|
30 | with_sqlite3_support=no
|
---|
31 | fi
|
---|
32 | fi
|
---|
33 |
|
---|
34 | if test x"$with_sqlite3_support" != x"no"; then
|
---|
35 | ac_save_LIBS=$LIBS
|
---|
36 |
|
---|
37 | ########################################################
|
---|
38 | # now see if we can find the sqlite3 libs in standard paths
|
---|
39 | AC_CHECK_LIB_EXT(sqlite3, SQLITE3_LIBS, sqlite3_open)
|
---|
40 |
|
---|
41 | if test x"$ac_cv_lib_ext_sqlite3_sqlite3_open" = x"yes"; then
|
---|
42 | AC_DEFINE(HAVE_SQLITE3,1,[Whether sqlite3 is available])
|
---|
43 | AC_DEFINE(HAVE_LDB_SQLITE3,1,[Whether ldb_sqlite3 is available])
|
---|
44 | AC_MSG_CHECKING(whether SQLITE3 support is used)
|
---|
45 | AC_MSG_RESULT(yes)
|
---|
46 | with_sqlite3_support=yes
|
---|
47 | SMB_ENABLE(SQLITE3,YES)
|
---|
48 | else
|
---|
49 | if test x"$with_sqlite3_support" = x"yes"; then
|
---|
50 | AC_MSG_ERROR(libsqlite3 is needed for SQLITE3 support)
|
---|
51 | else
|
---|
52 | AC_MSG_WARN(libsqlite3 is needed for SQLITE3 support)
|
---|
53 | fi
|
---|
54 |
|
---|
55 | SQLITE3_LIBS=""
|
---|
56 | with_sqlite3_support=no
|
---|
57 | fi
|
---|
58 |
|
---|
59 | LIBS=$ac_save_LIBS;
|
---|
60 | fi
|
---|
61 |
|
---|
62 | SMB_EXT_LIB(SQLITE3,[${SQLITE3_LIBS}],[${SQLITE3_CFLAGS}],[${SQLITE3_CPPFLAGS}],[${SQLITE3_LDFLAGS}])
|
---|