drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 1 | # |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 2 | # The build process allows for using a cross-compiler. But the default |
| 3 | # action is to target the same platform that we are running on. The |
| 4 | # configure script needs to discover the following properties of the |
| 5 | # build and target systems: |
| 6 | # |
| 7 | # srcdir |
| 8 | # |
| 9 | # The is the name of the directory that contains the |
| 10 | # "configure" shell script. All source files are |
| 11 | # located relative to this directory. |
| 12 | # |
| 13 | # bindir |
| 14 | # |
| 15 | # The name of the directory where executables should be |
| 16 | # written by the "install" target of the makefile. |
| 17 | # |
| 18 | # program_prefix |
| 19 | # |
| 20 | # Add this prefix to the names of all executables that run |
| 21 | # on the target machine. Default: "" |
| 22 | # |
| 23 | # ENABLE_SHARED |
| 24 | # |
| 25 | # True if shared libraries should be generated. |
| 26 | # |
| 27 | # BUILD_CC |
| 28 | # |
| 29 | # The name of a command that is used to convert C |
| 30 | # source files into executables that run on the build |
| 31 | # platform. |
| 32 | # |
| 33 | # BUILD_CFLAGS |
| 34 | # |
| 35 | # Switches that the build compiler needs in order to construct |
| 36 | # command-line programs. |
| 37 | # |
| 38 | # BUILD_LIBS |
| 39 | # |
| 40 | # Libraries that the build compiler needs in order to construct |
| 41 | # command-line programs. |
| 42 | # |
| 43 | # BUILD_EXEEXT |
| 44 | # |
| 45 | # The filename extension for executables on the build |
| 46 | # platform. "" for Unix and ".exe" for Windows. |
| 47 | # |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 48 | # TCL_* |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 49 | # |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 50 | # Lots of values are read in from the tclConfig.sh script, |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 51 | # if that script is available. This values are used for |
| 52 | # constructing and installing the TCL extension. |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 53 | # |
| 54 | # TARGET_READLINE_LIBS |
| 55 | # |
| 56 | # This is the library directives passed to the target linker |
| 57 | # that cause the executable to link against the readline library. |
| 58 | # This might be a switch like "-lreadline" or pathnames of library |
| 59 | # file like "../../src/libreadline.a". |
| 60 | # |
| 61 | # TARGET_READLINE_INC |
| 62 | # |
| 63 | # This variables define the directory that contain header |
| 64 | # files for the readline library. If the compiler is able |
| 65 | # to find <readline.h> on its own, then this can be blank. |
| 66 | # |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 67 | # TARGET_EXEEXT |
| 68 | # |
| 69 | # The filename extension for executables on the |
| 70 | # target platform. "" for Unix and ".exe" for windows. |
| 71 | # |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 72 | # This configure.in file is easy to reuse on other projects. Just |
| 73 | # change the argument to AC_INIT(). And disable any features that |
| 74 | # you don't need (for example BLT) by erasing or commenting out |
| 75 | # the corresponding code. |
| 76 | # |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 77 | AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 78 | |
vapier | faa68db | 2009-04-01 07:38:31 +0000 | [diff] [blame] | 79 | dnl Make sure the local VERSION file matches this configure script |
danielk1977 | 6f050aa | 2009-04-25 08:39:14 +0000 | [diff] [blame] | 80 | sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'` |
vapier | faa68db | 2009-04-01 07:38:31 +0000 | [diff] [blame] | 81 | if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then |
| 82 | AC_MSG_ERROR([configure script is out of date: |
| 83 | configure \$PACKAGE_VERSION = $PACKAGE_VERSION |
| 84 | top level VERSION file = $sqlite_version_sanity_check |
| 85 | please regen with autoconf]) |
| 86 | fi |
| 87 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 88 | ######### |
| 89 | # Programs needed |
| 90 | # |
| 91 | AC_PROG_LIBTOOL |
| 92 | AC_PROG_INSTALL |
| 93 | |
| 94 | ######### |
mlcreech | 636a995 | 2008-05-05 22:52:56 +0000 | [diff] [blame] | 95 | # Enable large file support (if special flags are necessary) |
| 96 | # |
| 97 | AC_SYS_LARGEFILE |
| 98 | |
| 99 | ######### |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 100 | # Check for needed/wanted data types |
| 101 | AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t, |
| 102 | uint16_t, uint32_t, uint64_t, uintptr_t]) |
| 103 | |
| 104 | ######### |
| 105 | # Check for needed/wanted headers |
drh | 86c5a93 | 2012-02-08 12:13:28 +0000 | [diff] [blame] | 106 | AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h]) |
mlcreech | 5b0a9eb | 2008-03-09 01:38:09 +0000 | [diff] [blame] | 107 | |
| 108 | ######### |
| 109 | # Figure out whether or not we have these functions |
| 110 | # |
drh | e32a256 | 2016-03-04 02:38:00 +0000 | [diff] [blame] | 111 | AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64]) |
mlcreech | 5b0a9eb | 2008-03-09 01:38:09 +0000 | [diff] [blame] | 112 | |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 113 | ######### |
mlcreech | f386811 | 2008-03-11 18:03:30 +0000 | [diff] [blame] | 114 | # By default, we use the amalgamation (this may be changed below...) |
| 115 | # |
| 116 | USE_AMALGAMATION=1 |
| 117 | |
| 118 | ######### |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 119 | # See whether we can run specific tclsh versions known to work well; |
| 120 | # if not, then we fall back to plain tclsh. |
| 121 | # TODO: try other versions before falling back? |
| 122 | # |
drh | 0b11bcb | 2017-09-22 00:24:44 +0000 | [diff] [blame] | 123 | AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.7 tclsh8.6 tclsh8.5 tclsh], none) |
mlcreech | f386811 | 2008-03-11 18:03:30 +0000 | [diff] [blame] | 124 | if test "$TCLSH_CMD" = "none"; then |
| 125 | # If we can't find a local tclsh, then building the amalgamation will fail. |
| 126 | # We act as though --disable-amalgamation has been used. |
| 127 | echo "Warning: can't find tclsh - defaulting to non-amalgamation build." |
| 128 | USE_AMALGAMATION=0 |
| 129 | TCLSH_CMD="tclsh" |
| 130 | fi |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 131 | AC_SUBST(TCLSH_CMD) |
| 132 | |
vapier | 6d120f3 | 2009-01-28 04:46:14 +0000 | [diff] [blame] | 133 | AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) |
| 134 | if test "x${TCLLIBDIR+set}" != "xset" ; then |
| 135 | TCLLIBDIR='$(libdir)' |
| 136 | for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do |
| 137 | TCLLIBDIR=$i |
| 138 | break |
| 139 | done |
| 140 | TCLLIBDIR="${TCLLIBDIR}/sqlite3" |
| 141 | fi |
| 142 | |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 143 | |
| 144 | ######### |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 145 | # Set up an appropriate program prefix |
| 146 | # |
| 147 | if test "$program_prefix" = "NONE"; then |
| 148 | program_prefix="" |
| 149 | fi |
| 150 | AC_SUBST(program_prefix) |
| 151 | |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 152 | VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`] |
vapier | 695f097 | 2009-01-26 21:43:16 +0000 | [diff] [blame] | 153 | AC_MSG_NOTICE(Version set to $VERSION) |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 154 | AC_SUBST(VERSION) |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 155 | RELEASE=`cat $srcdir/VERSION` |
vapier | 695f097 | 2009-01-26 21:43:16 +0000 | [diff] [blame] | 156 | AC_MSG_NOTICE(Release set to $RELEASE) |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 157 | AC_SUBST(RELEASE) |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 158 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 159 | ######### |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 160 | # Locate a compiler for the build machine. This compiler should |
| 161 | # generate command-line programs that run on the build machine. |
| 162 | # |
vapier | c8a1530 | 2007-02-17 14:31:55 +0000 | [diff] [blame] | 163 | if test x"$cross_compiling" = xno; then |
| 164 | BUILD_CC=$CC |
| 165 | BUILD_CFLAGS=$CFLAGS |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 166 | else |
vapier | c8a1530 | 2007-02-17 14:31:55 +0000 | [diff] [blame] | 167 | if test "${BUILD_CC+set}" != set; then |
| 168 | AC_CHECK_PROGS(BUILD_CC, gcc cc cl) |
| 169 | fi |
| 170 | if test "${BUILD_CFLAGS+set}" != set; then |
| 171 | BUILD_CFLAGS="-g" |
| 172 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 173 | fi |
| 174 | AC_SUBST(BUILD_CC) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 175 | |
| 176 | ########## |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 177 | # Do we want to support multithreaded use of sqlite |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 178 | # |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 179 | AC_ARG_ENABLE(threadsafe, |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 180 | AC_HELP_STRING([--disable-threadsafe],[Disable mutexing])) |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 181 | AC_MSG_CHECKING([whether to support threadsafe operation]) |
| 182 | if test "$enable_threadsafe" = "no"; then |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 183 | SQLITE_THREADSAFE=0 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 184 | AC_MSG_RESULT([no]) |
| 185 | else |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 186 | SQLITE_THREADSAFE=1 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 187 | AC_MSG_RESULT([yes]) |
| 188 | fi |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 189 | AC_SUBST(SQLITE_THREADSAFE) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 190 | |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 191 | if test "$SQLITE_THREADSAFE" = "1"; then |
drh | ba60fbb | 2016-01-28 02:47:32 +0000 | [diff] [blame] | 192 | AC_SEARCH_LIBS(pthread_create, pthread) |
drh | 13c808a | 2016-01-13 21:23:48 +0000 | [diff] [blame] | 193 | AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) |
dougcurrie | 65623c7 | 2004-09-20 14:57:23 +0000 | [diff] [blame] | 194 | fi |
dougcurrie | 65623c7 | 2004-09-20 14:57:23 +0000 | [diff] [blame] | 195 | |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 196 | ########## |
xdong | 3b5543c | 2003-09-23 00:36:50 +0000 | [diff] [blame] | 197 | # Do we want to support release |
| 198 | # |
| 199 | AC_ARG_ENABLE(releasemode, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 200 | AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no) |
xdong | 3b5543c | 2003-09-23 00:36:50 +0000 | [diff] [blame] | 201 | AC_MSG_CHECKING([whether to support shared library linked as release mode or not]) |
| 202 | if test "$enable_releasemode" = "no"; then |
| 203 | ALLOWRELEASE="" |
| 204 | AC_MSG_RESULT([no]) |
| 205 | else |
drh | 0b47d34 | 2007-11-27 14:50:06 +0000 | [diff] [blame] | 206 | ALLOWRELEASE="-release `cat $srcdir/VERSION`" |
xdong | 3b5543c | 2003-09-23 00:36:50 +0000 | [diff] [blame] | 207 | AC_MSG_RESULT([yes]) |
| 208 | fi |
| 209 | AC_SUBST(ALLOWRELEASE) |
| 210 | |
| 211 | ########## |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 212 | # Do we want temporary databases in memory |
| 213 | # |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 214 | AC_ARG_ENABLE(tempstore, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 215 | AC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 216 | AC_MSG_CHECKING([whether to use an in-ram database for temporary tables]) |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 217 | case "$enable_tempstore" in |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 218 | never ) |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 219 | TEMP_STORE=0 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 220 | AC_MSG_RESULT([never]) |
| 221 | ;; |
| 222 | no ) |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 223 | TEMP_STORE=1 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 224 | AC_MSG_RESULT([no]) |
| 225 | ;; |
drh | 54414bb | 2005-10-10 00:05:50 +0000 | [diff] [blame] | 226 | yes ) |
drh | 8b72747 | 2009-01-19 18:18:40 +0000 | [diff] [blame] | 227 | TEMP_STORE=2 |
| 228 | AC_MSG_RESULT([yes]) |
| 229 | ;; |
| 230 | always ) |
drh | 54414bb | 2005-10-10 00:05:50 +0000 | [diff] [blame] | 231 | TEMP_STORE=3 |
| 232 | AC_MSG_RESULT([always]) |
| 233 | ;; |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 234 | * ) |
drh | 54414bb | 2005-10-10 00:05:50 +0000 | [diff] [blame] | 235 | TEMP_STORE=1 |
drh | 8b72747 | 2009-01-19 18:18:40 +0000 | [diff] [blame] | 236 | AC_MSG_RESULT([no]) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 237 | ;; |
| 238 | esac |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 239 | |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 240 | AC_SUBST(TEMP_STORE) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 241 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 242 | ########### |
| 243 | # Lots of things are different if we are compiling for Windows using |
| 244 | # the CYGWIN environment. So check for that special case and handle |
| 245 | # things accordingly. |
| 246 | # |
| 247 | AC_MSG_CHECKING([if executables have the .exe suffix]) |
| 248 | if test "$config_BUILD_EXEEXT" = ".exe"; then |
| 249 | CYGWIN=yes |
| 250 | AC_MSG_RESULT(yes) |
| 251 | else |
| 252 | AC_MSG_RESULT(unknown) |
| 253 | fi |
| 254 | if test "$CYGWIN" != "yes"; then |
| 255 | AC_CYGWIN |
| 256 | fi |
| 257 | if test "$CYGWIN" = "yes"; then |
| 258 | BUILD_EXEEXT=.exe |
| 259 | else |
dougcurrie | 6194a5f | 2003-12-19 20:09:51 +0000 | [diff] [blame] | 260 | BUILD_EXEEXT=$EXEEXT |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 261 | fi |
vapier | c8a1530 | 2007-02-17 14:31:55 +0000 | [diff] [blame] | 262 | if test x"$cross_compiling" = xno; then |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 263 | TARGET_EXEEXT=$BUILD_EXEEXT |
| 264 | else |
| 265 | TARGET_EXEEXT=$config_TARGET_EXEEXT |
| 266 | fi |
| 267 | if test "$TARGET_EXEEXT" = ".exe"; then |
mistachkin | fe27b08 | 2013-08-28 18:06:26 +0000 | [diff] [blame] | 268 | SQLITE_OS_UNIX=0 |
| 269 | SQLITE_OS_WIN=1 |
| 270 | CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 271 | else |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 272 | SQLITE_OS_UNIX=1 |
| 273 | SQLITE_OS_WIN=0 |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 274 | CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 275 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 276 | |
| 277 | AC_SUBST(BUILD_EXEEXT) |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 278 | AC_SUBST(SQLITE_OS_UNIX) |
| 279 | AC_SUBST(SQLITE_OS_WIN) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 280 | AC_SUBST(TARGET_EXEEXT) |
| 281 | |
| 282 | ########## |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 283 | # Figure out all the parameters needed to compile against Tcl. |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 284 | # |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 285 | # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG |
| 286 | # macros in the in the tcl.m4 file of the standard TCL distribution. |
| 287 | # Those macros could not be used directly since we have to make some |
| 288 | # minor changes to accomodate systems that do not have TCL installed. |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 289 | # |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 290 | AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]), |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 291 | [use_tcl=$enableval],[use_tcl=yes]) |
| 292 | if test "${use_tcl}" = "yes" ; then |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 293 | AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 294 | AC_MSG_CHECKING([for Tcl configuration]) |
| 295 | AC_CACHE_VAL(ac_cv_c_tclconfig,[ |
| 296 | # First check to see if --with-tcl was specified. |
| 297 | if test x"${with_tclconfig}" != x ; then |
| 298 | if test -f "${with_tclconfig}/tclConfig.sh" ; then |
| 299 | ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` |
| 300 | else |
| 301 | AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) |
| 302 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 303 | fi |
vapier | fe7e82e | 2009-01-26 21:39:33 +0000 | [diff] [blame] | 304 | |
| 305 | # Start autosearch by asking tclsh |
drh | e74f465 | 2012-08-15 16:06:54 +0000 | [diff] [blame] | 306 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 307 | if test x"$cross_compiling" = xno; then |
| 308 | for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` |
| 309 | do |
| 310 | if test -f "$i/tclConfig.sh" ; then |
| 311 | ac_cv_c_tclconfig="$i" |
| 312 | break |
| 313 | fi |
| 314 | done |
| 315 | fi |
vapier | fe7e82e | 2009-01-26 21:39:33 +0000 | [diff] [blame] | 316 | fi |
| 317 | |
drh | f960a64 | 2015-05-30 22:57:49 +0000 | [diff] [blame] | 318 | # On ubuntu 14.10, $auto_path on tclsh is not quite correct. |
| 319 | # So try again after applying corrections. |
| 320 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 321 | if test x"$cross_compiling" = xno; then |
| 322 | for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD} | sed 's,/tcltk/tcl,/tcl,g'` |
| 323 | do |
| 324 | if test -f "$i/tclConfig.sh" ; then |
| 325 | ac_cv_c_tclconfig="$i" |
| 326 | break |
| 327 | fi |
| 328 | done |
| 329 | fi |
| 330 | fi |
| 331 | |
drh | 6831474 | 2016-05-23 00:10:58 +0000 | [diff] [blame] | 332 | # Recent versions of Xcode on Macs hid the tclConfig.sh file |
| 333 | # in a strange place. |
| 334 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 335 | if test x"$cross_compiling" = xno; then |
| 336 | for i in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX*.sdk/usr/lib |
| 337 | do |
| 338 | if test -f "$i/tclConfig.sh" ; then |
| 339 | ac_cv_c_tclconfig="$i" |
| 340 | break |
| 341 | fi |
| 342 | done |
| 343 | fi |
| 344 | fi |
| 345 | |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 346 | # then check for a private Tcl installation |
| 347 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 348 | for i in \ |
| 349 | ../tcl \ |
| 350 | `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 351 | `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 352 | `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ |
| 353 | ../../tcl \ |
| 354 | `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 355 | `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 356 | `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ |
| 357 | ../../../tcl \ |
| 358 | `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 359 | `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 360 | `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` |
| 361 | do |
| 362 | if test -f "$i/unix/tclConfig.sh" ; then |
| 363 | ac_cv_c_tclconfig=`(cd $i/unix; pwd)` |
| 364 | break |
| 365 | fi |
| 366 | done |
| 367 | fi |
| 368 | |
| 369 | # check in a few common install locations |
| 370 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 371 | for i in \ |
| 372 | `ls -d ${libdir} 2>/dev/null` \ |
| 373 | `ls -d /usr/local/lib 2>/dev/null` \ |
| 374 | `ls -d /usr/contrib/lib 2>/dev/null` \ |
| 375 | `ls -d /usr/lib 2>/dev/null` |
| 376 | do |
| 377 | if test -f "$i/tclConfig.sh" ; then |
| 378 | ac_cv_c_tclconfig=`(cd $i; pwd)` |
| 379 | break |
| 380 | fi |
| 381 | done |
| 382 | fi |
| 383 | |
| 384 | # check in a few other private locations |
| 385 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 386 | for i in \ |
| 387 | ${srcdir}/../tcl \ |
| 388 | `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 389 | `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 390 | `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` |
| 391 | do |
| 392 | if test -f "$i/unix/tclConfig.sh" ; then |
| 393 | ac_cv_c_tclconfig=`(cd $i/unix; pwd)` |
| 394 | break |
| 395 | fi |
| 396 | done |
| 397 | fi |
| 398 | ]) |
| 399 | |
| 400 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 401 | use_tcl=no |
| 402 | AC_MSG_WARN(Can't find Tcl configuration definitions) |
| 403 | AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***) |
| 404 | AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***) |
| 405 | else |
| 406 | TCL_BIN_DIR=${ac_cv_c_tclconfig} |
| 407 | AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) |
| 408 | |
| 409 | AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) |
| 410 | if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then |
| 411 | AC_MSG_RESULT([loading]) |
| 412 | . $TCL_BIN_DIR/tclConfig.sh |
| 413 | else |
| 414 | AC_MSG_RESULT([file not found]) |
| 415 | fi |
| 416 | |
| 417 | # |
| 418 | # If the TCL_BIN_DIR is the build directory (not the install directory), |
| 419 | # then set the common variable name to the value of the build variables. |
| 420 | # For example, the variable TCL_LIB_SPEC will be set to the value |
| 421 | # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC |
| 422 | # instead of TCL_BUILD_LIB_SPEC since it will work with both an |
| 423 | # installed and uninstalled version of Tcl. |
| 424 | # |
| 425 | |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 426 | if test -f $TCL_BIN_DIR/Makefile ; then |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 427 | TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} |
| 428 | TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} |
| 429 | TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} |
| 430 | fi |
| 431 | |
| 432 | # |
| 433 | # eval is required to do the TCL_DBGX substitution |
| 434 | # |
| 435 | |
| 436 | eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" |
| 437 | eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" |
| 438 | eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" |
| 439 | |
| 440 | eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" |
| 441 | eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" |
| 442 | eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" |
| 443 | |
| 444 | AC_SUBST(TCL_VERSION) |
| 445 | AC_SUBST(TCL_BIN_DIR) |
| 446 | AC_SUBST(TCL_SRC_DIR) |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 447 | AC_SUBST(TCL_INCLUDE_SPEC) |
| 448 | |
| 449 | AC_SUBST(TCL_LIB_FILE) |
| 450 | AC_SUBST(TCL_LIB_FLAG) |
| 451 | AC_SUBST(TCL_LIB_SPEC) |
| 452 | |
| 453 | AC_SUBST(TCL_STUB_LIB_FILE) |
| 454 | AC_SUBST(TCL_STUB_LIB_FLAG) |
| 455 | AC_SUBST(TCL_STUB_LIB_SPEC) |
drh | d881ce8 | 2015-03-31 17:01:52 +0000 | [diff] [blame] | 456 | AC_SUBST(TCL_SHLIB_SUFFIX) |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 457 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 458 | fi |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 459 | if test "${use_tcl}" = "no" ; then |
| 460 | HAVE_TCL="" |
| 461 | else |
| 462 | HAVE_TCL=1 |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 463 | fi |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 464 | AC_SUBST(HAVE_TCL) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 465 | |
| 466 | ########## |
| 467 | # Figure out what C libraries are required to compile programs |
| 468 | # that use "readline()" library. |
| 469 | # |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 470 | TARGET_READLINE_LIBS="" |
| 471 | TARGET_READLINE_INC="" |
| 472 | TARGET_HAVE_READLINE=0 |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 473 | TARGET_HAVE_EDITLINE=0 |
| 474 | AC_ARG_ENABLE([editline], |
| 475 | [AC_HELP_STRING([--enable-editline],[enable BSD editline support])], |
| 476 | [with_editline=$enableval], |
| 477 | [with_editline=auto]) |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 478 | AC_ARG_ENABLE([readline], |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 479 | [AC_HELP_STRING([--disable-readline],[disable readline support])], |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 480 | [with_readline=$enableval], |
| 481 | [with_readline=auto]) |
| 482 | |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 483 | if test x"$with_editline" != xno; then |
| 484 | sLIBS=$LIBS |
| 485 | LIBS="" |
| 486 | TARGET_HAVE_EDITLINE=1 |
| 487 | AC_SEARCH_LIBS(readline,edit,[with_readline=no],[TARGET_HAVE_EDITLINE=0]) |
| 488 | TARGET_READLINE_LIBS=$LIBS |
| 489 | LIBS=$sLIBS |
| 490 | fi |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 491 | if test x"$with_readline" != xno; then |
| 492 | found="yes" |
| 493 | |
| 494 | AC_ARG_WITH([readline-lib], |
| 495 | [AC_HELP_STRING([--with-readline-lib],[specify readline library])], |
| 496 | [with_readline_lib=$withval], |
| 497 | [with_readline_lib="auto"]) |
| 498 | if test "x$with_readline_lib" = xauto; then |
| 499 | save_LIBS="$LIBS" |
| 500 | LIBS="" |
| 501 | AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""]) |
| 502 | AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"]) |
| 503 | TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS" |
| 504 | LIBS="$save_LIBS" |
| 505 | else |
| 506 | TARGET_READLINE_LIBS="$with_readline_lib" |
| 507 | fi |
| 508 | |
| 509 | AC_ARG_WITH([readline-inc], |
| 510 | [AC_HELP_STRING([--with-readline-inc],[specify readline include paths])], |
| 511 | [with_readline_inc=$withval], |
| 512 | [with_readline_inc="auto"]) |
| 513 | if test "x$with_readline_inc" = xauto; then |
| 514 | AC_CHECK_HEADER(readline.h, [found="yes"], [ |
| 515 | found="no" |
| 516 | if test "$cross_compiling" != yes; then |
| 517 | for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do |
| 518 | for subdir in include include/readline; do |
| 519 | AC_CHECK_FILE($dir/$subdir/readline.h, found=yes) |
| 520 | if test "$found" = "yes"; then |
| 521 | TARGET_READLINE_INC="-I$dir/$subdir" |
| 522 | break |
| 523 | fi |
| 524 | done |
| 525 | test "$found" = "yes" && break |
| 526 | done |
| 527 | fi |
| 528 | ]) |
| 529 | else |
| 530 | TARGET_READLINE_INC="$with_readline_inc" |
| 531 | fi |
| 532 | |
| 533 | if test x"$found" = xno; then |
| 534 | TARGET_READLINE_LIBS="" |
| 535 | TARGET_READLINE_INC="" |
| 536 | TARGET_HAVE_READLINE=0 |
| 537 | else |
| 538 | TARGET_HAVE_READLINE=1 |
| 539 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 540 | fi |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 541 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 542 | AC_SUBST(TARGET_READLINE_LIBS) |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 543 | AC_SUBST(TARGET_READLINE_INC) |
| 544 | AC_SUBST(TARGET_HAVE_READLINE) |
drh | e44b835 | 2015-10-30 14:25:57 +0000 | [diff] [blame] | 545 | AC_SUBST(TARGET_HAVE_EDITLINE) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 546 | |
| 547 | ########## |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 548 | # Figure out what C libraries are required to compile programs |
| 549 | # that use "fdatasync()" function. |
| 550 | # |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 551 | AC_SEARCH_LIBS(fdatasync, [rt]) |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 552 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 553 | ######### |
tpoindex | 9d9f76c | 2005-01-03 21:28:56 +0000 | [diff] [blame] | 554 | # check for debug enabled |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 555 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain])) |
| 556 | if test "${enable_debug}" = "yes" ; then |
drh | 32d0eba | 2017-04-05 10:54:14 +0000 | [diff] [blame] | 557 | TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0" |
tpoindex | 9d9f76c | 2005-01-03 21:28:56 +0000 | [diff] [blame] | 558 | else |
| 559 | TARGET_DEBUG="-DNDEBUG" |
| 560 | fi |
| 561 | AC_SUBST(TARGET_DEBUG) |
| 562 | |
| 563 | ######### |
mlcreech | 9498491 | 2008-03-04 19:03:08 +0000 | [diff] [blame] | 564 | # See whether we should use the amalgamation to build |
| 565 | AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 566 | [Disable the amalgamation and instead build all files separately])) |
dan | b13d5c2 | 2020-07-07 19:24:34 +0000 | [diff] [blame] | 567 | if test "${enable_amalgamation}" = "no" ; then |
mlcreech | 9498491 | 2008-03-04 19:03:08 +0000 | [diff] [blame] | 568 | USE_AMALGAMATION=0 |
| 569 | fi |
| 570 | AC_SUBST(USE_AMALGAMATION) |
| 571 | |
| 572 | ######### |
drh | 56c9311 | 2017-11-24 16:55:48 +0000 | [diff] [blame] | 573 | # Look for zlib. Only needed by extensions and by the sqlite3.exe shell |
| 574 | AC_CHECK_HEADERS(zlib.h) |
| 575 | AC_SEARCH_LIBS(deflate, z, [HAVE_ZLIB="-DSQLITE_HAVE_ZLIB=1"], [HAVE_ZLIB=""]) |
| 576 | AC_SUBST(HAVE_ZLIB) |
| 577 | |
| 578 | ######### |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 579 | # See whether we should allow loadable extensions |
drh | 05c7e0b | 2015-01-10 14:27:17 +0000 | [diff] [blame] | 580 | AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--disable-load-extension], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 581 | [Disable loading of external extensions]),,[enable_load_extension=yes]) |
| 582 | if test "${enable_load_extension}" = "yes" ; then |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 583 | OPT_FEATURE_FLAGS="" |
drh | dbe4b88 | 2011-06-20 18:00:17 +0000 | [diff] [blame] | 584 | AC_SEARCH_LIBS(dlopen, dl) |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 585 | else |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 586 | OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 587 | fi |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 588 | |
drh | c530b9c | 2016-07-25 11:27:22 +0000 | [diff] [blame] | 589 | ########## |
| 590 | # Do we want to support memsys3 and/or memsys5 |
| 591 | # |
drh | c530b9c | 2016-07-25 11:27:22 +0000 | [diff] [blame] | 592 | AC_ARG_ENABLE(memsys5, |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 593 | AC_HELP_STRING([--enable-memsys5],[Enable MEMSYS5])) |
drh | c530b9c | 2016-07-25 11:27:22 +0000 | [diff] [blame] | 594 | AC_MSG_CHECKING([whether to support MEMSYS5]) |
drh | 26197d1 | 2016-07-25 11:32:09 +0000 | [diff] [blame] | 595 | if test "${enable_memsys5}" = "yes"; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 596 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS5" |
drh | c530b9c | 2016-07-25 11:27:22 +0000 | [diff] [blame] | 597 | AC_MSG_RESULT([yes]) |
| 598 | else |
| 599 | AC_MSG_RESULT([no]) |
| 600 | fi |
drh | 5d513ba | 2016-07-25 11:57:21 +0000 | [diff] [blame] | 601 | AC_ARG_ENABLE(memsys3, |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 602 | AC_HELP_STRING([--enable-memsys3],[Enable MEMSYS3])) |
drh | 5d513ba | 2016-07-25 11:57:21 +0000 | [diff] [blame] | 603 | AC_MSG_CHECKING([whether to support MEMSYS3]) |
| 604 | if test "${enable_memsys3}" = "yes" -a "${enable_memsys5}" = "no"; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 605 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS3" |
drh | 5d513ba | 2016-07-25 11:57:21 +0000 | [diff] [blame] | 606 | AC_MSG_RESULT([yes]) |
| 607 | else |
| 608 | AC_MSG_RESULT([no]) |
| 609 | fi |
drh | c530b9c | 2016-07-25 11:27:22 +0000 | [diff] [blame] | 610 | |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 611 | ######## |
| 612 | # The --enable-extensions argument is short-hand to enable |
| 613 | # multiple extensions. |
| 614 | AC_ARG_ENABLE(all, AC_HELP_STRING([--enable-all], |
| 615 | [Enable FTS4, FTS5, Geopoly, JSON, RTree, Sessions])) |
| 616 | |
mlcreech | aac7b93 | 2008-04-01 02:45:22 +0000 | [diff] [blame] | 617 | ######### |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 618 | # See whether we should enable Full Text Search extensions |
| 619 | AC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 620 | [Enable the FTS3 extension])) |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 621 | if test "${enable_fts3}" = "yes" ; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 622 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS3" |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 623 | fi |
| 624 | AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 625 | [Enable the FTS4 extension])) |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 626 | if test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 627 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS4" |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 628 | AC_SEARCH_LIBS([log],[m]) |
| 629 | fi |
| 630 | AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 631 | [Enable the FTS5 extension])) |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 632 | if test "${enable_fts5}" = "yes" -o "${enable_all}" = "yes" ; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 633 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS5" |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 634 | AC_SEARCH_LIBS([log],[m]) |
| 635 | fi |
| 636 | |
| 637 | ######### |
| 638 | # See whether we should enable JSON1 |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 639 | AC_ARG_ENABLE(json1, AC_HELP_STRING([--enable-json1],[Enable the JSON1 extension])) |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 640 | if test "${enable_json1}" = "yes" -o "${enable_all}" = "yes" ; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 641 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_JSON1" |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 642 | fi |
| 643 | |
| 644 | ######### |
drh | 83bebdd | 2017-08-28 17:00:12 +0000 | [diff] [blame] | 645 | # See whether we should enable the LIMIT clause on UPDATE and DELETE |
| 646 | # statements. |
| 647 | AC_ARG_ENABLE(update-limit, AC_HELP_STRING([--enable-update-limit], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 648 | [Enable the UPDATE/DELETE LIMIT clause])) |
drh | b13c3a3 | 2020-06-15 14:38:57 +0000 | [diff] [blame] | 649 | if test "${enable_update_limit}" = "yes" ; then |
drh | 83bebdd | 2017-08-28 17:00:12 +0000 | [diff] [blame] | 650 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT" |
| 651 | fi |
| 652 | |
| 653 | ######### |
drh | 748b8fd | 2018-05-25 19:22:47 +0000 | [diff] [blame] | 654 | # See whether we should enable GEOPOLY |
| 655 | AC_ARG_ENABLE(geopoly, AC_HELP_STRING([--enable-geopoly], |
| 656 | [Enable the GEOPOLY extension]), |
| 657 | [enable_geopoly=yes],[enable_geopoly=no]) |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 658 | if test "${enable_geopoly}" = "yes" -o "${enable_all}" = "yes" ; then |
drh | 748b8fd | 2018-05-25 19:22:47 +0000 | [diff] [blame] | 659 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_GEOPOLY" |
| 660 | enable_rtree=yes |
| 661 | fi |
| 662 | |
| 663 | ######### |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 664 | # See whether we should enable RTREE |
| 665 | AC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 666 | [Enable the RTREE extension])) |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 667 | if test "${enable_rtree}" = "yes" ; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 668 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_RTREE" |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 669 | fi |
| 670 | |
| 671 | ######### |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 672 | # See whether we should enable the SESSION extension |
| 673 | AC_ARG_ENABLE(session, AC_HELP_STRING([--enable-session], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 674 | [Enable the SESSION extension])) |
drh | 29368ea | 2019-12-28 13:17:11 +0000 | [diff] [blame] | 675 | if test "${enable_session}" = "yes" -o "${enable_all}" = "yes" ; then |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 676 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_SESSION" |
| 677 | OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_PREUPDATE_HOOK" |
drh | 5e18d40 | 2016-05-03 13:14:18 +0000 | [diff] [blame] | 678 | fi |
| 679 | |
| 680 | ######### |
drh | 8c9ed05 | 2017-05-29 17:43:06 +0000 | [diff] [blame] | 681 | # attempt to duplicate any OMITS and ENABLES into the ${OPT_FEATURE_FLAGS} parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 682 | for option in $CFLAGS $CPPFLAGS |
| 683 | do |
| 684 | case $option in |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 685 | -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 686 | -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 687 | esac |
| 688 | done |
| 689 | AC_SUBST(OPT_FEATURE_FLAGS) |
| 690 | |
| 691 | |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 692 | # attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 693 | ac_temp_CFLAGS="" |
| 694 | for option in $CFLAGS |
| 695 | do |
| 696 | case $option in |
| 697 | -DSQLITE_OMIT*) ;; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 698 | -DSQLITE_ENABLE*) ;; |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 699 | *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 700 | esac |
| 701 | done |
| 702 | CFLAGS=$ac_temp_CFLAGS |
| 703 | |
| 704 | |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 705 | # attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 706 | ac_temp_CPPFLAGS="" |
| 707 | for option in $CPPFLAGS |
| 708 | do |
| 709 | case $option in |
| 710 | -DSQLITE_OMIT*) ;; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 711 | -DSQLITE_ENABLE*) ;; |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 712 | *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 713 | esac |
| 714 | done |
| 715 | CPPFLAGS=$ac_temp_CPPFLAGS |
| 716 | |
| 717 | |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 718 | # attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 719 | ac_temp_BUILD_CFLAGS="" |
| 720 | for option in $BUILD_CFLAGS |
| 721 | do |
| 722 | case $option in |
| 723 | -DSQLITE_OMIT*) ;; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 724 | -DSQLITE_ENABLE*) ;; |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 725 | *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 726 | esac |
| 727 | done |
| 728 | BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS |
| 729 | |
| 730 | |
| 731 | ######### |
| 732 | # See whether we should use GCOV |
mlcreech | aac7b93 | 2008-04-01 02:45:22 +0000 | [diff] [blame] | 733 | AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov], |
drh | 8fa622d | 2018-06-11 19:47:14 +0000 | [diff] [blame] | 734 | [Enable coverage testing using gcov])) |
mlcreech | aac7b93 | 2008-04-01 02:45:22 +0000 | [diff] [blame] | 735 | if test "${use_gcov}" = "yes" ; then |
| 736 | USE_GCOV=1 |
| 737 | else |
| 738 | USE_GCOV=0 |
| 739 | fi |
| 740 | AC_SUBST(USE_GCOV) |
| 741 | |
drh | af6edf5 | 2005-10-04 18:38:49 +0000 | [diff] [blame] | 742 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 743 | ######### |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 744 | # Output the config header |
mlcreech | 2379706 | 2008-03-20 02:25:35 +0000 | [diff] [blame] | 745 | AC_CONFIG_HEADERS(config.h) |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 746 | |
| 747 | ######### |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 748 | # Generate the output files. |
| 749 | # |
mlcreech | 8390bc3 | 2008-03-06 08:54:38 +0000 | [diff] [blame] | 750 | AC_SUBST(BUILD_CFLAGS) |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 751 | AC_OUTPUT([ |
| 752 | Makefile |
dougcurrie | 12b3444 | 2004-07-19 03:24:59 +0000 | [diff] [blame] | 753 | sqlite3.pc |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 754 | ]) |