OLD | NEW |
(Empty) | |
| 1 |
| 2 #----------------------------------------------------------------------- |
| 3 # Supports the following non-standard switches. |
| 4 # |
| 5 # --enable-threadsafe |
| 6 # --enable-readline |
| 7 # --enable-editline |
| 8 # --enable-static-shell |
| 9 # --enable-dynamic-extensions |
| 10 # |
| 11 |
| 12 AC_PREREQ(2.61) |
| 13 AC_INIT(sqlite, --SQLITE-VERSION--, http://www.sqlite.org) |
| 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 |
| 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 #------------------------------------------------------------------------- |
| 34 # Two options to enable readline compatible libraries: |
| 35 # |
| 36 # --enable-editline |
| 37 # --enable-readline |
| 38 # |
| 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". |
| 44 # |
| 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. |
| 48 # |
| 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])]) |
| 51 |
| 52 AS_IF([ test x"$enable_editline" != xno ],[ |
| 53 AC_CHECK_HEADERS([editline/readline.h],[ |
| 54 sLIBS=$LIBS |
| 55 LIBS="" |
| 56 AC_SEARCH_LIBS([readline],[edit],[ |
| 57 AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline) |
| 58 READLINE_LIBS=$LIBS |
| 59 enable_readline=no |
| 60 ]) |
| 61 AS_UNSET(ac_cv_search_readline) |
| 62 LIBS=$sLIBS |
| 63 ]) |
| 64 ]) |
| 65 |
| 66 AS_IF([ test x"$enable_readline" != xno ],[ |
| 67 AC_CHECK_HEADERS([readline/readline.h],[ |
| 68 sLIBS=$LIBS |
| 69 LIBS="" |
| 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) |
| 73 READLINE_LIBS=$LIBS |
| 74 ]) |
| 75 LIBS=$sLIBS |
| 76 ]) |
| 77 ]) |
| 78 |
| 79 AC_SUBST(READLINE_LIBS) |
| 80 #----------------------------------------------------------------------- |
| 81 |
| 82 #----------------------------------------------------------------------- |
| 83 # --enable-threadsafe |
| 84 # |
| 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) |
| 93 fi |
| 94 AC_SUBST(THREADSAFE_FLAGS) |
| 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 |
| 106 DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 |
| 107 fi |
| 108 AC_MSG_CHECKING([for whether to support dynamic extensions]) |
| 109 AC_MSG_RESULT($enable_dynamic_extensions) |
| 110 AC_SUBST(DYNAMIC_EXTENSION_FLAGS) |
| 111 #----------------------------------------------------------------------- |
| 112 |
| 113 #----------------------------------------------------------------------- |
| 114 # --enable-fts5 |
| 115 # |
| 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 |
| 122 fi |
| 123 AC_SUBST(FTS5_FLAGS) |
| 124 #----------------------------------------------------------------------- |
| 125 |
| 126 #----------------------------------------------------------------------- |
| 127 # --enable-json1 |
| 128 # |
| 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 |
| 134 fi |
| 135 AC_SUBST(JSON1_FLAGS) |
| 136 #----------------------------------------------------------------------- |
| 137 |
| 138 #----------------------------------------------------------------------- |
| 139 # --enable-session |
| 140 # |
| 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" |
| 146 fi |
| 147 AC_SUBST(SESSION_FLAGS) |
| 148 #----------------------------------------------------------------------- |
| 149 |
| 150 #----------------------------------------------------------------------- |
| 151 # --enable-static-shell |
| 152 # |
| 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 |
| 159 else |
| 160 EXTRA_SHELL_OBJ=libsqlite3.la |
| 161 fi |
| 162 AC_SUBST(EXTRA_SHELL_OBJ) |
| 163 #----------------------------------------------------------------------- |
| 164 |
| 165 AC_CHECK_FUNCS(posix_fallocate) |
| 166 |
| 167 #----------------------------------------------------------------------- |
| 168 # UPDATE: Maybe it's better if users just set CFLAGS before invoking |
| 169 # configure. This option doesn't really add much... |
| 170 # |
| 171 # --enable-tempstore |
| 172 # |
| 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 ;; |
| 183 # * ) |
| 184 # TEMP_STORE=1 |
| 185 # enable_tempstore=yes |
| 186 # ;; |
| 187 # esac |
| 188 # AC_MSG_RESULT($enable_tempstore) |
| 189 # AC_SUBST(TEMP_STORE) |
| 190 #----------------------------------------------------------------------- |
| 191 |
| 192 AC_OUTPUT |
OLD | NEW |