dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 1 | |
| 2 | #----------------------------------------------------------------------- |
| 3 | # Supports the following non-standard switches. |
| 4 | # |
| 5 | # --enable-threadsafe |
| 6 | # --enable-readline |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 7 | # --enable-editline |
| 8 | # --enable-static-shell |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 9 | # --enable-dynamic-extensions |
| 10 | # |
| 11 | |
| 12 | AC_PREREQ(2.61) |
dan | 991c5d6 | 2015-12-15 19:32:12 +0000 | [diff] [blame] | 13 | AC_INIT(sqlite, --SQLITE-VERSION--, http://www.sqlite.org) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 14 | AC_CONFIG_SRCDIR([sqlite3.c]) |
dan | 4544e28 | 2017-10-26 15:21:56 +0000 | [diff] [blame] | 15 | AC_CONFIG_AUX_DIR([.]) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 16 | |
| 17 | # Use automake. |
| 18 | AM_INIT_AUTOMAKE([foreign]) |
| 19 | |
| 20 | AC_SYS_LARGEFILE |
| 21 | |
| 22 | # Check for required programs. |
| 23 | AC_PROG_CC |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 24 | AC_PROG_LIBTOOL |
| 25 | AC_PROG_MKDIR_P |
| 26 | |
| 27 | # Check for library functions that SQLite can optionally use. |
| 28 | AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r]) |
| 29 | AC_FUNC_STRERROR_R |
| 30 | |
| 31 | AC_CONFIG_FILES([Makefile sqlite3.pc]) |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 32 | BUILD_CFLAGS= |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 33 | AC_SUBST(BUILD_CFLAGS) |
| 34 | |
dan | 00dae0a | 2016-05-28 15:09:35 +0000 | [diff] [blame] | 35 | #------------------------------------------------------------------------- |
| 36 | # Two options to enable readline compatible libraries: |
| 37 | # |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 38 | # --enable-editline |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 39 | # --enable-readline |
| 40 | # |
dan | 00dae0a | 2016-05-28 15:09:35 +0000 | [diff] [blame] | 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". |
| 46 | # |
| 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. |
| 50 | # |
| 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])]) |
| 53 | |
| 54 | AS_IF([ test x"$enable_editline" != xno ],[ |
| 55 | AC_CHECK_HEADERS([editline/readline.h],[ |
| 56 | sLIBS=$LIBS |
| 57 | LIBS="" |
| 58 | AC_SEARCH_LIBS([readline],[edit],[ |
| 59 | AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline) |
drh | db52852 | 2017-03-23 19:51:38 +0000 | [diff] [blame] | 60 | READLINE_LIBS="$LIBS -ltinfo" |
dan | 00dae0a | 2016-05-28 15:09:35 +0000 | [diff] [blame] | 61 | enable_readline=no |
drh | db52852 | 2017-03-23 19:51:38 +0000 | [diff] [blame] | 62 | ],[],[-ltinfo]) |
dan | 00dae0a | 2016-05-28 15:09:35 +0000 | [diff] [blame] | 63 | AS_UNSET(ac_cv_search_readline) |
| 64 | LIBS=$sLIBS |
| 65 | ]) |
| 66 | ]) |
| 67 | |
| 68 | AS_IF([ test x"$enable_readline" != xno ],[ |
| 69 | AC_CHECK_HEADERS([readline/readline.h],[ |
| 70 | sLIBS=$LIBS |
| 71 | LIBS="" |
| 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) |
| 75 | READLINE_LIBS=$LIBS |
| 76 | ]) |
| 77 | LIBS=$sLIBS |
| 78 | ]) |
| 79 | ]) |
| 80 | |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 81 | AC_SUBST(READLINE_LIBS) |
| 82 | #----------------------------------------------------------------------- |
| 83 | |
| 84 | #----------------------------------------------------------------------- |
| 85 | # --enable-threadsafe |
| 86 | # |
| 87 | AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( |
| 88 | [--enable-threadsafe], [build a thread-safe library [default=yes]])], |
| 89 | [], [enable_threadsafe=yes]) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 90 | if test x"$enable_threadsafe" != "xno"; then |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 91 | BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" |
drh | ba60fbb | 2016-01-28 02:47:32 +0000 | [diff] [blame] | 92 | AC_SEARCH_LIBS(pthread_create, pthread) |
drh | 13c808a | 2016-01-13 21:23:48 +0000 | [diff] [blame] | 93 | AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 94 | fi |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 95 | #----------------------------------------------------------------------- |
| 96 | |
| 97 | #----------------------------------------------------------------------- |
| 98 | # --enable-dynamic-extensions |
| 99 | # |
| 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) |
| 105 | else |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 106 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 107 | fi |
| 108 | AC_MSG_CHECKING([for whether to support dynamic extensions]) |
| 109 | AC_MSG_RESULT($enable_dynamic_extensions) |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 110 | #----------------------------------------------------------------------- |
| 111 | |
| 112 | #----------------------------------------------------------------------- |
| 113 | # --enable-fts4 |
| 114 | # |
| 115 | AC_ARG_ENABLE(fts4, [AS_HELP_STRING( |
| 116 | [--enable-fts4], [include fts4 support [default=yes]])], |
| 117 | [], [enable_fts4=yes]) |
| 118 | if test x"$enable_fts4" = "xyes"; then |
| 119 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" |
| 120 | fi |
| 121 | #----------------------------------------------------------------------- |
| 122 | |
| 123 | #----------------------------------------------------------------------- |
| 124 | # --enable-fts3 |
| 125 | # |
| 126 | AC_ARG_ENABLE(fts3, [AS_HELP_STRING( |
| 127 | [--enable-fts3], [include fts3 support [default=no]])], |
| 128 | [], []) |
| 129 | if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then |
| 130 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" |
| 131 | fi |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 132 | #----------------------------------------------------------------------- |
| 133 | |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 134 | #----------------------------------------------------------------------- |
| 135 | # --enable-fts5 |
| 136 | # |
| 137 | AC_ARG_ENABLE(fts5, [AS_HELP_STRING( |
drh | e632ae7 | 2018-05-04 04:49:55 +0000 | [diff] [blame] | 138 | [--enable-fts5], [include fts5 support [default=yes]])], |
| 139 | [], [enable_fts5=yes]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 140 | if test x"$enable_fts5" = "xyes"; then |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 141 | AC_SEARCH_LIBS(log, m) |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 142 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 143 | fi |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 144 | #----------------------------------------------------------------------- |
| 145 | |
| 146 | #----------------------------------------------------------------------- |
| 147 | # --enable-json1 |
| 148 | # |
| 149 | AC_ARG_ENABLE(json1, [AS_HELP_STRING( |
drh | e632ae7 | 2018-05-04 04:49:55 +0000 | [diff] [blame] | 150 | [--enable-json1], [include json1 support [default=yes]])], |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 151 | [],[enable_json1=yes]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 152 | if test x"$enable_json1" = "xyes"; then |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 153 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 154 | fi |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 155 | #----------------------------------------------------------------------- |
| 156 | |
| 157 | #----------------------------------------------------------------------- |
| 158 | # --enable-rtree |
| 159 | # |
| 160 | AC_ARG_ENABLE(rtree, [AS_HELP_STRING( |
| 161 | [--enable-rtree], [include rtree support [default=yes]])], |
| 162 | [], [enable_rtree=yes]) |
| 163 | if test x"$enable_rtree" = "xyes"; then |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 164 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 165 | fi |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 166 | #----------------------------------------------------------------------- |
| 167 | |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 168 | #----------------------------------------------------------------------- |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 169 | # --enable-session |
| 170 | # |
| 171 | AC_ARG_ENABLE(session, [AS_HELP_STRING( |
| 172 | [--enable-session], [enable the session extension [default=no]])], |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 173 | [], []) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 174 | if test x"$enable_session" = "xyes"; then |
mistachkin | 746127e | 2018-09-17 12:49:21 +0000 | [diff] [blame] | 175 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 176 | fi |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 177 | #----------------------------------------------------------------------- |
| 178 | |
| 179 | #----------------------------------------------------------------------- |
drh | e632ae7 | 2018-05-04 04:49:55 +0000 | [diff] [blame] | 180 | # --enable-debug |
| 181 | # |
| 182 | AC_ARG_ENABLE(debug, [AS_HELP_STRING( |
| 183 | [--enable-debug], [build with debugging features enabled [default=no]])], |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 184 | [], []) |
drh | e632ae7 | 2018-05-04 04:49:55 +0000 | [diff] [blame] | 185 | if test x"$enable_debug" = "xyes"; then |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 186 | BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" |
| 187 | CFLAGS="-g -O0" |
drh | e632ae7 | 2018-05-04 04:49:55 +0000 | [diff] [blame] | 188 | fi |
drh | e632ae7 | 2018-05-04 04:49:55 +0000 | [diff] [blame] | 189 | #----------------------------------------------------------------------- |
| 190 | |
| 191 | #----------------------------------------------------------------------- |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 192 | # --enable-static-shell |
| 193 | # |
| 194 | AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( |
| 195 | [--enable-static-shell], |
| 196 | [statically link libsqlite3 into shell tool [default=yes]])], |
| 197 | [], [enable_static_shell=yes]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 198 | if test x"$enable_static_shell" = "xyes"; then |
dan | e1f1ffa | 2016-03-11 15:25:13 +0000 | [diff] [blame] | 199 | EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 200 | else |
| 201 | EXTRA_SHELL_OBJ=libsqlite3.la |
| 202 | fi |
| 203 | AC_SUBST(EXTRA_SHELL_OBJ) |
| 204 | #----------------------------------------------------------------------- |
| 205 | |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 206 | AC_CHECK_FUNCS(posix_fallocate) |
dan | 5a7da86 | 2018-01-18 17:46:08 +0000 | [diff] [blame] | 207 | AC_CHECK_HEADERS(zlib.h,[ |
drh | dd2a8f5 | 2018-06-11 21:33:08 +0000 | [diff] [blame] | 208 | AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"]) |
dan | 5a7da86 | 2018-01-18 17:46:08 +0000 | [diff] [blame] | 209 | ]) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 210 | |
drh | 04a28c3 | 2018-01-31 01:38:44 +0000 | [diff] [blame] | 211 | AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"]) |
| 212 | AC_SUBST(SHELL_CFLAGS) |
| 213 | |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 214 | #----------------------------------------------------------------------- |
| 215 | # UPDATE: Maybe it's better if users just set CFLAGS before invoking |
| 216 | # configure. This option doesn't really add much... |
| 217 | # |
| 218 | # --enable-tempstore |
| 219 | # |
| 220 | # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( |
| 221 | # [--enable-tempstore], |
| 222 | # [in-memory temporary tables (never, no, yes, always) [default=no]])], |
| 223 | # [], [enable_tempstore=no]) |
| 224 | # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) |
| 225 | # case "$enable_tempstore" in |
| 226 | # never ) TEMP_STORE=0 ;; |
| 227 | # no ) TEMP_STORE=1 ;; |
| 228 | # always ) TEMP_STORE=3 ;; |
| 229 | # yes ) TEMP_STORE=3 ;; |
| 230 | # * ) |
| 231 | # TEMP_STORE=1 |
| 232 | # enable_tempstore=yes |
| 233 | # ;; |
| 234 | # esac |
| 235 | # AC_MSG_RESULT($enable_tempstore) |
| 236 | # AC_SUBST(TEMP_STORE) |
| 237 | #----------------------------------------------------------------------- |
| 238 | |
| 239 | AC_OUTPUT |