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])
17 AM_INIT_AUTOMAKE([foreign])
21 # Check for required programs.
26 # Check for library functions that SQLite can optionally use.
27 AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
30 AC_CONFIG_FILES([Makefile sqlite3.pc])
31 AC_SUBST(BUILD_CFLAGS)
33 #-------------------------------------------------------------------------
34 # Two options to enable readline compatible libraries:
39 # Both are enabled by default. If, after command line processing both are
40 # still enabled, the script searches for editline first and automatically
41 # disables readline if it is found. So, to use readline explicitly, the
42 # user must pass "--disable-editline". To disable command line editing
43 # support altogether, "--disable-editline --disable-readline".
45 # When searching for either library, check for headers before libraries
46 # as some distros supply packages that contain libraries but not header
47 # files, which come as a separate development package.
49 AC_ARG_ENABLE(editline, [AS_HELP_STRING([--enable-editline],[use BSD libedit])])
50 AC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline],[use readline])])
52 AS_IF([ test x"$enable_editline" != xno ],[
53 AC_CHECK_HEADERS([editline/readline.h],[
56 AC_SEARCH_LIBS([readline],[edit],[
57 AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
58 READLINE_LIBS="$LIBS -ltinfo"
61 AS_UNSET(ac_cv_search_readline)
66 AS_IF([ test x"$enable_readline" != xno ],[
67 AC_CHECK_HEADERS([readline/readline.h],[
70 AC_SEARCH_LIBS(tgetent, termcap curses ncurses ncursesw, [], [])
71 AC_SEARCH_LIBS(readline,[readline edit], [
72 AC_DEFINE([HAVE_READLINE],1,Define to use readline or wrapper)
79 AC_SUBST(READLINE_LIBS)
80 #-----------------------------------------------------------------------
82 #-----------------------------------------------------------------------
85 AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
86 [--enable-threadsafe], [build a thread-safe library [default=yes]])],
87 [], [enable_threadsafe=yes])
88 THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
89 if test x"$enable_threadsafe" != "xno"; then
90 THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
91 AC_SEARCH_LIBS(pthread_create, pthread)
92 AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
94 AC_SUBST(THREADSAFE_FLAGS)
95 #-----------------------------------------------------------------------
97 #-----------------------------------------------------------------------
98 # --enable-dynamic-extensions
100 AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
101 [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
102 [], [enable_dynamic_extensions=yes])
103 if test x"$enable_dynamic_extensions" != "xno"; then
104 AC_SEARCH_LIBS(dlopen, dl)
106 DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
108 AC_MSG_CHECKING([for whether to support dynamic extensions])
109 AC_MSG_RESULT($enable_dynamic_extensions)
110 AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
111 #-----------------------------------------------------------------------
113 #-----------------------------------------------------------------------
116 AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
117 [--enable-fts5], [include fts5 support [default=no]])],
118 [], [enable_fts5=no])
119 if test x"$enable_fts5" = "xyes"; then
120 AC_SEARCH_LIBS(log, m)
121 FTS5_FLAGS=-DSQLITE_ENABLE_FTS5
124 #-----------------------------------------------------------------------
126 #-----------------------------------------------------------------------
129 AC_ARG_ENABLE(json1, [AS_HELP_STRING(
130 [--enable-json1], [include json1 support [default=no]])],
131 [], [enable_json1=no])
132 if test x"$enable_json1" = "xyes"; then
133 JSON1_FLAGS=-DSQLITE_ENABLE_JSON1
135 AC_SUBST(JSON1_FLAGS)
136 #-----------------------------------------------------------------------
138 #-----------------------------------------------------------------------
141 AC_ARG_ENABLE(session, [AS_HELP_STRING(
142 [--enable-session], [enable the session extension [default=no]])],
143 [], [enable_session=no])
144 if test x"$enable_session" = "xyes"; then
145 SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
147 AC_SUBST(SESSION_FLAGS)
148 #-----------------------------------------------------------------------
150 #-----------------------------------------------------------------------
151 # --enable-static-shell
153 AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
154 [--enable-static-shell],
155 [statically link libsqlite3 into shell tool [default=yes]])],
156 [], [enable_static_shell=yes])
157 if test x"$enable_static_shell" = "xyes"; then
158 EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
160 EXTRA_SHELL_OBJ=libsqlite3.la
162 AC_SUBST(EXTRA_SHELL_OBJ)
163 #-----------------------------------------------------------------------
165 AC_CHECK_FUNCS(posix_fallocate)
167 #-----------------------------------------------------------------------
168 # UPDATE: Maybe it's better if users just set CFLAGS before invoking
169 # configure. This option doesn't really add much...
173 # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
174 # [--enable-tempstore],
175 # [in-memory temporary tables (never, no, yes, always) [default=no]])],
176 # [], [enable_tempstore=no])
177 # AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
178 # case "$enable_tempstore" in
179 # never ) TEMP_STORE=0 ;;
180 # no ) TEMP_STORE=1 ;;
181 # always ) TEMP_STORE=3 ;;
182 # yes ) TEMP_STORE=3 ;;
185 # enable_tempstore=yes
188 # AC_MSG_RESULT($enable_tempstore)
189 # AC_SUBST(TEMP_STORE)
190 #-----------------------------------------------------------------------