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])
32 AC_SUBST(BUILD_CFLAGS)
34 #-------------------------------------------------------------------------
35 # Two options to enable readline compatible libraries:
40 # Both are enabled by default. If, after command line processing both are
41 # still enabled, the script searches for editline first and automatically
42 # disables readline if it is found. So, to use readline explicitly, the
43 # user must pass "--disable-editline". To disable command line editing
44 # support altogether, "--disable-editline --disable-readline".
46 # When searching for either library, check for headers before libraries
47 # as some distros supply packages that contain libraries but not header
48 # files, which come as a separate development package.
50 AC_ARG_ENABLE(editline, [AS_HELP_STRING([--enable-editline],[use BSD libedit])])
51 AC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline],[use readline])])
53 AS_IF([ test x"$enable_editline" != xno ],[
54 AC_CHECK_HEADERS([editline/readline.h],[
57 AC_SEARCH_LIBS([readline],[edit],[
58 AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
59 READLINE_LIBS="$LIBS -ltinfo"
62 AS_UNSET(ac_cv_search_readline)
67 AS_IF([ test x"$enable_readline" != xno ],[
68 AC_CHECK_HEADERS([readline/readline.h],[
71 AC_SEARCH_LIBS(tgetent, termcap curses ncurses ncursesw, [], [])
72 AC_SEARCH_LIBS(readline,[readline edit], [
73 AC_DEFINE([HAVE_READLINE],1,Define to use readline or wrapper)
80 AC_SUBST(READLINE_LIBS)
81 #-----------------------------------------------------------------------
83 #-----------------------------------------------------------------------
86 AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
87 [--enable-threadsafe], [build a thread-safe library [default=yes]])],
88 [], [enable_threadsafe=yes])
89 THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
90 if test x"$enable_threadsafe" != "xno"; then
91 THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
92 AC_SEARCH_LIBS(pthread_create, pthread)
93 AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
95 AC_SUBST(THREADSAFE_FLAGS)
96 #-----------------------------------------------------------------------
98 #-----------------------------------------------------------------------
99 # --enable-dynamic-extensions
101 AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
102 [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
103 [], [enable_dynamic_extensions=yes])
104 if test x"$enable_dynamic_extensions" != "xno"; then
105 AC_SEARCH_LIBS(dlopen, dl)
107 DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
109 AC_MSG_CHECKING([for whether to support dynamic extensions])
110 AC_MSG_RESULT($enable_dynamic_extensions)
111 AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
112 #-----------------------------------------------------------------------
114 #-----------------------------------------------------------------------
117 AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
118 [--enable-fts5], [include fts5 support [default=no]])],
119 [], [enable_fts5=no])
120 if test x"$enable_fts5" = "xyes"; then
121 AC_SEARCH_LIBS(log, m)
122 FTS5_FLAGS=-DSQLITE_ENABLE_FTS5
125 #-----------------------------------------------------------------------
127 #-----------------------------------------------------------------------
130 AC_ARG_ENABLE(json1, [AS_HELP_STRING(
131 [--enable-json1], [include json1 support [default=no]])],
132 [], [enable_json1=no])
133 if test x"$enable_json1" = "xyes"; then
134 JSON1_FLAGS=-DSQLITE_ENABLE_JSON1
136 AC_SUBST(JSON1_FLAGS)
137 #-----------------------------------------------------------------------
139 #-----------------------------------------------------------------------
142 AC_ARG_ENABLE(session, [AS_HELP_STRING(
143 [--enable-session], [enable the session extension [default=no]])],
144 [], [enable_session=no])
145 if test x"$enable_session" = "xyes"; then
146 SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
148 AC_SUBST(SESSION_FLAGS)
149 #-----------------------------------------------------------------------
151 #-----------------------------------------------------------------------
152 # --enable-static-shell
154 AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
155 [--enable-static-shell],
156 [statically link libsqlite3 into shell tool [default=yes]])],
157 [], [enable_static_shell=yes])
158 if test x"$enable_static_shell" = "xyes"; then
159 EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
161 EXTRA_SHELL_OBJ=libsqlite3.la
163 AC_SUBST(EXTRA_SHELL_OBJ)
164 #-----------------------------------------------------------------------
166 AC_CHECK_FUNCS(posix_fallocate)
168 #-----------------------------------------------------------------------
169 # UPDATE: Maybe it's better if users just set CFLAGS before invoking
170 # configure. This option doesn't really add much...
174 # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
175 # [--enable-tempstore],
176 # [in-memory temporary tables (never, no, yes, always) [default=no]])],
177 # [], [enable_tempstore=no])
178 # AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
179 # case "$enable_tempstore" in
180 # never ) TEMP_STORE=0 ;;
181 # no ) TEMP_STORE=1 ;;
182 # always ) TEMP_STORE=3 ;;
183 # yes ) TEMP_STORE=3 ;;
186 # enable_tempstore=yes
189 # AC_MSG_RESULT($enable_tempstore)
190 # AC_SUBST(TEMP_STORE)
191 #-----------------------------------------------------------------------