2 AC_INIT(rlm_sql_sqlite.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_sql_sqlite])
9 if test x$with_[]modname != xno; then
11 dnl ############################################################
12 dnl # Check for command line options
13 dnl ############################################################
15 dnl extra argument: --with-sqlite-include-dir=DIR
17 AC_ARG_WITH(sqlite-include-dir,
18 [AS_HELP_STRING([--with-sqlite-include-dir=DIR],
19 [Directory where the sqlite includes may be found])],
22 AC_MSG_ERROR(Need sqlite-include-dir)
27 sqlite_include_dir="$withval"
31 dnl extra argument: --with-sqlite-lib-dir=DIR
33 AC_ARG_WITH(sqlite-lib-dir,
34 [AS_HELP_STRING([--with-sqlite-lib-dir=DIR],
35 [Directory where the sqlite libraries may be found])],
38 AC_MSG_ERROR(Need sqlite-lib-dir)
43 sqlite_lib_dir="$withval"
47 dnl extra argument: --with-sqlite-dir=DIR
48 AC_ARG_WITH(sqlite-dir,
49 [AS_HELP_STRING([--with-sqlite-dir=DIR],
50 [Base directory where sqlite is installed])],
53 AC_MSG_ERROR(Need sqlite-dir)
58 sqlite_lib_dir="$withval/lib"
59 sqlite_include_dir="$withval/include"
63 dnl ############################################################
64 dnl # Check for programs
65 dnl ############################################################
69 dnl ############################################################
70 dnl # Check for libraries
71 dnl ############################################################
73 dnl try to link to libsqlite3
74 smart_try_dir="$sqlite_lib_dir"
75 FR_SMART_CHECK_LIB(sqlite3, sqlite3_open)
76 dnl # Ensure we use the library we just found the rest of the checks
78 if test "x$ac_cv_lib_sqlite3_sqlite3_open" != "xyes"
80 AC_MSG_WARN([Sqlite libraries not found. Use --with-sqlite-lib-dir=<path>.])
81 fail="$fail libsqlite3"
83 dnl # Add any v2 variants here
87 sqlite3_create_function_v2 \
89 sqlite3_extended_result_codes \
93 dnl ############################################################
94 dnl # Check for header files
95 dnl ############################################################
97 smart_try_dir="$sqlite_include_dir"
98 FR_SMART_CHECK_INCLUDE(sqlite3.h)
99 if test "x$ac_cv_header_sqlite3_h" != "xyes"; then
100 AC_MSG_WARN([Sqlite headers not found. Use --with-sqlite-include-dir=<path>.])
101 fail="$fail sqlite.h"
103 CFLAGS="$SMART_CPPFLAGS"
104 AC_CHECK_TYPES([sqlite3_int64], [], [], [[#include <sqlite3.h>]])
109 echo \*\*\* module modname is disabled.
112 dnl Don't change this section.
113 if test "x$fail" != x; then
114 if test "x${enable_strict_dependencies}" = xyes; then
115 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
117 AC_MSG_WARN([silently not building ]modname[.])
118 AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]);
123 mod_ldflags="$SMART_LIBS"
124 mod_cflags="$SMART_CFLAGS"
125 AC_SUBST(mod_ldflags)
128 AC_CONFIG_HEADER(config.h)