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]) |
| 15 | |
| 16 | # Use automake. |
| 17 | AM_INIT_AUTOMAKE([foreign]) |
| 18 | |
| 19 | AC_SYS_LARGEFILE |
| 20 | |
| 21 | # Check for required programs. |
| 22 | AC_PROG_CC |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 23 | AC_PROG_LIBTOOL |
| 24 | AC_PROG_MKDIR_P |
| 25 | |
| 26 | # Check for library functions that SQLite can optionally use. |
| 27 | AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r]) |
| 28 | AC_FUNC_STRERROR_R |
| 29 | |
| 30 | AC_CONFIG_FILES([Makefile sqlite3.pc]) |
| 31 | AC_SUBST(BUILD_CFLAGS) |
| 32 | |
| 33 | #----------------------------------------------------------------------- |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 34 | # --enable-editline |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 35 | # --enable-readline |
| 36 | # |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 37 | AC_ARG_ENABLE(editline, [AS_HELP_STRING( |
| 38 | [--enable-editline], |
| 39 | [use BSD libedit])], |
| 40 | [], [enable_editline=yes]) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 41 | AC_ARG_ENABLE(readline, [AS_HELP_STRING( |
| 42 | [--enable-readline], |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 43 | [use readline])], |
drh | 17e0c47 | 2016-05-20 12:22:16 +0000 | [diff] [blame] | 44 | [], [enable_readline=yes]) |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 45 | if test x"$enable_editline" != xno ; then |
| 46 | sLIBS=$LIBS |
| 47 | LIBS="" |
| 48 | AC_SEARCH_LIBS([readline],[edit],[enable_readline=no],[enable_editline=no]) |
| 49 | READLINE_LIBS=$LIBS |
| 50 | if test x"$LIBS" != "x"; then |
drh | 17e0c47 | 2016-05-20 12:22:16 +0000 | [diff] [blame] | 51 | AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline) |
| 52 | enable_readline=no |
dan | 30908c9 | 2016-01-20 15:19:56 +0000 | [diff] [blame] | 53 | else |
| 54 | unset ac_cv_search_readline |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 55 | fi |
| 56 | LIBS=$sLIBS |
| 57 | fi |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 58 | if test x"$enable_readline" != xno ; then |
| 59 | sLIBS=$LIBS |
| 60 | LIBS="" |
| 61 | AC_SEARCH_LIBS(tgetent, curses ncurses ncursesw, [], []) |
| 62 | AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no]) |
| 63 | AC_CHECK_FUNCS(readline, [], []) |
| 64 | READLINE_LIBS=$LIBS |
| 65 | LIBS=$sLIBS |
| 66 | fi |
| 67 | AC_SUBST(READLINE_LIBS) |
| 68 | #----------------------------------------------------------------------- |
| 69 | |
| 70 | #----------------------------------------------------------------------- |
| 71 | # --enable-threadsafe |
| 72 | # |
| 73 | AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( |
| 74 | [--enable-threadsafe], [build a thread-safe library [default=yes]])], |
| 75 | [], [enable_threadsafe=yes]) |
| 76 | THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 |
| 77 | if test x"$enable_threadsafe" != "xno"; then |
| 78 | THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" |
drh | ba60fbb | 2016-01-28 02:47:32 +0000 | [diff] [blame] | 79 | AC_SEARCH_LIBS(pthread_create, pthread) |
drh | 13c808a | 2016-01-13 21:23:48 +0000 | [diff] [blame] | 80 | AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 81 | fi |
| 82 | AC_SUBST(THREADSAFE_FLAGS) |
| 83 | #----------------------------------------------------------------------- |
| 84 | |
| 85 | #----------------------------------------------------------------------- |
| 86 | # --enable-dynamic-extensions |
| 87 | # |
| 88 | AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( |
| 89 | [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], |
| 90 | [], [enable_dynamic_extensions=yes]) |
| 91 | if test x"$enable_dynamic_extensions" != "xno"; then |
| 92 | AC_SEARCH_LIBS(dlopen, dl) |
| 93 | else |
| 94 | DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 |
| 95 | fi |
| 96 | AC_MSG_CHECKING([for whether to support dynamic extensions]) |
| 97 | AC_MSG_RESULT($enable_dynamic_extensions) |
| 98 | AC_SUBST(DYNAMIC_EXTENSION_FLAGS) |
| 99 | #----------------------------------------------------------------------- |
| 100 | |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 101 | #----------------------------------------------------------------------- |
| 102 | # --enable-fts5 |
| 103 | # |
| 104 | AC_ARG_ENABLE(fts5, [AS_HELP_STRING( |
| 105 | [--enable-fts5], [include fts5 support [default=no]])], |
| 106 | [], [enable_fts5=no]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 107 | if test x"$enable_fts5" = "xyes"; then |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 108 | AC_SEARCH_LIBS(log, m) |
| 109 | FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 |
| 110 | fi |
| 111 | AC_SUBST(FTS5_FLAGS) |
| 112 | #----------------------------------------------------------------------- |
| 113 | |
| 114 | #----------------------------------------------------------------------- |
| 115 | # --enable-json1 |
| 116 | # |
| 117 | AC_ARG_ENABLE(json1, [AS_HELP_STRING( |
| 118 | [--enable-json1], [include json1 support [default=no]])], |
| 119 | [], [enable_json1=no]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 120 | if test x"$enable_json1" = "xyes"; then |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 121 | JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 |
| 122 | fi |
| 123 | AC_SUBST(JSON1_FLAGS) |
| 124 | #----------------------------------------------------------------------- |
| 125 | |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 126 | #----------------------------------------------------------------------- |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 127 | # --enable-session |
| 128 | # |
| 129 | AC_ARG_ENABLE(session, [AS_HELP_STRING( |
| 130 | [--enable-session], [enable the session extension [default=no]])], |
| 131 | [], [enable_session=no]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 132 | if test x"$enable_session" = "xyes"; then |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 133 | SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" |
| 134 | fi |
| 135 | AC_SUBST(SESSION_FLAGS) |
| 136 | #----------------------------------------------------------------------- |
| 137 | |
| 138 | #----------------------------------------------------------------------- |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 139 | # --enable-static-shell |
| 140 | # |
| 141 | AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( |
| 142 | [--enable-static-shell], |
| 143 | [statically link libsqlite3 into shell tool [default=yes]])], |
| 144 | [], [enable_static_shell=yes]) |
drh | 582c080 | 2016-05-04 14:20:15 +0000 | [diff] [blame] | 145 | if test x"$enable_static_shell" = "xyes"; then |
dan | e1f1ffa | 2016-03-11 15:25:13 +0000 | [diff] [blame] | 146 | EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 147 | else |
| 148 | EXTRA_SHELL_OBJ=libsqlite3.la |
| 149 | fi |
| 150 | AC_SUBST(EXTRA_SHELL_OBJ) |
| 151 | #----------------------------------------------------------------------- |
| 152 | |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 153 | AC_CHECK_FUNCS(posix_fallocate) |
| 154 | |
| 155 | #----------------------------------------------------------------------- |
| 156 | # UPDATE: Maybe it's better if users just set CFLAGS before invoking |
| 157 | # configure. This option doesn't really add much... |
| 158 | # |
| 159 | # --enable-tempstore |
| 160 | # |
| 161 | # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( |
| 162 | # [--enable-tempstore], |
| 163 | # [in-memory temporary tables (never, no, yes, always) [default=no]])], |
| 164 | # [], [enable_tempstore=no]) |
| 165 | # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) |
| 166 | # case "$enable_tempstore" in |
| 167 | # never ) TEMP_STORE=0 ;; |
| 168 | # no ) TEMP_STORE=1 ;; |
| 169 | # always ) TEMP_STORE=3 ;; |
| 170 | # yes ) TEMP_STORE=3 ;; |
| 171 | # * ) |
| 172 | # TEMP_STORE=1 |
| 173 | # enable_tempstore=yes |
| 174 | # ;; |
| 175 | # esac |
| 176 | # AC_MSG_RESULT($enable_tempstore) |
| 177 | # AC_SUBST(TEMP_STORE) |
| 178 | #----------------------------------------------------------------------- |
| 179 | |
| 180 | AC_OUTPUT |