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])], |
| 44 | [], [enable_readline=no]) |
| 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 |
| 51 | AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline) |
| 52 | fi |
| 53 | LIBS=$sLIBS |
| 54 | fi |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 55 | if test x"$enable_readline" != xno ; then |
| 56 | sLIBS=$LIBS |
| 57 | LIBS="" |
| 58 | AC_SEARCH_LIBS(tgetent, curses ncurses ncursesw, [], []) |
| 59 | AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no]) |
| 60 | AC_CHECK_FUNCS(readline, [], []) |
| 61 | READLINE_LIBS=$LIBS |
| 62 | LIBS=$sLIBS |
| 63 | fi |
| 64 | AC_SUBST(READLINE_LIBS) |
| 65 | #----------------------------------------------------------------------- |
| 66 | |
| 67 | #----------------------------------------------------------------------- |
| 68 | # --enable-threadsafe |
| 69 | # |
| 70 | AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( |
| 71 | [--enable-threadsafe], [build a thread-safe library [default=yes]])], |
| 72 | [], [enable_threadsafe=yes]) |
| 73 | THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 |
| 74 | if test x"$enable_threadsafe" != "xno"; then |
| 75 | THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" |
| 76 | AC_SEARCH_LIBS(pthread_create, pthread) |
| 77 | fi |
| 78 | AC_SUBST(THREADSAFE_FLAGS) |
| 79 | #----------------------------------------------------------------------- |
| 80 | |
| 81 | #----------------------------------------------------------------------- |
| 82 | # --enable-dynamic-extensions |
| 83 | # |
| 84 | AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( |
| 85 | [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], |
| 86 | [], [enable_dynamic_extensions=yes]) |
| 87 | if test x"$enable_dynamic_extensions" != "xno"; then |
| 88 | AC_SEARCH_LIBS(dlopen, dl) |
| 89 | else |
| 90 | DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 |
| 91 | fi |
| 92 | AC_MSG_CHECKING([for whether to support dynamic extensions]) |
| 93 | AC_MSG_RESULT($enable_dynamic_extensions) |
| 94 | AC_SUBST(DYNAMIC_EXTENSION_FLAGS) |
| 95 | #----------------------------------------------------------------------- |
| 96 | |
dan | 2572751 | 2015-10-09 14:37:15 +0000 | [diff] [blame] | 97 | #----------------------------------------------------------------------- |
| 98 | # --enable-fts5 |
| 99 | # |
| 100 | AC_ARG_ENABLE(fts5, [AS_HELP_STRING( |
| 101 | [--enable-fts5], [include fts5 support [default=no]])], |
| 102 | [], [enable_fts5=no]) |
| 103 | if test x"$enable_fts5" == "xyes"; then |
| 104 | AC_SEARCH_LIBS(log, m) |
| 105 | FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 |
| 106 | fi |
| 107 | AC_SUBST(FTS5_FLAGS) |
| 108 | #----------------------------------------------------------------------- |
| 109 | |
| 110 | #----------------------------------------------------------------------- |
| 111 | # --enable-json1 |
| 112 | # |
| 113 | AC_ARG_ENABLE(json1, [AS_HELP_STRING( |
| 114 | [--enable-json1], [include json1 support [default=no]])], |
| 115 | [], [enable_json1=no]) |
| 116 | if test x"$enable_json1" == "xyes"; then |
| 117 | JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 |
| 118 | fi |
| 119 | AC_SUBST(JSON1_FLAGS) |
| 120 | #----------------------------------------------------------------------- |
| 121 | |
dan | ce6cbf9 | 2015-11-13 16:59:00 +0000 | [diff] [blame] | 122 | #----------------------------------------------------------------------- |
| 123 | # --enable-static-shell |
| 124 | # |
| 125 | AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( |
| 126 | [--enable-static-shell], |
| 127 | [statically link libsqlite3 into shell tool [default=yes]])], |
| 128 | [], [enable_static_shell=yes]) |
| 129 | if test x"$enable_static_shell" == "xyes"; then |
| 130 | EXTRA_SHELL_OBJ=sqlite3.$OBJEXT |
| 131 | else |
| 132 | EXTRA_SHELL_OBJ=libsqlite3.la |
| 133 | fi |
| 134 | AC_SUBST(EXTRA_SHELL_OBJ) |
| 135 | #----------------------------------------------------------------------- |
| 136 | |
dan | f6f8ac6 | 2013-05-27 17:19:58 +0000 | [diff] [blame] | 137 | AC_CHECK_FUNCS(posix_fallocate) |
| 138 | |
| 139 | #----------------------------------------------------------------------- |
| 140 | # UPDATE: Maybe it's better if users just set CFLAGS before invoking |
| 141 | # configure. This option doesn't really add much... |
| 142 | # |
| 143 | # --enable-tempstore |
| 144 | # |
| 145 | # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( |
| 146 | # [--enable-tempstore], |
| 147 | # [in-memory temporary tables (never, no, yes, always) [default=no]])], |
| 148 | # [], [enable_tempstore=no]) |
| 149 | # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) |
| 150 | # case "$enable_tempstore" in |
| 151 | # never ) TEMP_STORE=0 ;; |
| 152 | # no ) TEMP_STORE=1 ;; |
| 153 | # always ) TEMP_STORE=3 ;; |
| 154 | # yes ) TEMP_STORE=3 ;; |
| 155 | # * ) |
| 156 | # TEMP_STORE=1 |
| 157 | # enable_tempstore=yes |
| 158 | # ;; |
| 159 | # esac |
| 160 | # AC_MSG_RESULT($enable_tempstore) |
| 161 | # AC_SUBST(TEMP_STORE) |
| 162 | #----------------------------------------------------------------------- |
| 163 | |
| 164 | AC_OUTPUT |