Snapshot of upstream SQLite 3.8.4.3
[sqlcipher.git] / configure.ac
blob2e70f2c235600ded1cd487ef1341e6fd674babc7
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:
7 #    srcdir
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.
13 #    bindir
15 #        The name of the directory where executables should be
16 #        written by the "install" target of the makefile.
18 #    program_prefix
20 #        Add this prefix to the names of all executables that run
21 #        on the target machine.  Default: ""
23 #    ENABLE_SHARED
25 #        True if shared libraries should be generated.
27 #    BUILD_CC
29 #        The name of a command that is used to convert C
30 #        source files into executables that run on the build
31 #        platform.
33 #    BUILD_CFLAGS
35 #        Switches that the build compiler needs in order to construct
36 #        command-line programs.
38 #    BUILD_LIBS
40 #        Libraries that the build compiler needs in order to construct
41 #        command-line programs.
43 #    BUILD_EXEEXT
45 #        The filename extension for executables on the build
46 #        platform.  "" for Unix and ".exe" for Windows.
48 #    TCL_*
50 #        Lots of values are read in from the tclConfig.sh script,
51 #        if that script is available.  This values are used for
52 #        constructing and installing the TCL extension.
54 #    TARGET_READLINE_LIBS
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".
61 #    TARGET_READLINE_INC
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.
67 #    TARGET_EXEEXT
69 #        The filename extension for executables on the
70 #        target platform.  "" for Unix and ".exe" for windows.
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:
80 #           configure --with-hints=FILE
82 # where FILE is the name of the file that sets the environment
83 # variables.  FILE should be an absolute pathname.
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.
90 AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n']))
92 dnl Make sure the local VERSION file matches this configure script
93 sqlite_version_sanity_check=`cat $srcdir/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])
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
104 # $Revision: 1.56 $
106 #########
107 # Programs needed
109 AC_PROG_LIBTOOL
110 AC_PROG_INSTALL
111 AC_PROG_AWK
113 #########
114 # Enable large file support (if special flags are necessary)
116 AC_SYS_LARGEFILE
118 #########
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])
123 #########
124 # Check for needed/wanted headers
125 AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h])
127 #########
128 # Figure out whether or not we have these functions
130 AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_usable_size])
132 #########
133 # By default, we use the amalgamation (this may be changed below...)
135 USE_AMALGAMATION=1
137 #########
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?
142 AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh8.5 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"
150 AC_SUBST(TCLSH_CMD)
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"
163 #########
164 # Set up an appropriate program prefix
166 if test "$program_prefix" = "NONE"; then
167   program_prefix=""
169 AC_SUBST(program_prefix)
171 VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`]
172 AC_MSG_NOTICE(Version set to $VERSION)
173 AC_SUBST(VERSION)
174 RELEASE=`cat $srcdir/VERSION`
175 AC_MSG_NOTICE(Release set to $RELEASE)
176 AC_SUBST(RELEASE)
177 VERSION_NUMBER=[`cat $srcdir/VERSION \
178                            | sed 's/[^0-9]/ /g' \
179                 | awk '{printf "%d%03d%03d",$1,$2,$3}'`]
180 AC_MSG_NOTICE(Version number set to $VERSION_NUMBER)
181 AC_SUBST(VERSION_NUMBER)
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.
190 AC_ARG_WITH(hints,
191   AC_HELP_STRING([--with-hints=FILE],[Read configuration options from FILE]),
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
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
213 if test "$hints" != ""; then
214   AC_MSG_RESULT(reading hints from $hints)
215   . $hints
218 #########
219 # Locate a compiler for the build machine.  This compiler should
220 # generate command-line programs that run on the build machine.
222 if test x"$cross_compiling" = xno; then
223         BUILD_CC=$CC
224         BUILD_CFLAGS=$CFLAGS
225 else
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
233 AC_SUBST(BUILD_CC)
235 ##########
236 # Do we want to support multithreaded use of sqlite
238 AC_ARG_ENABLE(threadsafe, 
239 AC_HELP_STRING([--enable-threadsafe],[Support threadsafe operation]),,enable_threadsafe=yes)
240 AC_MSG_CHECKING([whether to support threadsafe operation])
241 if test "$enable_threadsafe" = "no"; then
242   SQLITE_THREADSAFE=0
243   AC_MSG_RESULT([no])
244 else
245   SQLITE_THREADSAFE=1
246   AC_MSG_RESULT([yes])
248 AC_SUBST(SQLITE_THREADSAFE)
250 if test "$SQLITE_THREADSAFE" = "1"; then
251   AC_SEARCH_LIBS(pthread_create, pthread)
254 ##########
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.
259 AC_ARG_ENABLE(cross-thread-connections, 
260 AC_HELP_STRING([--enable-cross-thread-connections],[Allow connection sharing across threads]),,enable_xthreadconnect=no)
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])
269 AC_SUBST(XTHREADCONNECT)
271 ##########
272 # Do we want to support release
274 AC_ARG_ENABLE(releasemode, 
275 AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no)
276 AC_MSG_CHECKING([whether to support shared library linked as release mode or not])
277 if test "$enable_releasemode" = "no"; then
278   ALLOWRELEASE=""
279   AC_MSG_RESULT([no])
280 else
281   ALLOWRELEASE="-release `cat $srcdir/VERSION`"
282   AC_MSG_RESULT([yes])
284 AC_SUBST(ALLOWRELEASE)
286 ##########
287 # Do we want temporary databases in memory
289 AC_ARG_ENABLE(tempstore, 
290 AC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no)
291 AC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
292 case "$enable_tempstore" in
293   never ) 
294     TEMP_STORE=0
295     AC_MSG_RESULT([never])
296   ;;
297   no ) 
298     TEMP_STORE=1
299     AC_MSG_RESULT([no])
300   ;;
301   yes ) 
302      TEMP_STORE=2
303     AC_MSG_RESULT([yes])
304   ;;
305   always ) 
306      TEMP_STORE=3
307     AC_MSG_RESULT([always])
308   ;;
309   * ) 
310     TEMP_STORE=1
311     AC_MSG_RESULT([no])
312   ;;
313 esac
315 AC_SUBST(TEMP_STORE)
317 ###########
318 # Lots of things are different if we are compiling for Windows using
319 # the CYGWIN environment.  So check for that special case and handle
320 # things accordingly.
322 AC_MSG_CHECKING([if executables have the .exe suffix])
323 if test "$config_BUILD_EXEEXT" = ".exe"; then
324   CYGWIN=yes
325   AC_MSG_RESULT(yes)
326 else
327   AC_MSG_RESULT(unknown)
329 if test "$CYGWIN" != "yes"; then
330   AC_CYGWIN
332 if test "$CYGWIN" = "yes"; then
333   BUILD_EXEEXT=.exe
334 else
335   BUILD_EXEEXT=$EXEEXT
337 if test x"$cross_compiling" = xno; then
338   TARGET_EXEEXT=$BUILD_EXEEXT
339 else
340   TARGET_EXEEXT=$config_TARGET_EXEEXT
342 if test "$TARGET_EXEEXT" = ".exe"; then
343   SQLITE_OS_UNIX=0
344   SQLITE_OS_WIN=1
345   CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1"
346 else
347   SQLITE_OS_UNIX=1
348   SQLITE_OS_WIN=0
349   CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1"
352 AC_SUBST(BUILD_EXEEXT)
353 AC_SUBST(SQLITE_OS_UNIX)
354 AC_SUBST(SQLITE_OS_WIN)
355 AC_SUBST(TARGET_EXEEXT)
357 ##########
358 # Figure out all the parameters needed to compile against Tcl.
360 # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
361 # macros in the in the tcl.m4 file of the standard TCL distribution.
362 # Those macros could not be used directly since we have to make some
363 # minor changes to accomodate systems that do not have TCL installed.
365 AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]),
366       [use_tcl=$enableval],[use_tcl=yes])
367 if test "${use_tcl}" = "yes" ; then
368   AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval})
369   AC_MSG_CHECKING([for Tcl configuration])
370   AC_CACHE_VAL(ac_cv_c_tclconfig,[
371     # First check to see if --with-tcl was specified.
372     if test x"${with_tclconfig}" != x ; then
373       if test -f "${with_tclconfig}/tclConfig.sh" ; then
374         ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
375       else
376         AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
377       fi
378     fi
380     # Start autosearch by asking tclsh
381     if test x"${ac_cv_c_tclconfig}" = x ; then
382       if test x"$cross_compiling" = xno; then
383         for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}`
384         do
385           if test -f "$i/tclConfig.sh" ; then
386             ac_cv_c_tclconfig="$i"
387             break
388           fi
389         done
390       fi
391     fi
393     # then check for a private Tcl installation
394     if test x"${ac_cv_c_tclconfig}" = x ; then
395       for i in \
396             ../tcl \
397             `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
398             `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
399             `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
400             ../../tcl \
401             `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
402             `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
403             `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
404             ../../../tcl \
405             `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
406             `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
407             `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null`
408       do
409         if test -f "$i/unix/tclConfig.sh" ; then
410           ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
411           break
412         fi
413       done
414     fi
416     # check in a few common install locations
417     if test x"${ac_cv_c_tclconfig}" = x ; then
418       for i in \
419             `ls -d ${libdir} 2>/dev/null` \
420             `ls -d /usr/local/lib 2>/dev/null` \
421             `ls -d /usr/contrib/lib 2>/dev/null` \
422             `ls -d /usr/lib 2>/dev/null`
423       do
424         if test -f "$i/tclConfig.sh" ; then
425            ac_cv_c_tclconfig=`(cd $i; pwd)`
426            break
427         fi
428       done
429     fi
431     # check in a few other private locations
432     if test x"${ac_cv_c_tclconfig}" = x ; then
433       for i in \
434          ${srcdir}/../tcl \
435          `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
436          `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
437          `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null`
438       do
439         if test -f "$i/unix/tclConfig.sh" ; then
440           ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
441           break
442         fi
443       done
444     fi
445   ])
447   if test x"${ac_cv_c_tclconfig}" = x ; then
448     use_tcl=no
449     AC_MSG_WARN(Can't find Tcl configuration definitions)
450     AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***)
451     AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***)
452   else
453     TCL_BIN_DIR=${ac_cv_c_tclconfig}
454     AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
456     AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
457     if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
458       AC_MSG_RESULT([loading])
459       . $TCL_BIN_DIR/tclConfig.sh
460     else
461       AC_MSG_RESULT([file not found])
462     fi
463     
464     #
465     # If the TCL_BIN_DIR is the build directory (not the install directory),
466     # then set the common variable name to the value of the build variables.
467     # For example, the variable TCL_LIB_SPEC will be set to the value
468     # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
469     # instead of TCL_BUILD_LIB_SPEC since it will work with both an
470     # installed and uninstalled version of Tcl.
471     #
472     
473     if test -f $TCL_BIN_DIR/Makefile ; then
474       TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
475       TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
476       TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
477     fi
478     
479     #
480     # eval is required to do the TCL_DBGX substitution
481     #
482     
483     eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
484     eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
485     eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
486     
487     eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
488     eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
489     eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
490     
491     AC_SUBST(TCL_VERSION)
492     AC_SUBST(TCL_BIN_DIR)
493     AC_SUBST(TCL_SRC_DIR)
494     AC_SUBST(TCL_INCLUDE_SPEC)
495     
496     AC_SUBST(TCL_LIB_FILE)
497     AC_SUBST(TCL_LIB_FLAG)
498     AC_SUBST(TCL_LIB_SPEC)
499     
500     AC_SUBST(TCL_STUB_LIB_FILE)
501     AC_SUBST(TCL_STUB_LIB_FLAG)
502     AC_SUBST(TCL_STUB_LIB_SPEC)
503   fi
505 if test "${use_tcl}" = "no" ; then
506   HAVE_TCL=""
507 else
508   HAVE_TCL=1
510 AC_SUBST(HAVE_TCL)
512 ##########
513 # Figure out what C libraries are required to compile programs
514 # that use "readline()" library.
516 TARGET_READLINE_LIBS=""
517 TARGET_READLINE_INC=""
518 TARGET_HAVE_READLINE=0
519 AC_ARG_ENABLE([readline],
520         [AC_HELP_STRING([--disable-readline],[disable readline support [default=detect]])],
521         [with_readline=$enableval],
522         [with_readline=auto])
524 if test x"$with_readline" != xno; then
525         found="yes"
527         AC_ARG_WITH([readline-lib],
528                 [AC_HELP_STRING([--with-readline-lib],[specify readline library])],
529                 [with_readline_lib=$withval],
530                 [with_readline_lib="auto"])
531         if test "x$with_readline_lib" = xauto; then
532                 save_LIBS="$LIBS"
533                 LIBS=""
534                 AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""])
535                 AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"])
536                 TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS"
537                 LIBS="$save_LIBS"
538         else
539                 TARGET_READLINE_LIBS="$with_readline_lib"
540         fi
542         AC_ARG_WITH([readline-inc],
543                 [AC_HELP_STRING([--with-readline-inc],[specify readline include paths])],
544                 [with_readline_inc=$withval],
545                 [with_readline_inc="auto"])
546         if test "x$with_readline_inc" = xauto; then
547                 AC_CHECK_HEADER(readline.h, [found="yes"], [
548                         found="no"
549                         if test "$cross_compiling" != yes; then
550                                 for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
551                                         for subdir in include include/readline; do
552                                                 AC_CHECK_FILE($dir/$subdir/readline.h, found=yes)
553                                                 if test "$found" = "yes"; then
554                                                         TARGET_READLINE_INC="-I$dir/$subdir"
555                                                         break
556                                                 fi
557                                         done
558                                         test "$found" = "yes" && break
559                                 done
560                         fi
561                 ])
562         else
563                 TARGET_READLINE_INC="$with_readline_inc"
564         fi
566         if test x"$found" = xno; then
567                 TARGET_READLINE_LIBS=""
568                 TARGET_READLINE_INC=""
569                 TARGET_HAVE_READLINE=0
570         else
571                 TARGET_HAVE_READLINE=1
572         fi
575 AC_SUBST(TARGET_READLINE_LIBS)
576 AC_SUBST(TARGET_READLINE_INC)
577 AC_SUBST(TARGET_HAVE_READLINE)
579 ##########
580 # Figure out what C libraries are required to compile programs
581 # that use "fdatasync()" function.
583 AC_SEARCH_LIBS(fdatasync, [rt])
585 #########
586 # check for debug enabled
587 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]),
588       [use_debug=$enableval],[use_debug=no])
589 if test "${use_debug}" = "yes" ; then
590   TARGET_DEBUG="-DSQLITE_DEBUG=1"
591 else
592   TARGET_DEBUG="-DNDEBUG"
594 AC_SUBST(TARGET_DEBUG)
596 #########
597 # See whether we should use the amalgamation to build
598 AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation],
599       [Disable the amalgamation and instead build all files separately]),
600       [use_amalgamation=$enableval],[use_amalgamation=yes])
601 if test "${use_amalgamation}" != "yes" ; then
602   USE_AMALGAMATION=0
604 AC_SUBST(USE_AMALGAMATION)
606 #########
607 # See whether we should allow loadable extensions
608 AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--enable-load-extension],
609       [Enable loading of external extensions]),
610       [use_loadextension=$enableval],[use_loadextension=no])
611 if test "${use_loadextension}" = "yes" ; then
612   OPT_FEATURE_FLAGS=""
613   AC_SEARCH_LIBS(dlopen, dl)
614 else
615   OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
618 #########
619 # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter
620 for option in $CFLAGS $CPPFLAGS
622   case $option in
623     -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
624     -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
625   esac
626 done
627 AC_SUBST(OPT_FEATURE_FLAGS)
630 # attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter
631 ac_temp_CFLAGS=""
632 for option in $CFLAGS
634   case $option in
635     -DSQLITE_OMIT*) ;;
636     -DSQLITE_ENABLE*) ;;
637     *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";;
638   esac
639 done
640 CFLAGS=$ac_temp_CFLAGS
643 # attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter
644 ac_temp_CPPFLAGS=""
645 for option in $CPPFLAGS
647   case $option in
648     -DSQLITE_OMIT*) ;;
649     -DSQLITE_ENABLE*) ;;
650     *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";;
651   esac
652 done
653 CPPFLAGS=$ac_temp_CPPFLAGS
656 # attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter
657 ac_temp_BUILD_CFLAGS=""
658 for option in $BUILD_CFLAGS
660   case $option in
661     -DSQLITE_OMIT*) ;;
662     -DSQLITE_ENABLE*) ;;
663     *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";;
664   esac
665 done
666 BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS
669 #########
670 # See whether we should use GCOV
671 AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov],
672       [Enable coverage testing using gcov]),
673       [use_gcov=$enableval],[use_gcov=no])
674 if test "${use_gcov}" = "yes" ; then
675   USE_GCOV=1
676 else
677   USE_GCOV=0
679 AC_SUBST(USE_GCOV)
682 #########
683 # Output the config header
684 AC_CONFIG_HEADERS(config.h)
686 #########
687 # Generate the output files.
689 AC_SUBST(BUILD_CFLAGS)
690 AC_OUTPUT([
691 Makefile
692 sqlite3.pc