2 #-----------------------------------------------------------------------
3 # Supports the following non-standard switches.
8 # --enable-static-shell
9 # --enable-dynamic-extensions
13 AC_INIT(sqlite, --SQLITE-VERSION--, http://www.sqlite.org)
14 AC_CONFIG_SRCDIR([sqlite3.c])
15 AC_CONFIG_AUX_DIR([.])
18 AM_INIT_AUTOMAKE([foreign])
22 # Check for required programs.
27 # Check for library functions that SQLite can optionally use.
28 AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
31 AC_CONFIG_FILES([Makefile sqlite3.pc])
33 AC_SUBST(BUILD_CFLAGS)
35 #-------------------------------------------------------------------------
36 # Two options to enable readline compatible libraries:
41 # Both are enabled by default. If, after command line processing both are
42 # still enabled, the script searches for editline first and automatically
43 # disables readline if it is found. So, to use readline explicitly, the
44 # user must pass "--disable-editline". To disable command line editing
45 # support altogether, "--disable-editline --disable-readline".
47 # When searching for either library, check for headers before libraries
48 # as some distros supply packages that contain libraries but not header
49 # files, which come as a separate development package.
51 AC_ARG_ENABLE(editline, [AS_HELP_STRING([--enable-editline],[use BSD libedit])])
52 AC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline],[use readline])])
54 AS_IF([ test x"$enable_editline" != xno ],[
55 AC_CHECK_HEADERS([editline/readline.h],[
58 AC_SEARCH_LIBS([readline],[edit],[
59 AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
60 READLINE_LIBS="$LIBS -ltinfo"
63 AS_UNSET(ac_cv_search_readline)
68 AS_IF([ test x"$enable_readline" != xno ],[
69 AC_CHECK_HEADERS([readline/readline.h],[
72 AC_SEARCH_LIBS(tgetent, termcap curses ncurses ncursesw, [], [])
73 AC_SEARCH_LIBS(readline,[readline edit], [
74 AC_DEFINE([HAVE_READLINE],1,Define to use readline or wrapper)
81 AC_SUBST(READLINE_LIBS)
82 #-----------------------------------------------------------------------
84 #-----------------------------------------------------------------------
87 AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
88 [--enable-threadsafe], [build a thread-safe library [default=yes]])],
89 [], [enable_threadsafe=yes])
90 if test x"$enable_threadsafe" == "xno"; then
91 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0"
93 BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
94 AC_SEARCH_LIBS(pthread_create, pthread)
95 AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
97 #-----------------------------------------------------------------------
99 #-----------------------------------------------------------------------
100 # --enable-dynamic-extensions
102 AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
103 [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
104 [], [enable_dynamic_extensions=yes])
105 if test x"$enable_dynamic_extensions" != "xno"; then
106 AC_SEARCH_LIBS(dlopen, dl)
108 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1"
110 AC_MSG_CHECKING([for whether to support dynamic extensions])
111 AC_MSG_RESULT($enable_dynamic_extensions)
112 #-----------------------------------------------------------------------
114 #-----------------------------------------------------------------------
117 AC_ARG_ENABLE(math, [AS_HELP_STRING(
118 [--enable-math], [SQL math functions [default=yes]])],
119 [], [enable_math=yes])
120 AC_MSG_CHECKING([SQL math functions])
121 if test x"$enable_math" = "xyes"; then
122 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS"
123 AC_MSG_RESULT([enabled])
124 AC_SEARCH_LIBS(ceil, m)
126 AC_MSG_RESULT([disabled])
128 #-----------------------------------------------------------------------
130 #-----------------------------------------------------------------------
133 AC_ARG_ENABLE(fts4, [AS_HELP_STRING(
134 [--enable-fts4], [include fts4 support [default=yes]])],
135 [], [enable_fts4=yes])
136 AC_MSG_CHECKING([FTS4 extension])
137 if test x"$enable_fts4" = "xyes"; then
138 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4"
139 AC_MSG_RESULT([enabled])
141 AC_MSG_RESULT([disabled])
143 #-----------------------------------------------------------------------
145 #-----------------------------------------------------------------------
148 AC_ARG_ENABLE(fts3, [AS_HELP_STRING(
149 [--enable-fts3], [include fts3 support [default=no]])],
151 AC_MSG_CHECKING([FTS3 extension])
152 if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then
153 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3"
154 AC_MSG_RESULT([enabled])
156 AC_MSG_RESULT([disabled])
158 #-----------------------------------------------------------------------
160 #-----------------------------------------------------------------------
163 AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
164 [--enable-fts5], [include fts5 support [default=yes]])],
165 [], [enable_fts5=yes])
166 AC_MSG_CHECKING([FTS5 extension])
167 if test x"$enable_fts5" = "xyes"; then
168 AC_MSG_RESULT([enabled])
169 AC_SEARCH_LIBS(log, m)
170 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5"
172 AC_MSG_RESULT([disabled])
174 #-----------------------------------------------------------------------
176 #-----------------------------------------------------------------------
179 AC_ARG_ENABLE(rtree, [AS_HELP_STRING(
180 [--enable-rtree], [include rtree support [default=yes]])],
181 [], [enable_rtree=yes])
182 AC_MSG_CHECKING([RTREE extension])
183 if test x"$enable_rtree" = "xyes"; then
184 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY"
185 AC_MSG_RESULT([enabled])
187 AC_MSG_RESULT([disabled])
189 #-----------------------------------------------------------------------
191 #-----------------------------------------------------------------------
194 AC_ARG_ENABLE(session, [AS_HELP_STRING(
195 [--enable-session], [enable the session extension [default=no]])],
197 AC_MSG_CHECKING([Session extension])
198 if test x"$enable_session" = "xyes"; then
199 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
200 AC_MSG_RESULT([enabled])
202 AC_MSG_RESULT([disabled])
204 #-----------------------------------------------------------------------
206 #-----------------------------------------------------------------------
209 AC_ARG_ENABLE(debug, [AS_HELP_STRING(
210 [--enable-debug], [build with debugging features enabled [default=no]])],
212 AC_MSG_CHECKING([Build type])
213 if test x"$enable_debug" = "xyes"; then
214 BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE"
216 AC_MSG_RESULT([debug])
218 AC_MSG_RESULT([release])
220 #-----------------------------------------------------------------------
222 #-----------------------------------------------------------------------
223 # --enable-static-shell
225 AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
226 [--enable-static-shell],
227 [statically link libsqlite3 into shell tool [default=yes]])],
228 [], [enable_static_shell=yes])
229 if test x"$enable_static_shell" = "xyes"; then
230 EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
232 EXTRA_SHELL_OBJ=libsqlite3.la
234 AC_SUBST(EXTRA_SHELL_OBJ)
235 #-----------------------------------------------------------------------
237 AC_CHECK_FUNCS(posix_fallocate)
238 AC_CHECK_HEADERS(zlib.h,[
239 AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"])
242 AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"])
243 AC_SUBST(SHELL_CFLAGS)
245 #-----------------------------------------------------------------------
246 # UPDATE: Maybe it's better if users just set CFLAGS before invoking
247 # configure. This option doesn't really add much...
251 # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
252 # [--enable-tempstore],
253 # [in-memory temporary tables (never, no, yes, always) [default=no]])],
254 # [], [enable_tempstore=no])
255 # AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
256 # case "$enable_tempstore" in
257 # never ) TEMP_STORE=0 ;;
258 # no ) TEMP_STORE=1 ;;
259 # always ) TEMP_STORE=3 ;;
260 # yes ) TEMP_STORE=3 ;;
263 # enable_tempstore=yes
266 # AC_MSG_RESULT($enable_tempstore)
267 # AC_SUBST(TEMP_STORE)
268 #-----------------------------------------------------------------------