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 | # |
| 72 | # The generated configure script will make an attempt to guess |
| 73 | # at all of the above parameters. You can override any of |
| 74 | # the guesses by setting the environment variable named |
| 75 | # "config_AAAA" where "AAAA" is the name of the parameter |
| 76 | # described above. (Exception: srcdir cannot be set this way.) |
| 77 | # If you have a file that sets one or more of these environment |
| 78 | # variables, you can invoke configure as follows: |
| 79 | # |
| 80 | # configure --with-hints=FILE |
| 81 | # |
| 82 | # where FILE is the name of the file that sets the environment |
| 83 | # variables. FILE should be an absolute pathname. |
| 84 | # |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 85 | # This configure.in file is easy to reuse on other projects. Just |
| 86 | # change the argument to AC_INIT(). And disable any features that |
| 87 | # you don't need (for example BLT) by erasing or commenting out |
| 88 | # the corresponding code. |
| 89 | # |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 90 | AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 91 | |
vapier | faa68db | 2009-04-01 07:38:31 +0000 | [diff] [blame^] | 92 | dnl Make sure the local VERSION file matches this configure script |
| 93 | sqlite_version_sanity_check=`cat VERSION | tr -d '\n'` |
| 94 | if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then |
| 95 | AC_MSG_ERROR([configure script is out of date: |
| 96 | configure \$PACKAGE_VERSION = $PACKAGE_VERSION |
| 97 | top level VERSION file = $sqlite_version_sanity_check |
| 98 | please regen with autoconf]) |
| 99 | fi |
| 100 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 101 | dnl Put the RCS revision string after AC_INIT so that it will also |
| 102 | dnl show in in configure. |
| 103 | # The following RCS revision string applies to configure.in |
vapier | faa68db | 2009-04-01 07:38:31 +0000 | [diff] [blame^] | 104 | # $Revision: 1.55 $ |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 105 | |
| 106 | ######### |
| 107 | # Programs needed |
| 108 | # |
| 109 | AC_PROG_LIBTOOL |
| 110 | AC_PROG_INSTALL |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 111 | AC_PROG_AWK |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 112 | |
| 113 | ######### |
mlcreech | 636a995 | 2008-05-05 22:52:56 +0000 | [diff] [blame] | 114 | # Enable large file support (if special flags are necessary) |
| 115 | # |
| 116 | AC_SYS_LARGEFILE |
| 117 | |
| 118 | ######### |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 119 | # Check for needed/wanted data types |
| 120 | AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t, |
| 121 | uint16_t, uint32_t, uint64_t, uintptr_t]) |
| 122 | |
| 123 | ######### |
| 124 | # Check for needed/wanted headers |
mlcreech | 5b0a9eb | 2008-03-09 01:38:09 +0000 | [diff] [blame] | 125 | AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h]) |
| 126 | |
| 127 | ######### |
| 128 | # Figure out whether or not we have these functions |
| 129 | # |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 130 | AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s]) |
mlcreech | 5b0a9eb | 2008-03-09 01:38:09 +0000 | [diff] [blame] | 131 | |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 132 | ######### |
mlcreech | f386811 | 2008-03-11 18:03:30 +0000 | [diff] [blame] | 133 | # By default, we use the amalgamation (this may be changed below...) |
| 134 | # |
| 135 | USE_AMALGAMATION=1 |
| 136 | |
| 137 | ######### |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 138 | # See whether we can run specific tclsh versions known to work well; |
| 139 | # if not, then we fall back to plain tclsh. |
| 140 | # TODO: try other versions before falling back? |
| 141 | # |
mlcreech | f386811 | 2008-03-11 18:03:30 +0000 | [diff] [blame] | 142 | AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.4 tclsh], none) |
| 143 | if test "$TCLSH_CMD" = "none"; then |
| 144 | # If we can't find a local tclsh, then building the amalgamation will fail. |
| 145 | # We act as though --disable-amalgamation has been used. |
| 146 | echo "Warning: can't find tclsh - defaulting to non-amalgamation build." |
| 147 | USE_AMALGAMATION=0 |
| 148 | TCLSH_CMD="tclsh" |
| 149 | fi |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 150 | AC_SUBST(TCLSH_CMD) |
| 151 | |
vapier | 6d120f3 | 2009-01-28 04:46:14 +0000 | [diff] [blame] | 152 | AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) |
| 153 | if test "x${TCLLIBDIR+set}" != "xset" ; then |
| 154 | TCLLIBDIR='$(libdir)' |
| 155 | for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do |
| 156 | TCLLIBDIR=$i |
| 157 | break |
| 158 | done |
| 159 | TCLLIBDIR="${TCLLIBDIR}/sqlite3" |
| 160 | fi |
| 161 | |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 162 | |
| 163 | ######### |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 164 | # Set up an appropriate program prefix |
| 165 | # |
| 166 | if test "$program_prefix" = "NONE"; then |
| 167 | program_prefix="" |
| 168 | fi |
| 169 | AC_SUBST(program_prefix) |
| 170 | |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 171 | VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`] |
vapier | 695f097 | 2009-01-26 21:43:16 +0000 | [diff] [blame] | 172 | AC_MSG_NOTICE(Version set to $VERSION) |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 173 | AC_SUBST(VERSION) |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 174 | RELEASE=`cat $srcdir/VERSION` |
vapier | 695f097 | 2009-01-26 21:43:16 +0000 | [diff] [blame] | 175 | AC_MSG_NOTICE(Release set to $RELEASE) |
drh | 4b2266a | 2004-11-27 15:52:16 +0000 | [diff] [blame] | 176 | AC_SUBST(RELEASE) |
vapier | 695f097 | 2009-01-26 21:43:16 +0000 | [diff] [blame] | 177 | VERSION_NUMBER=[`cat $srcdir/VERSION \ |
drh | b797783 | 2005-02-16 03:45:51 +0000 | [diff] [blame] | 178 | | sed 's/[^0-9]/ /g' \ |
drh | 26d0e2a | 2005-07-06 13:51:27 +0000 | [diff] [blame] | 179 | | awk '{printf "%d%03d%03d",$1,$2,$3}'`] |
vapier | 695f097 | 2009-01-26 21:43:16 +0000 | [diff] [blame] | 180 | AC_MSG_NOTICE(Version number set to $VERSION_NUMBER) |
drh | b797783 | 2005-02-16 03:45:51 +0000 | [diff] [blame] | 181 | AC_SUBST(VERSION_NUMBER) |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 182 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 183 | ######### |
| 184 | # Check to see if the --with-hints=FILE option is used. If there is none, |
| 185 | # then check for a files named "$host.hints" and ../$hosts.hints where |
| 186 | # $host is the hostname of the build system. If still no hints are |
| 187 | # found, try looking in $system.hints and ../$system.hints where |
| 188 | # $system is the result of uname -s. |
| 189 | # |
| 190 | AC_ARG_WITH(hints, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 191 | AC_HELP_STRING([--with-hints=FILE],[Read configuration options from FILE]), |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 192 | hints=$withval) |
| 193 | if test "$hints" = ""; then |
| 194 | host=`hostname | sed 's/\..*//'` |
| 195 | if test -r $host.hints; then |
| 196 | hints=$host.hints |
| 197 | else |
| 198 | if test -r ../$host.hints; then |
| 199 | hints=../$host.hints |
| 200 | fi |
| 201 | fi |
| 202 | fi |
| 203 | if test "$hints" = ""; then |
| 204 | sys=`uname -s` |
| 205 | if test -r $sys.hints; then |
| 206 | hints=$sys.hints |
| 207 | else |
| 208 | if test -r ../$sys.hints; then |
| 209 | hints=../$sys.hints |
| 210 | fi |
| 211 | fi |
| 212 | fi |
| 213 | if test "$hints" != ""; then |
| 214 | AC_MSG_RESULT(reading hints from $hints) |
| 215 | . $hints |
| 216 | fi |
| 217 | |
| 218 | ######### |
| 219 | # Locate a compiler for the build machine. This compiler should |
| 220 | # generate command-line programs that run on the build machine. |
| 221 | # |
vapier | c8a1530 | 2007-02-17 14:31:55 +0000 | [diff] [blame] | 222 | if test x"$cross_compiling" = xno; then |
| 223 | BUILD_CC=$CC |
| 224 | BUILD_CFLAGS=$CFLAGS |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 225 | else |
vapier | c8a1530 | 2007-02-17 14:31:55 +0000 | [diff] [blame] | 226 | if test "${BUILD_CC+set}" != set; then |
| 227 | AC_CHECK_PROGS(BUILD_CC, gcc cc cl) |
| 228 | fi |
| 229 | if test "${BUILD_CFLAGS+set}" != set; then |
| 230 | BUILD_CFLAGS="-g" |
| 231 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 232 | fi |
| 233 | AC_SUBST(BUILD_CC) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 234 | |
| 235 | ########## |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 236 | # Do we want to support multithreaded use of sqlite |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 237 | # |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 238 | AC_ARG_ENABLE(threadsafe, |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 239 | AC_HELP_STRING([--enable-threadsafe],[Support threadsafe operation]),,enable_threadsafe=yes) |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 240 | AC_MSG_CHECKING([whether to support threadsafe operation]) |
| 241 | if test "$enable_threadsafe" = "no"; then |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 242 | SQLITE_THREADSAFE=0 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 243 | AC_MSG_RESULT([no]) |
| 244 | else |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 245 | SQLITE_THREADSAFE=1 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 246 | AC_MSG_RESULT([yes]) |
| 247 | fi |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 248 | AC_SUBST(SQLITE_THREADSAFE) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 249 | |
drh | 5a3032b | 2007-09-03 16:12:09 +0000 | [diff] [blame] | 250 | if test "$SQLITE_THREADSAFE" = "1"; then |
mlcreech | c658b0f | 2008-03-09 02:20:11 +0000 | [diff] [blame] | 251 | AC_SEARCH_LIBS(pthread_create, pthread) |
dougcurrie | 65623c7 | 2004-09-20 14:57:23 +0000 | [diff] [blame] | 252 | fi |
dougcurrie | 65623c7 | 2004-09-20 14:57:23 +0000 | [diff] [blame] | 253 | |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 254 | ########## |
drh | 91636d5 | 2005-11-24 23:14:00 +0000 | [diff] [blame] | 255 | # Do we want to allow a connection created in one thread to be used |
| 256 | # in another thread. This does not work on many Linux systems (ex: RedHat 9) |
| 257 | # due to bugs in the threading implementations. This is thus off by default. |
| 258 | # |
| 259 | AC_ARG_ENABLE(cross-thread-connections, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 260 | AC_HELP_STRING([--enable-cross-thread-connections],[Allow connection sharing across threads]),,enable_xthreadconnect=no) |
drh | 91636d5 | 2005-11-24 23:14:00 +0000 | [diff] [blame] | 261 | AC_MSG_CHECKING([whether to allow connections to be shared across threads]) |
| 262 | if test "$enable_xthreadconnect" = "no"; then |
| 263 | XTHREADCONNECT='' |
| 264 | AC_MSG_RESULT([no]) |
| 265 | else |
| 266 | XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1' |
| 267 | AC_MSG_RESULT([yes]) |
| 268 | fi |
| 269 | AC_SUBST(XTHREADCONNECT) |
| 270 | |
| 271 | ########## |
drh | 8e2e2a1 | 2006-02-01 01:55:17 +0000 | [diff] [blame] | 272 | # Do we want to set threadsOverrideEachOthersLocks variable to be 1 (true) by |
| 273 | # default. Normally, a test at runtime is performed to determine the |
| 274 | # appropriate value of this variable. Use this option only if you're sure that |
| 275 | # threads can safely override each others locks in all runtime situations. |
| 276 | # |
| 277 | AC_ARG_ENABLE(threads-override-locks, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 278 | AC_HELP_STRING([--enable-threads-override-locks],[Threads can override each others locks]),,enable_threads_override_locks=no) |
drh | 8e2e2a1 | 2006-02-01 01:55:17 +0000 | [diff] [blame] | 279 | AC_MSG_CHECKING([whether threads can override each others locks]) |
| 280 | if test "$enable_threads_override_locks" = "no"; then |
| 281 | THREADSOVERRIDELOCKS='-1' |
| 282 | AC_MSG_RESULT([no]) |
| 283 | else |
| 284 | THREADSOVERRIDELOCKS='1' |
| 285 | AC_MSG_RESULT([yes]) |
| 286 | fi |
| 287 | AC_SUBST(THREADSOVERRIDELOCKS) |
| 288 | |
| 289 | ########## |
xdong | 3b5543c | 2003-09-23 00:36:50 +0000 | [diff] [blame] | 290 | # Do we want to support release |
| 291 | # |
| 292 | AC_ARG_ENABLE(releasemode, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 293 | 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] | 294 | AC_MSG_CHECKING([whether to support shared library linked as release mode or not]) |
| 295 | if test "$enable_releasemode" = "no"; then |
| 296 | ALLOWRELEASE="" |
| 297 | AC_MSG_RESULT([no]) |
| 298 | else |
drh | 0b47d34 | 2007-11-27 14:50:06 +0000 | [diff] [blame] | 299 | ALLOWRELEASE="-release `cat $srcdir/VERSION`" |
xdong | 3b5543c | 2003-09-23 00:36:50 +0000 | [diff] [blame] | 300 | AC_MSG_RESULT([yes]) |
| 301 | fi |
| 302 | AC_SUBST(ALLOWRELEASE) |
| 303 | |
| 304 | ########## |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 305 | # Do we want temporary databases in memory |
| 306 | # |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 307 | AC_ARG_ENABLE(tempstore, |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 308 | 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] | 309 | AC_MSG_CHECKING([whether to use an in-ram database for temporary tables]) |
dougcurrie | 0f290bf | 2004-06-21 18:57:29 +0000 | [diff] [blame] | 310 | case "$enable_tempstore" in |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 311 | never ) |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 312 | TEMP_STORE=0 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 313 | AC_MSG_RESULT([never]) |
| 314 | ;; |
| 315 | no ) |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 316 | TEMP_STORE=1 |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 317 | AC_MSG_RESULT([no]) |
| 318 | ;; |
drh | 54414bb | 2005-10-10 00:05:50 +0000 | [diff] [blame] | 319 | yes ) |
drh | 8b72747 | 2009-01-19 18:18:40 +0000 | [diff] [blame] | 320 | TEMP_STORE=2 |
| 321 | AC_MSG_RESULT([yes]) |
| 322 | ;; |
| 323 | always ) |
drh | 54414bb | 2005-10-10 00:05:50 +0000 | [diff] [blame] | 324 | TEMP_STORE=3 |
| 325 | AC_MSG_RESULT([always]) |
| 326 | ;; |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 327 | * ) |
drh | 54414bb | 2005-10-10 00:05:50 +0000 | [diff] [blame] | 328 | TEMP_STORE=1 |
drh | 8b72747 | 2009-01-19 18:18:40 +0000 | [diff] [blame] | 329 | AC_MSG_RESULT([no]) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 330 | ;; |
| 331 | esac |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 332 | |
paul | 2dc96f9 | 2003-04-20 11:46:34 +0000 | [diff] [blame] | 333 | AC_SUBST(TEMP_STORE) |
paul | b0208cc | 2003-04-13 18:26:49 +0000 | [diff] [blame] | 334 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 335 | ########### |
| 336 | # Lots of things are different if we are compiling for Windows using |
| 337 | # the CYGWIN environment. So check for that special case and handle |
| 338 | # things accordingly. |
| 339 | # |
| 340 | AC_MSG_CHECKING([if executables have the .exe suffix]) |
| 341 | if test "$config_BUILD_EXEEXT" = ".exe"; then |
| 342 | CYGWIN=yes |
| 343 | AC_MSG_RESULT(yes) |
| 344 | else |
| 345 | AC_MSG_RESULT(unknown) |
| 346 | fi |
| 347 | if test "$CYGWIN" != "yes"; then |
| 348 | AC_CYGWIN |
| 349 | fi |
| 350 | if test "$CYGWIN" = "yes"; then |
| 351 | BUILD_EXEEXT=.exe |
| 352 | else |
dougcurrie | 6194a5f | 2003-12-19 20:09:51 +0000 | [diff] [blame] | 353 | BUILD_EXEEXT=$EXEEXT |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 354 | fi |
vapier | c8a1530 | 2007-02-17 14:31:55 +0000 | [diff] [blame] | 355 | if test x"$cross_compiling" = xno; then |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 356 | TARGET_EXEEXT=$BUILD_EXEEXT |
| 357 | else |
| 358 | TARGET_EXEEXT=$config_TARGET_EXEEXT |
| 359 | fi |
| 360 | if test "$TARGET_EXEEXT" = ".exe"; then |
drh | 60a1e4b | 2006-06-03 18:02:15 +0000 | [diff] [blame] | 361 | if test $OS2_SHELL ; then |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 362 | SQLITE_OS_UNIX=0 |
| 363 | SQLITE_OS_WIN=0 |
| 364 | SQLITE_OS_OS2=1 |
| 365 | CFLAGS="$CFLAGS -DSQLITE_OS_OS2=1" |
drh | 60a1e4b | 2006-06-03 18:02:15 +0000 | [diff] [blame] | 366 | else |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 367 | SQLITE_OS_UNIX=0 |
| 368 | SQLITE_OS_WIN=1 |
| 369 | SQLITE_OS_OS2=0 |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 370 | CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" |
drh | 60a1e4b | 2006-06-03 18:02:15 +0000 | [diff] [blame] | 371 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 372 | else |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 373 | SQLITE_OS_UNIX=1 |
| 374 | SQLITE_OS_WIN=0 |
| 375 | SQLITE_OS_OS2=0 |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 376 | CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 377 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 378 | |
| 379 | AC_SUBST(BUILD_EXEEXT) |
danielk1977 | 29bafea | 2008-06-26 10:41:19 +0000 | [diff] [blame] | 380 | AC_SUBST(SQLITE_OS_UNIX) |
| 381 | AC_SUBST(SQLITE_OS_WIN) |
| 382 | AC_SUBST(SQLITE_OS_OS2) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 383 | AC_SUBST(TARGET_EXEEXT) |
| 384 | |
| 385 | ########## |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 386 | # Figure out all the parameters needed to compile against Tcl. |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 387 | # |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 388 | # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG |
| 389 | # macros in the in the tcl.m4 file of the standard TCL distribution. |
| 390 | # Those macros could not be used directly since we have to make some |
| 391 | # minor changes to accomodate systems that do not have TCL installed. |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 392 | # |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 393 | 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] | 394 | [use_tcl=$enableval],[use_tcl=yes]) |
| 395 | if test "${use_tcl}" = "yes" ; then |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 396 | 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] | 397 | AC_MSG_CHECKING([for Tcl configuration]) |
| 398 | AC_CACHE_VAL(ac_cv_c_tclconfig,[ |
| 399 | # First check to see if --with-tcl was specified. |
| 400 | if test x"${with_tclconfig}" != x ; then |
| 401 | if test -f "${with_tclconfig}/tclConfig.sh" ; then |
| 402 | ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` |
| 403 | else |
| 404 | AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) |
| 405 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 406 | fi |
vapier | fe7e82e | 2009-01-26 21:39:33 +0000 | [diff] [blame] | 407 | |
| 408 | # Start autosearch by asking tclsh |
| 409 | if test x"$cross_compiling" = xno; then |
| 410 | for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` |
| 411 | do |
| 412 | if test -f "$i/tclConfig.sh" ; then |
| 413 | ac_cv_c_tclconfig="$i" |
| 414 | break |
| 415 | fi |
| 416 | done |
| 417 | fi |
| 418 | |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 419 | # then check for a private Tcl installation |
| 420 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 421 | for i in \ |
| 422 | ../tcl \ |
| 423 | `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 424 | `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 425 | `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ |
| 426 | ../../tcl \ |
| 427 | `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 428 | `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 429 | `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ |
| 430 | ../../../tcl \ |
| 431 | `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 432 | `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 433 | `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` |
| 434 | do |
| 435 | if test -f "$i/unix/tclConfig.sh" ; then |
| 436 | ac_cv_c_tclconfig=`(cd $i/unix; pwd)` |
| 437 | break |
| 438 | fi |
| 439 | done |
| 440 | fi |
| 441 | |
| 442 | # check in a few common install locations |
| 443 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 444 | for i in \ |
| 445 | `ls -d ${libdir} 2>/dev/null` \ |
| 446 | `ls -d /usr/local/lib 2>/dev/null` \ |
| 447 | `ls -d /usr/contrib/lib 2>/dev/null` \ |
| 448 | `ls -d /usr/lib 2>/dev/null` |
| 449 | do |
| 450 | if test -f "$i/tclConfig.sh" ; then |
| 451 | ac_cv_c_tclconfig=`(cd $i; pwd)` |
| 452 | break |
| 453 | fi |
| 454 | done |
| 455 | fi |
| 456 | |
| 457 | # check in a few other private locations |
| 458 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 459 | for i in \ |
| 460 | ${srcdir}/../tcl \ |
| 461 | `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
| 462 | `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
| 463 | `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` |
| 464 | do |
| 465 | if test -f "$i/unix/tclConfig.sh" ; then |
| 466 | ac_cv_c_tclconfig=`(cd $i/unix; pwd)` |
| 467 | break |
| 468 | fi |
| 469 | done |
| 470 | fi |
| 471 | ]) |
| 472 | |
| 473 | if test x"${ac_cv_c_tclconfig}" = x ; then |
| 474 | use_tcl=no |
| 475 | AC_MSG_WARN(Can't find Tcl configuration definitions) |
| 476 | AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***) |
| 477 | AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***) |
| 478 | else |
| 479 | TCL_BIN_DIR=${ac_cv_c_tclconfig} |
| 480 | AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) |
| 481 | |
| 482 | AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) |
| 483 | if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then |
| 484 | AC_MSG_RESULT([loading]) |
| 485 | . $TCL_BIN_DIR/tclConfig.sh |
| 486 | else |
| 487 | AC_MSG_RESULT([file not found]) |
| 488 | fi |
| 489 | |
| 490 | # |
| 491 | # If the TCL_BIN_DIR is the build directory (not the install directory), |
| 492 | # then set the common variable name to the value of the build variables. |
| 493 | # For example, the variable TCL_LIB_SPEC will be set to the value |
| 494 | # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC |
| 495 | # instead of TCL_BUILD_LIB_SPEC since it will work with both an |
| 496 | # installed and uninstalled version of Tcl. |
| 497 | # |
| 498 | |
mlcreech | ab1c47b | 2008-03-09 02:51:10 +0000 | [diff] [blame] | 499 | if test -f $TCL_BIN_DIR/Makefile ; then |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 500 | TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} |
| 501 | TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} |
| 502 | TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} |
| 503 | fi |
| 504 | |
| 505 | # |
| 506 | # eval is required to do the TCL_DBGX substitution |
| 507 | # |
| 508 | |
| 509 | eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" |
| 510 | eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" |
| 511 | eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" |
| 512 | |
| 513 | eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" |
| 514 | eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" |
| 515 | eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" |
| 516 | |
| 517 | AC_SUBST(TCL_VERSION) |
| 518 | AC_SUBST(TCL_BIN_DIR) |
| 519 | AC_SUBST(TCL_SRC_DIR) |
| 520 | AC_SUBST(TCL_LIBS) |
| 521 | AC_SUBST(TCL_INCLUDE_SPEC) |
| 522 | |
| 523 | AC_SUBST(TCL_LIB_FILE) |
| 524 | AC_SUBST(TCL_LIB_FLAG) |
| 525 | AC_SUBST(TCL_LIB_SPEC) |
| 526 | |
| 527 | AC_SUBST(TCL_STUB_LIB_FILE) |
| 528 | AC_SUBST(TCL_STUB_LIB_FLAG) |
| 529 | AC_SUBST(TCL_STUB_LIB_SPEC) |
| 530 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 531 | fi |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 532 | if test "${use_tcl}" = "no" ; then |
| 533 | HAVE_TCL="" |
| 534 | else |
| 535 | HAVE_TCL=1 |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 536 | fi |
drh | 7b5717e | 2004-11-25 13:50:01 +0000 | [diff] [blame] | 537 | AC_SUBST(HAVE_TCL) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 538 | |
| 539 | ########## |
| 540 | # Figure out what C libraries are required to compile programs |
| 541 | # that use "readline()" library. |
| 542 | # |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 543 | TARGET_READLINE_LIBS="" |
| 544 | TARGET_READLINE_INC="" |
| 545 | TARGET_HAVE_READLINE=0 |
| 546 | AC_ARG_ENABLE([readline], |
| 547 | [AC_HELP_STRING([--disable-readline],[disable readline support [default=detect]])], |
| 548 | [with_readline=$enableval], |
| 549 | [with_readline=auto]) |
| 550 | |
| 551 | if test x"$with_readline" != xno; then |
| 552 | found="yes" |
| 553 | |
| 554 | AC_ARG_WITH([readline-lib], |
| 555 | [AC_HELP_STRING([--with-readline-lib],[specify readline library])], |
| 556 | [with_readline_lib=$withval], |
| 557 | [with_readline_lib="auto"]) |
| 558 | if test "x$with_readline_lib" = xauto; then |
| 559 | save_LIBS="$LIBS" |
| 560 | LIBS="" |
| 561 | AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""]) |
| 562 | AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"]) |
| 563 | TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS" |
| 564 | LIBS="$save_LIBS" |
| 565 | else |
| 566 | TARGET_READLINE_LIBS="$with_readline_lib" |
| 567 | fi |
| 568 | |
| 569 | AC_ARG_WITH([readline-inc], |
| 570 | [AC_HELP_STRING([--with-readline-inc],[specify readline include paths])], |
| 571 | [with_readline_inc=$withval], |
| 572 | [with_readline_inc="auto"]) |
| 573 | if test "x$with_readline_inc" = xauto; then |
| 574 | AC_CHECK_HEADER(readline.h, [found="yes"], [ |
| 575 | found="no" |
| 576 | if test "$cross_compiling" != yes; then |
| 577 | for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do |
| 578 | for subdir in include include/readline; do |
| 579 | AC_CHECK_FILE($dir/$subdir/readline.h, found=yes) |
| 580 | if test "$found" = "yes"; then |
| 581 | TARGET_READLINE_INC="-I$dir/$subdir" |
| 582 | break |
| 583 | fi |
| 584 | done |
| 585 | test "$found" = "yes" && break |
| 586 | done |
| 587 | fi |
| 588 | ]) |
| 589 | else |
| 590 | TARGET_READLINE_INC="$with_readline_inc" |
| 591 | fi |
| 592 | |
| 593 | if test x"$found" = xno; then |
| 594 | TARGET_READLINE_LIBS="" |
| 595 | TARGET_READLINE_INC="" |
| 596 | TARGET_HAVE_READLINE=0 |
| 597 | else |
| 598 | TARGET_HAVE_READLINE=1 |
| 599 | fi |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 600 | fi |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 601 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 602 | AC_SUBST(TARGET_READLINE_LIBS) |
vapier | 4c10a8a | 2007-02-17 14:28:26 +0000 | [diff] [blame] | 603 | AC_SUBST(TARGET_READLINE_INC) |
| 604 | AC_SUBST(TARGET_HAVE_READLINE) |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 605 | |
| 606 | ########## |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 607 | # Figure out what C libraries are required to compile programs |
| 608 | # that use "fdatasync()" function. |
| 609 | # |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 610 | AC_SEARCH_LIBS(fdatasync, [rt]) |
drh | f1878b4 | 2006-01-23 18:06:52 +0000 | [diff] [blame] | 611 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 612 | ######### |
tpoindex | 9d9f76c | 2005-01-03 21:28:56 +0000 | [diff] [blame] | 613 | # check for debug enabled |
drh | 94e4f82 | 2006-02-15 02:00:25 +0000 | [diff] [blame] | 614 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]), |
tpoindex | 9d9f76c | 2005-01-03 21:28:56 +0000 | [diff] [blame] | 615 | [use_debug=$enableval],[use_debug=no]) |
| 616 | if test "${use_debug}" = "yes" ; then |
drh | eae3a0d | 2006-03-03 20:37:52 +0000 | [diff] [blame] | 617 | TARGET_DEBUG="-DSQLITE_DEBUG=1" |
tpoindex | 9d9f76c | 2005-01-03 21:28:56 +0000 | [diff] [blame] | 618 | else |
| 619 | TARGET_DEBUG="-DNDEBUG" |
| 620 | fi |
| 621 | AC_SUBST(TARGET_DEBUG) |
| 622 | |
| 623 | ######### |
mlcreech | 9498491 | 2008-03-04 19:03:08 +0000 | [diff] [blame] | 624 | # See whether we should use the amalgamation to build |
| 625 | AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation], |
mlcreech | 969b2cd | 2008-03-14 04:11:03 +0000 | [diff] [blame] | 626 | [Disable the amalgamation and instead build all files separately]), |
mlcreech | 9498491 | 2008-03-04 19:03:08 +0000 | [diff] [blame] | 627 | [use_amalgamation=$enableval],[use_amalgamation=yes]) |
mlcreech | f386811 | 2008-03-11 18:03:30 +0000 | [diff] [blame] | 628 | if test "${use_amalgamation}" != "yes" ; then |
mlcreech | 9498491 | 2008-03-04 19:03:08 +0000 | [diff] [blame] | 629 | USE_AMALGAMATION=0 |
| 630 | fi |
| 631 | AC_SUBST(USE_AMALGAMATION) |
| 632 | |
| 633 | ######### |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 634 | # See whether we should allow loadable extensions |
| 635 | AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--enable-load-extension], |
| 636 | [Enable loading of external extensions]), |
| 637 | [use_loadextension=$enableval],[use_loadextension=no]) |
| 638 | if test "${use_loadextension}" = "yes" ; then |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 639 | OPT_FEATURE_FLAGS="" |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 640 | else |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 641 | OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 642 | fi |
mlcreech | a4edab0 | 2008-03-06 04:14:17 +0000 | [diff] [blame] | 643 | |
mlcreech | aac7b93 | 2008-04-01 02:45:22 +0000 | [diff] [blame] | 644 | ######### |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 645 | # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 646 | for option in $CFLAGS $CPPFLAGS |
| 647 | do |
| 648 | case $option in |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 649 | -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 650 | -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 651 | esac |
| 652 | done |
| 653 | AC_SUBST(OPT_FEATURE_FLAGS) |
| 654 | |
| 655 | |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 656 | # attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 657 | ac_temp_CFLAGS="" |
| 658 | for option in $CFLAGS |
| 659 | do |
| 660 | case $option in |
| 661 | -DSQLITE_OMIT*) ;; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 662 | -DSQLITE_ENABLE*) ;; |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 663 | *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 664 | esac |
| 665 | done |
| 666 | CFLAGS=$ac_temp_CFLAGS |
| 667 | |
| 668 | |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 669 | # attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 670 | ac_temp_CPPFLAGS="" |
| 671 | for option in $CPPFLAGS |
| 672 | do |
| 673 | case $option in |
| 674 | -DSQLITE_OMIT*) ;; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 675 | -DSQLITE_ENABLE*) ;; |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 676 | *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 677 | esac |
| 678 | done |
| 679 | CPPFLAGS=$ac_temp_CPPFLAGS |
| 680 | |
| 681 | |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 682 | # attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 683 | ac_temp_BUILD_CFLAGS="" |
| 684 | for option in $BUILD_CFLAGS |
| 685 | do |
| 686 | case $option in |
| 687 | -DSQLITE_OMIT*) ;; |
shane | b1cd730 | 2008-10-22 18:27:31 +0000 | [diff] [blame] | 688 | -DSQLITE_ENABLE*) ;; |
danielk1977 | 33a1478 | 2008-08-04 14:50:05 +0000 | [diff] [blame] | 689 | *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";; |
shane | fbedede | 2008-07-22 05:05:01 +0000 | [diff] [blame] | 690 | esac |
| 691 | done |
| 692 | BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS |
| 693 | |
| 694 | |
| 695 | ######### |
| 696 | # See whether we should use GCOV |
mlcreech | aac7b93 | 2008-04-01 02:45:22 +0000 | [diff] [blame] | 697 | AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov], |
| 698 | [Enable coverage testing using gcov]), |
| 699 | [use_gcov=$enableval],[use_gcov=no]) |
| 700 | if test "${use_gcov}" = "yes" ; then |
| 701 | USE_GCOV=1 |
| 702 | else |
| 703 | USE_GCOV=0 |
| 704 | fi |
| 705 | AC_SUBST(USE_GCOV) |
| 706 | |
drh | af6edf5 | 2005-10-04 18:38:49 +0000 | [diff] [blame] | 707 | |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 708 | ######### |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 709 | # Output the config header |
mlcreech | 2379706 | 2008-03-20 02:25:35 +0000 | [diff] [blame] | 710 | AC_CONFIG_HEADERS(config.h) |
mlcreech | b87057f | 2008-03-06 07:19:20 +0000 | [diff] [blame] | 711 | |
| 712 | ######### |
drh | 71eb93e | 2001-09-28 01:34:43 +0000 | [diff] [blame] | 713 | # Generate the output files. |
| 714 | # |
mlcreech | 8390bc3 | 2008-03-06 08:54:38 +0000 | [diff] [blame] | 715 | AC_SUBST(BUILD_CFLAGS) |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 716 | AC_OUTPUT([ |
| 717 | Makefile |
dougcurrie | 12b3444 | 2004-07-19 03:24:59 +0000 | [diff] [blame] | 718 | sqlite3.pc |
a.rottmann | c7e9383 | 2003-03-24 09:39:32 +0000 | [diff] [blame] | 719 | ]) |