xref: /sqlite-3.40.0/configure.ac (revision a4b2f419)
171eb93eaSdrh#
271eb93eaSdrh# The build process allows for using a cross-compiler.  But the default
371eb93eaSdrh# action is to target the same platform that we are running on.  The
471eb93eaSdrh# configure script needs to discover the following properties of the
571eb93eaSdrh# build and target systems:
671eb93eaSdrh#
771eb93eaSdrh#    srcdir
871eb93eaSdrh#
971eb93eaSdrh#        The is the name of the directory that contains the
1071eb93eaSdrh#        "configure" shell script.  All source files are
1171eb93eaSdrh#        located relative to this directory.
1271eb93eaSdrh#
1371eb93eaSdrh#    bindir
1471eb93eaSdrh#
1571eb93eaSdrh#        The name of the directory where executables should be
1671eb93eaSdrh#        written by the "install" target of the makefile.
1771eb93eaSdrh#
1871eb93eaSdrh#    program_prefix
1971eb93eaSdrh#
2071eb93eaSdrh#        Add this prefix to the names of all executables that run
2171eb93eaSdrh#        on the target machine.  Default: ""
2271eb93eaSdrh#
2371eb93eaSdrh#    ENABLE_SHARED
2471eb93eaSdrh#
2571eb93eaSdrh#        True if shared libraries should be generated.
2671eb93eaSdrh#
2771eb93eaSdrh#    BUILD_CC
2871eb93eaSdrh#
2971eb93eaSdrh#        The name of a command that is used to convert C
3071eb93eaSdrh#        source files into executables that run on the build
3171eb93eaSdrh#        platform.
3271eb93eaSdrh#
3371eb93eaSdrh#    BUILD_CFLAGS
3471eb93eaSdrh#
3571eb93eaSdrh#        Switches that the build compiler needs in order to construct
3671eb93eaSdrh#        command-line programs.
3771eb93eaSdrh#
3871eb93eaSdrh#    BUILD_LIBS
3971eb93eaSdrh#
4071eb93eaSdrh#        Libraries that the build compiler needs in order to construct
4171eb93eaSdrh#        command-line programs.
4271eb93eaSdrh#
4371eb93eaSdrh#    BUILD_EXEEXT
4471eb93eaSdrh#
4571eb93eaSdrh#        The filename extension for executables on the build
4671eb93eaSdrh#        platform.  "" for Unix and ".exe" for Windows.
4771eb93eaSdrh#
487b5717e1Sdrh#    TCL_*
4971eb93eaSdrh#
507b5717e1Sdrh#        Lots of values are read in from the tclConfig.sh script,
514b2266aeSdrh#        if that script is available.  This values are used for
524b2266aeSdrh#        constructing and installing the TCL extension.
5371eb93eaSdrh#
5471eb93eaSdrh#    TARGET_READLINE_LIBS
5571eb93eaSdrh#
5671eb93eaSdrh#        This is the library directives passed to the target linker
5771eb93eaSdrh#        that cause the executable to link against the readline library.
5871eb93eaSdrh#        This might be a switch like "-lreadline" or pathnames of library
5971eb93eaSdrh#        file like "../../src/libreadline.a".
6071eb93eaSdrh#
6171eb93eaSdrh#    TARGET_READLINE_INC
6271eb93eaSdrh#
6371eb93eaSdrh#        This variables define the directory that contain header
6471eb93eaSdrh#        files for the readline library.  If the compiler is able
6571eb93eaSdrh#        to find <readline.h> on its own, then this can be blank.
6671eb93eaSdrh#
6771eb93eaSdrh#    TARGET_EXEEXT
6871eb93eaSdrh#
6971eb93eaSdrh#        The filename extension for executables on the
7071eb93eaSdrh#        target platform.  "" for Unix and ".exe" for windows.
7171eb93eaSdrh#
7271eb93eaSdrh# This configure.in file is easy to reuse on other projects.  Just
7371eb93eaSdrh# change the argument to AC_INIT().  And disable any features that
7471eb93eaSdrh# you don't need (for example BLT) by erasing or commenting out
7571eb93eaSdrh# the corresponding code.
7671eb93eaSdrh#
77b87057f2SmlcreechAC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n']))
7871eb93eaSdrh
79faa68dbbSvapierdnl Make sure the local VERSION file matches this configure script
806f050aa2Sdanielk1977sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'`
81faa68dbbSvapierif test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then
82faa68dbbSvapierAC_MSG_ERROR([configure script is out of date:
83faa68dbbSvapier configure \$PACKAGE_VERSION = $PACKAGE_VERSION
84faa68dbbSvapier top level VERSION file     = $sqlite_version_sanity_check
85faa68dbbSvapierplease regen with autoconf])
86faa68dbbSvapierfi
87faa68dbbSvapier
8871eb93eaSdrh#########
8971eb93eaSdrh# Programs needed
9071eb93eaSdrh#
9171eb93eaSdrhAC_PROG_LIBTOOL
9271eb93eaSdrhAC_PROG_INSTALL
9371eb93eaSdrh
9471eb93eaSdrh#########
95636a995dSmlcreech# Enable large file support (if special flags are necessary)
96636a995dSmlcreech#
97636a995dSmlcreechAC_SYS_LARGEFILE
98636a995dSmlcreech
99636a995dSmlcreech#########
100b87057f2Smlcreech# Check for needed/wanted data types
101b87057f2SmlcreechAC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t,
102b87057f2Smlcreech                uint16_t, uint32_t, uint64_t, uintptr_t])
103b87057f2Smlcreech
104b87057f2Smlcreech#########
105b87057f2Smlcreech# Check for needed/wanted headers
10686c5a930SdrhAC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h])
1075b0a9ebeSmlcreech
1085b0a9ebeSmlcreech#########
1095b0a9ebeSmlcreech# Figure out whether or not we have these functions
1105b0a9ebeSmlcreech#
111e32a256aSdrhAC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64])
1125b0a9ebeSmlcreech
113ab1c47b0Smlcreech#########
114f3868117Smlcreech# By default, we use the amalgamation (this may be changed below...)
115f3868117Smlcreech#
116f3868117SmlcreechUSE_AMALGAMATION=1
117f3868117Smlcreech
118f3868117Smlcreech#########
119ab1c47b0Smlcreech# See whether we can run specific tclsh versions known to work well;
120ab1c47b0Smlcreech# if not, then we fall back to plain tclsh.
121ab1c47b0Smlcreech# TODO: try other versions before falling back?
122ab1c47b0Smlcreech#
1230b11bcb3SdrhAC_CHECK_PROGS(TCLSH_CMD, [tclsh8.7 tclsh8.6 tclsh8.5 tclsh], none)
124f3868117Smlcreechif test "$TCLSH_CMD" = "none"; then
125f3868117Smlcreech  # If we can't find a local tclsh, then building the amalgamation will fail.
126f3868117Smlcreech  # We act as though --disable-amalgamation has been used.
127f3868117Smlcreech  echo "Warning: can't find tclsh - defaulting to non-amalgamation build."
128f3868117Smlcreech  USE_AMALGAMATION=0
129f3868117Smlcreech  TCLSH_CMD="tclsh"
130f3868117Smlcreechfi
131ab1c47b0SmlcreechAC_SUBST(TCLSH_CMD)
132ab1c47b0Smlcreech
1336d120f39SvapierAC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin])
1346d120f39Svapierif test "x${TCLLIBDIR+set}" != "xset" ; then
1356d120f39Svapier  TCLLIBDIR='$(libdir)'
1366d120f39Svapier  for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do
137ef36ccd1Sdan    if test -d $i ; then
1386d120f39Svapier      TCLLIBDIR=$i
1396d120f39Svapier      break
140ef36ccd1Sdan    fi
1416d120f39Svapier  done
1426d120f39Svapier  TCLLIBDIR="${TCLLIBDIR}/sqlite3"
1436d120f39Svapierfi
1446d120f39Svapier
145b87057f2Smlcreech
146b87057f2Smlcreech#########
14771eb93eaSdrh# Set up an appropriate program prefix
14871eb93eaSdrh#
14971eb93eaSdrhif test "$program_prefix" = "NONE"; then
15071eb93eaSdrh  program_prefix=""
15171eb93eaSdrhfi
15271eb93eaSdrhAC_SUBST(program_prefix)
15371eb93eaSdrh
1544b2266aeSdrhVERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`]
155695f0970SvapierAC_MSG_NOTICE(Version set to $VERSION)
156c7e9383aSa.rottmannAC_SUBST(VERSION)
1574b2266aeSdrhRELEASE=`cat $srcdir/VERSION`
158695f0970SvapierAC_MSG_NOTICE(Release set to $RELEASE)
1594b2266aeSdrhAC_SUBST(RELEASE)
160c7e9383aSa.rottmann
16171eb93eaSdrh#########
16271eb93eaSdrh# Locate a compiler for the build machine.  This compiler should
16371eb93eaSdrh# generate command-line programs that run on the build machine.
16471eb93eaSdrh#
165c8a15308Svapierif test x"$cross_compiling" = xno; then
16671eb93eaSdrh	BUILD_CC=$CC
167c8a15308Svapier	BUILD_CFLAGS=$CFLAGS
16871eb93eaSdrhelse
169c8a15308Svapier	if test "${BUILD_CC+set}" != set; then
170c8a15308Svapier		AC_CHECK_PROGS(BUILD_CC, gcc cc cl)
17171eb93eaSdrh	fi
172c8a15308Svapier	if test "${BUILD_CFLAGS+set}" != set; then
173c8a15308Svapier		BUILD_CFLAGS="-g"
17471eb93eaSdrh	fi
17571eb93eaSdrhfi
17671eb93eaSdrhAC_SUBST(BUILD_CC)
17771eb93eaSdrh
17871eb93eaSdrh##########
1790f290bf7Sdougcurrie# Do we want to support multithreaded use of sqlite
18071eb93eaSdrh#
1810f290bf7SdougcurrieAC_ARG_ENABLE(threadsafe,
1828fa622d6SdrhAC_HELP_STRING([--disable-threadsafe],[Disable mutexing]))
1830f290bf7SdougcurrieAC_MSG_CHECKING([whether to support threadsafe operation])
1840f290bf7Sdougcurrieif test "$enable_threadsafe" = "no"; then
1855a3032b3Sdrh  SQLITE_THREADSAFE=0
186b0208ccaSpaul  AC_MSG_RESULT([no])
187b0208ccaSpaulelse
1885a3032b3Sdrh  SQLITE_THREADSAFE=1
189b0208ccaSpaul  AC_MSG_RESULT([yes])
190b0208ccaSpaulfi
1915a3032b3SdrhAC_SUBST(SQLITE_THREADSAFE)
192b0208ccaSpaul
1935a3032b3Sdrhif test "$SQLITE_THREADSAFE" = "1"; then
194ba60fbb6Sdrh  AC_SEARCH_LIBS(pthread_create, pthread)
19513c808a9Sdrh  AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
19665623c78Sdougcurriefi
19765623c78Sdougcurrie
198b0208ccaSpaul##########
1993b5543c4Sxdong# Do we want to support release
2003b5543c4Sxdong#
2013b5543c4SxdongAC_ARG_ENABLE(releasemode,
20294e4f82fSdrhAC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no)
2033b5543c4SxdongAC_MSG_CHECKING([whether to support shared library linked as release mode or not])
2043b5543c4Sxdongif test "$enable_releasemode" = "no"; then
2053b5543c4Sxdong  ALLOWRELEASE=""
2063b5543c4Sxdong  AC_MSG_RESULT([no])
2073b5543c4Sxdongelse
2080b47d340Sdrh  ALLOWRELEASE="-release `cat $srcdir/VERSION`"
2093b5543c4Sxdong  AC_MSG_RESULT([yes])
2103b5543c4Sxdongfi
2113b5543c4SxdongAC_SUBST(ALLOWRELEASE)
2123b5543c4Sxdong
2133b5543c4Sxdong##########
214b0208ccaSpaul# Do we want temporary databases in memory
215b0208ccaSpaul#
2160f290bf7SdougcurrieAC_ARG_ENABLE(tempstore,
21794e4f82fSdrhAC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no)
218b0208ccaSpaulAC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
2190f290bf7Sdougcurriecase "$enable_tempstore" in
220b0208ccaSpaul  never )
2212dc96f9eSpaul    TEMP_STORE=0
222b0208ccaSpaul    AC_MSG_RESULT([never])
223b0208ccaSpaul  ;;
224b0208ccaSpaul  no )
2252dc96f9eSpaul    TEMP_STORE=1
226b0208ccaSpaul    AC_MSG_RESULT([no])
227b0208ccaSpaul  ;;
22854414bb4Sdrh  yes )
2298b72747dSdrh     TEMP_STORE=2
2308b72747dSdrh    AC_MSG_RESULT([yes])
2318b72747dSdrh  ;;
2328b72747dSdrh  always )
23354414bb4Sdrh     TEMP_STORE=3
23454414bb4Sdrh    AC_MSG_RESULT([always])
23554414bb4Sdrh  ;;
236b0208ccaSpaul  * )
23754414bb4Sdrh    TEMP_STORE=1
2388b72747dSdrh    AC_MSG_RESULT([no])
239b0208ccaSpaul  ;;
240b0208ccaSpaulesac
2412dc96f9eSpaul
2422dc96f9eSpaulAC_SUBST(TEMP_STORE)
243b0208ccaSpaul
24471eb93eaSdrh###########
24571eb93eaSdrh# Lots of things are different if we are compiling for Windows using
24671eb93eaSdrh# the CYGWIN environment.  So check for that special case and handle
24771eb93eaSdrh# things accordingly.
24871eb93eaSdrh#
24971eb93eaSdrhAC_MSG_CHECKING([if executables have the .exe suffix])
25071eb93eaSdrhif test "$config_BUILD_EXEEXT" = ".exe"; then
25171eb93eaSdrh  CYGWIN=yes
25271eb93eaSdrh  AC_MSG_RESULT(yes)
25371eb93eaSdrhelse
25471eb93eaSdrh  AC_MSG_RESULT(unknown)
25571eb93eaSdrhfi
25671eb93eaSdrhif test "$CYGWIN" != "yes"; then
25771eb93eaSdrh  AC_CYGWIN
25871eb93eaSdrhfi
25971eb93eaSdrhif test "$CYGWIN" = "yes"; then
26071eb93eaSdrh  BUILD_EXEEXT=.exe
26171eb93eaSdrhelse
2626194a5fbSdougcurrie  BUILD_EXEEXT=$EXEEXT
26371eb93eaSdrhfi
264c8a15308Svapierif test x"$cross_compiling" = xno; then
26571eb93eaSdrh  TARGET_EXEEXT=$BUILD_EXEEXT
26671eb93eaSdrhelse
26771eb93eaSdrh  TARGET_EXEEXT=$config_TARGET_EXEEXT
26871eb93eaSdrhfi
26971eb93eaSdrhif test "$TARGET_EXEEXT" = ".exe"; then
27029bafeabSdanielk1977  SQLITE_OS_UNIX=0
27129bafeabSdanielk1977  SQLITE_OS_WIN=1
27229bafeabSdanielk1977  CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1"
27371eb93eaSdrhelse
27429bafeabSdanielk1977  SQLITE_OS_UNIX=1
27529bafeabSdanielk1977  SQLITE_OS_WIN=0
27629bafeabSdanielk1977  CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1"
27771eb93eaSdrhfi
27871eb93eaSdrh
27971eb93eaSdrhAC_SUBST(BUILD_EXEEXT)
28029bafeabSdanielk1977AC_SUBST(SQLITE_OS_UNIX)
28129bafeabSdanielk1977AC_SUBST(SQLITE_OS_WIN)
28271eb93eaSdrhAC_SUBST(TARGET_EXEEXT)
28371eb93eaSdrh
28471eb93eaSdrh##########
2857b5717e1Sdrh# Figure out all the parameters needed to compile against Tcl.
28671eb93eaSdrh#
2877b5717e1Sdrh# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
2887b5717e1Sdrh# macros in the in the tcl.m4 file of the standard TCL distribution.
2897b5717e1Sdrh# Those macros could not be used directly since we have to make some
2907b5717e1Sdrh# minor changes to accomodate systems that do not have TCL installed.
29171eb93eaSdrh#
29294e4f82fSdrhAC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]),
2937b5717e1Sdrh      [use_tcl=$enableval],[use_tcl=yes])
2947b5717e1Sdrhif test "${use_tcl}" = "yes" ; then
29594e4f82fSdrh  AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval})
2967b5717e1Sdrh  AC_MSG_CHECKING([for Tcl configuration])
2977b5717e1Sdrh  AC_CACHE_VAL(ac_cv_c_tclconfig,[
2987b5717e1Sdrh    # First check to see if --with-tcl was specified.
2997b5717e1Sdrh    if test x"${with_tclconfig}" != x ; then
3007b5717e1Sdrh      if test -f "${with_tclconfig}/tclConfig.sh" ; then
3017b5717e1Sdrh        ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
30271eb93eaSdrh      else
3037b5717e1Sdrh        AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
30471eb93eaSdrh      fi
30571eb93eaSdrh    fi
306fe7e82e4Svapier
307fe7e82e4Svapier    # Start autosearch by asking tclsh
308e74f4651Sdrh    if test x"${ac_cv_c_tclconfig}" = x ; then
309fe7e82e4Svapier      if test x"$cross_compiling" = xno; then
310fe7e82e4Svapier        for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}`
311fe7e82e4Svapier        do
312fe7e82e4Svapier          if test -f "$i/tclConfig.sh" ; then
313fe7e82e4Svapier            ac_cv_c_tclconfig="$i"
314fe7e82e4Svapier            break
315fe7e82e4Svapier          fi
316fe7e82e4Svapier        done
317fe7e82e4Svapier      fi
318e74f4651Sdrh    fi
319fe7e82e4Svapier
320f960a64dSdrh    # On ubuntu 14.10, $auto_path on tclsh is not quite correct.
321f960a64dSdrh    # So try again after applying corrections.
322f960a64dSdrh    if test x"${ac_cv_c_tclconfig}" = x ; then
323f960a64dSdrh      if test x"$cross_compiling" = xno; then
324f960a64dSdrh        for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD} | sed 's,/tcltk/tcl,/tcl,g'`
325f960a64dSdrh        do
326f960a64dSdrh          if test -f "$i/tclConfig.sh" ; then
327f960a64dSdrh            ac_cv_c_tclconfig="$i"
328f960a64dSdrh            break
329f960a64dSdrh          fi
330f960a64dSdrh        done
331f960a64dSdrh      fi
332f960a64dSdrh    fi
333f960a64dSdrh
33468314743Sdrh    # Recent versions of Xcode on Macs hid the tclConfig.sh file
33568314743Sdrh    # in a strange place.
33668314743Sdrh    if test x"${ac_cv_c_tclconfig}" = x ; then
33768314743Sdrh      if test x"$cross_compiling" = xno; then
33868314743Sdrh        for i in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX*.sdk/usr/lib
33968314743Sdrh        do
34068314743Sdrh          if test -f "$i/tclConfig.sh" ; then
34168314743Sdrh            ac_cv_c_tclconfig="$i"
34268314743Sdrh            break
34368314743Sdrh          fi
34468314743Sdrh        done
34568314743Sdrh      fi
34668314743Sdrh    fi
34768314743Sdrh
3487b5717e1Sdrh    # then check for a private Tcl installation
3497b5717e1Sdrh    if test x"${ac_cv_c_tclconfig}" = x ; then
3507b5717e1Sdrh      for i in \
3517b5717e1Sdrh            ../tcl \
3527b5717e1Sdrh            `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
3537b5717e1Sdrh            `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
3547b5717e1Sdrh            `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
3557b5717e1Sdrh            ../../tcl \
3567b5717e1Sdrh            `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
3577b5717e1Sdrh            `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
3587b5717e1Sdrh            `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
3597b5717e1Sdrh            ../../../tcl \
3607b5717e1Sdrh            `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
3617b5717e1Sdrh            `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
3627b5717e1Sdrh            `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null`
3637b5717e1Sdrh      do
3647b5717e1Sdrh        if test -f "$i/unix/tclConfig.sh" ; then
3657b5717e1Sdrh          ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
36671eb93eaSdrh          break
36771eb93eaSdrh        fi
36871eb93eaSdrh      done
36971eb93eaSdrh    fi
3707b5717e1Sdrh
3717b5717e1Sdrh    # check in a few common install locations
3727b5717e1Sdrh    if test x"${ac_cv_c_tclconfig}" = x ; then
3737b5717e1Sdrh      for i in \
3747b5717e1Sdrh            `ls -d ${libdir} 2>/dev/null` \
3757b5717e1Sdrh            `ls -d /usr/local/lib 2>/dev/null` \
3767b5717e1Sdrh            `ls -d /usr/contrib/lib 2>/dev/null` \
3777b5717e1Sdrh            `ls -d /usr/lib 2>/dev/null`
3787b5717e1Sdrh      do
3797b5717e1Sdrh        if test -f "$i/tclConfig.sh" ; then
3807b5717e1Sdrh           ac_cv_c_tclconfig=`(cd $i; pwd)`
3817b5717e1Sdrh           break
38271eb93eaSdrh        fi
3837b5717e1Sdrh      done
3847b5717e1Sdrh    fi
3857b5717e1Sdrh
3867b5717e1Sdrh    # check in a few other private locations
3877b5717e1Sdrh    if test x"${ac_cv_c_tclconfig}" = x ; then
3887b5717e1Sdrh      for i in \
3897b5717e1Sdrh         ${srcdir}/../tcl \
3907b5717e1Sdrh         `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
3917b5717e1Sdrh         `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
3927b5717e1Sdrh         `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null`
3937b5717e1Sdrh      do
3947b5717e1Sdrh        if test -f "$i/unix/tclConfig.sh" ; then
3957b5717e1Sdrh          ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
3967b5717e1Sdrh          break
3977b5717e1Sdrh        fi
3987b5717e1Sdrh      done
3997b5717e1Sdrh    fi
4007b5717e1Sdrh  ])
4017b5717e1Sdrh
4027b5717e1Sdrh  if test x"${ac_cv_c_tclconfig}" = x ; then
4037b5717e1Sdrh    use_tcl=no
4047b5717e1Sdrh    AC_MSG_WARN(Can't find Tcl configuration definitions)
4057b5717e1Sdrh    AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***)
4067b5717e1Sdrh    AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***)
4077b5717e1Sdrh  else
4087b5717e1Sdrh    TCL_BIN_DIR=${ac_cv_c_tclconfig}
4097b5717e1Sdrh    AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
4107b5717e1Sdrh
4117b5717e1Sdrh    AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
4127b5717e1Sdrh    if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
4137b5717e1Sdrh      AC_MSG_RESULT([loading])
4147b5717e1Sdrh      . $TCL_BIN_DIR/tclConfig.sh
4157b5717e1Sdrh    else
4167b5717e1Sdrh      AC_MSG_RESULT([file not found])
4177b5717e1Sdrh    fi
4187b5717e1Sdrh
4197b5717e1Sdrh    #
4207b5717e1Sdrh    # If the TCL_BIN_DIR is the build directory (not the install directory),
4217b5717e1Sdrh    # then set the common variable name to the value of the build variables.
4227b5717e1Sdrh    # For example, the variable TCL_LIB_SPEC will be set to the value
4237b5717e1Sdrh    # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
4247b5717e1Sdrh    # instead of TCL_BUILD_LIB_SPEC since it will work with both an
4257b5717e1Sdrh    # installed and uninstalled version of Tcl.
4267b5717e1Sdrh    #
4277b5717e1Sdrh
4287b5717e1Sdrh    if test -f $TCL_BIN_DIR/Makefile ; then
4297b5717e1Sdrh      TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
4307b5717e1Sdrh      TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
4317b5717e1Sdrh      TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
4327b5717e1Sdrh    fi
4337b5717e1Sdrh
4347b5717e1Sdrh    #
4357b5717e1Sdrh    # eval is required to do the TCL_DBGX substitution
4367b5717e1Sdrh    #
4377b5717e1Sdrh
4387b5717e1Sdrh    eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
4397b5717e1Sdrh    eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
4407b5717e1Sdrh    eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
4417b5717e1Sdrh
4427b5717e1Sdrh    eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
4437b5717e1Sdrh    eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
4447b5717e1Sdrh    eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
4457b5717e1Sdrh
4467b5717e1Sdrh    AC_SUBST(TCL_VERSION)
4477b5717e1Sdrh    AC_SUBST(TCL_BIN_DIR)
4487b5717e1Sdrh    AC_SUBST(TCL_SRC_DIR)
4497b5717e1Sdrh    AC_SUBST(TCL_INCLUDE_SPEC)
4507b5717e1Sdrh
4517b5717e1Sdrh    AC_SUBST(TCL_LIB_FILE)
4527b5717e1Sdrh    AC_SUBST(TCL_LIB_FLAG)
4537b5717e1Sdrh    AC_SUBST(TCL_LIB_SPEC)
4547b5717e1Sdrh
4557b5717e1Sdrh    AC_SUBST(TCL_STUB_LIB_FILE)
4567b5717e1Sdrh    AC_SUBST(TCL_STUB_LIB_FLAG)
4577b5717e1Sdrh    AC_SUBST(TCL_STUB_LIB_SPEC)
458d881ce8fSdrh    AC_SUBST(TCL_SHLIB_SUFFIX)
4597b5717e1Sdrh  fi
4607b5717e1Sdrhfi
4617b5717e1Sdrhif test "${use_tcl}" = "no" ; then
4627b5717e1Sdrh  HAVE_TCL=""
4637b5717e1Sdrhelse
4647b5717e1Sdrh  HAVE_TCL=1
4657b5717e1Sdrhfi
4667b5717e1SdrhAC_SUBST(HAVE_TCL)
46771eb93eaSdrh
46871eb93eaSdrh##########
46971eb93eaSdrh# Figure out what C libraries are required to compile programs
47071eb93eaSdrh# that use "readline()" library.
47171eb93eaSdrh#
4724c10a8a0SvapierTARGET_READLINE_LIBS=""
4734c10a8a0SvapierTARGET_READLINE_INC=""
4744c10a8a0SvapierTARGET_HAVE_READLINE=0
475e44b835eSdrhTARGET_HAVE_EDITLINE=0
476e44b835eSdrhAC_ARG_ENABLE([editline],
477e44b835eSdrh	[AC_HELP_STRING([--enable-editline],[enable BSD editline support])],
478e44b835eSdrh	[with_editline=$enableval],
479e44b835eSdrh	[with_editline=auto])
4804c10a8a0SvapierAC_ARG_ENABLE([readline],
481e44b835eSdrh	[AC_HELP_STRING([--disable-readline],[disable readline support])],
4824c10a8a0Svapier	[with_readline=$enableval],
4834c10a8a0Svapier	[with_readline=auto])
4844c10a8a0Svapier
485e44b835eSdrhif test x"$with_editline" != xno; then
486e44b835eSdrh        sLIBS=$LIBS
487e44b835eSdrh        LIBS=""
488e44b835eSdrh	TARGET_HAVE_EDITLINE=1
489e44b835eSdrh	AC_SEARCH_LIBS(readline,edit,[with_readline=no],[TARGET_HAVE_EDITLINE=0])
490e44b835eSdrh        TARGET_READLINE_LIBS=$LIBS
491e44b835eSdrh        LIBS=$sLIBS
492e44b835eSdrhfi
4934c10a8a0Svapierif test x"$with_readline" != xno; then
4944c10a8a0Svapier	found="yes"
4954c10a8a0Svapier
4964c10a8a0Svapier	AC_ARG_WITH([readline-lib],
4974c10a8a0Svapier		[AC_HELP_STRING([--with-readline-lib],[specify readline library])],
4984c10a8a0Svapier		[with_readline_lib=$withval],
4994c10a8a0Svapier		[with_readline_lib="auto"])
5004c10a8a0Svapier	if test "x$with_readline_lib" = xauto; then
5014c10a8a0Svapier		save_LIBS="$LIBS"
50271eb93eaSdrh		LIBS=""
5034c10a8a0Svapier		AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""])
5044c10a8a0Svapier		AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"])
5054c10a8a0Svapier		TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS"
5064c10a8a0Svapier		LIBS="$save_LIBS"
5074c10a8a0Svapier	else
5084c10a8a0Svapier		TARGET_READLINE_LIBS="$with_readline_lib"
50971eb93eaSdrh	fi
5104c10a8a0Svapier
5114c10a8a0Svapier	AC_ARG_WITH([readline-inc],
5124c10a8a0Svapier		[AC_HELP_STRING([--with-readline-inc],[specify readline include paths])],
5134c10a8a0Svapier		[with_readline_inc=$withval],
5144c10a8a0Svapier		[with_readline_inc="auto"])
5154c10a8a0Svapier	if test "x$with_readline_inc" = xauto; then
5164c10a8a0Svapier		AC_CHECK_HEADER(readline.h, [found="yes"], [
5174c10a8a0Svapier			found="no"
5184c10a8a0Svapier			if test "$cross_compiling" != yes; then
5194c10a8a0Svapier				for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
5204c10a8a0Svapier					for subdir in include include/readline; do
5214c10a8a0Svapier						AC_CHECK_FILE($dir/$subdir/readline.h, found=yes)
5224c10a8a0Svapier						if test "$found" = "yes"; then
5234c10a8a0Svapier							TARGET_READLINE_INC="-I$dir/$subdir"
5244c10a8a0Svapier							break
5254c10a8a0Svapier						fi
5264c10a8a0Svapier					done
5274c10a8a0Svapier					test "$found" = "yes" && break
5284c10a8a0Svapier				done
5294c10a8a0Svapier			fi
5304c10a8a0Svapier		])
5314c10a8a0Svapier	else
5324c10a8a0Svapier		TARGET_READLINE_INC="$with_readline_inc"
5334c10a8a0Svapier	fi
5344c10a8a0Svapier
5354c10a8a0Svapier	if test x"$found" = xno; then
5364c10a8a0Svapier		TARGET_READLINE_LIBS=""
5374c10a8a0Svapier		TARGET_READLINE_INC=""
5384c10a8a0Svapier		TARGET_HAVE_READLINE=0
5394c10a8a0Svapier	else
5404c10a8a0Svapier		TARGET_HAVE_READLINE=1
5414c10a8a0Svapier	fi
5424c10a8a0Svapierfi
5434c10a8a0Svapier
54471eb93eaSdrhAC_SUBST(TARGET_READLINE_LIBS)
5454c10a8a0SvapierAC_SUBST(TARGET_READLINE_INC)
5464c10a8a0SvapierAC_SUBST(TARGET_HAVE_READLINE)
547e44b835eSdrhAC_SUBST(TARGET_HAVE_EDITLINE)
54871eb93eaSdrh
54971eb93eaSdrh##########
550f1878b4aSdrh# Figure out what C libraries are required to compile programs
551f1878b4aSdrh# that use "fdatasync()" function.
552f1878b4aSdrh#
553f1878b4aSdrhAC_SEARCH_LIBS(fdatasync, [rt])
554f1878b4aSdrh
55571eb93eaSdrh#########
5569d9f76c0Stpoindex# check for debug enabled
5578fa622d6SdrhAC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]))
55824ec37c3SdrhAC_MSG_CHECKING([build type])
5598fa622d6Sdrhif test "${enable_debug}" = "yes" ; then
56032d0eba4Sdrh  TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
56124ec37c3Sdrh  AC_MSG_RESULT([debug])
5629d9f76c0Stpoindexelse
5639d9f76c0Stpoindex  TARGET_DEBUG="-DNDEBUG"
56424ec37c3Sdrh  AC_MSG_RESULT([release])
5659d9f76c0Stpoindexfi
5669d9f76c0StpoindexAC_SUBST(TARGET_DEBUG)
5679d9f76c0Stpoindex
5689d9f76c0Stpoindex#########
56994984910Smlcreech# See whether we should use the amalgamation to build
57094984910SmlcreechAC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation],
5718fa622d6Sdrh      [Disable the amalgamation and instead build all files separately]))
572b13d5c25Sdanif test "${enable_amalgamation}" = "no" ; then
57394984910Smlcreech  USE_AMALGAMATION=0
57494984910Smlcreechfi
57594984910SmlcreechAC_SUBST(USE_AMALGAMATION)
57694984910Smlcreech
57794984910Smlcreech#########
57856c9311cSdrh# Look for zlib.  Only needed by extensions and by the sqlite3.exe shell
57956c9311cSdrhAC_CHECK_HEADERS(zlib.h)
58056c9311cSdrhAC_SEARCH_LIBS(deflate, z, [HAVE_ZLIB="-DSQLITE_HAVE_ZLIB=1"], [HAVE_ZLIB=""])
58156c9311cSdrhAC_SUBST(HAVE_ZLIB)
58256c9311cSdrh
58356c9311cSdrh#########
584a4edab0eSmlcreech# See whether we should allow loadable extensions
58505c7e0bdSdrhAC_ARG_ENABLE(load-extension, AC_HELP_STRING([--disable-load-extension],
5868fa622d6Sdrh      [Disable loading of external extensions]),,[enable_load_extension=yes])
5878fa622d6Sdrhif test "${enable_load_extension}" = "yes" ; then
588fbededefSshane  OPT_FEATURE_FLAGS=""
589dbe4b88aSdrh  AC_SEARCH_LIBS(dlopen, dl)
590a4edab0eSmlcreechelse
591fbededefSshane  OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
592a4edab0eSmlcreechfi
593a4edab0eSmlcreech
594c530b9c6Sdrh##########
595f6e904bdSdrh# Do we want to support math functions
596f6e904bdSdrh#
597e2ce8c44SdrhAC_ARG_ENABLE(math,
598f6e904bdSdrhAC_HELP_STRING([--disable-math],[Disable math functions]))
599f6e904bdSdrhAC_MSG_CHECKING([whether to support math functions])
60042c93b5eSdrhif test "$enable_math" = "no"; then
60142c93b5eSdrh  AC_MSG_RESULT([no])
60242c93b5eSdrhelse
603f6e904bdSdrh  AC_MSG_RESULT([yes])
604f6e904bdSdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MATH_FUNCTIONS"
605f6e904bdSdrh  AC_SEARCH_LIBS(ceil, m)
606f6e904bdSdrhfi
607f6e904bdSdrh
6089dbf96bdSdrh##########
6099dbf96bdSdrh# Do we want to support JSON functions
6109dbf96bdSdrh#
6119dbf96bdSdrhAC_ARG_ENABLE(json,
6129dbf96bdSdrhAC_HELP_STRING([--disable-json],[Disable JSON functions]))
6139dbf96bdSdrhAC_MSG_CHECKING([whether to support JSON functions])
6149dbf96bdSdrhif test "$enable_json" = "no"; then
6159dbf96bdSdrh  AC_MSG_RESULT([no])
6169dbf96bdSdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_OMIT_JSON"
6179dbf96bdSdrhelse
6189dbf96bdSdrh  AC_MSG_RESULT([yes])
6199dbf96bdSdrhfi
62042c93b5eSdrh
62142c93b5eSdrh########
62242c93b5eSdrh# The --enable-all argument is short-hand to enable
62342c93b5eSdrh# multiple extensions.
62442c93b5eSdrhAC_ARG_ENABLE(all, AC_HELP_STRING([--enable-all],
6259dbf96bdSdrh      [Enable FTS4, FTS5, Geopoly, RTree, Sessions]))
62642c93b5eSdrh
627f6e904bdSdrh##########
628c530b9c6Sdrh# Do we want to support memsys3 and/or memsys5
629c530b9c6Sdrh#
630c530b9c6SdrhAC_ARG_ENABLE(memsys5,
6318fa622d6Sdrh  AC_HELP_STRING([--enable-memsys5],[Enable MEMSYS5]))
632c530b9c6SdrhAC_MSG_CHECKING([whether to support MEMSYS5])
63326197d1bSdrhif test "${enable_memsys5}" = "yes"; then
6348c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS5"
635c530b9c6Sdrh  AC_MSG_RESULT([yes])
636c530b9c6Sdrhelse
637c530b9c6Sdrh  AC_MSG_RESULT([no])
638c530b9c6Sdrhfi
6395d513ba0SdrhAC_ARG_ENABLE(memsys3,
6408fa622d6Sdrh  AC_HELP_STRING([--enable-memsys3],[Enable MEMSYS3]))
6415d513ba0SdrhAC_MSG_CHECKING([whether to support MEMSYS3])
6425d513ba0Sdrhif test "${enable_memsys3}" = "yes" -a "${enable_memsys5}" = "no"; then
6438c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS3"
6445d513ba0Sdrh  AC_MSG_RESULT([yes])
6455d513ba0Sdrhelse
6465d513ba0Sdrh  AC_MSG_RESULT([no])
6475d513ba0Sdrhfi
648c530b9c6Sdrh
649aac7b93eSmlcreech#########
650ce1d9f54Sdrh# See whether we should enable Full Text Search extensions
651ce1d9f54SdrhAC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3],
6528fa622d6Sdrh      [Enable the FTS3 extension]))
65324ec37c3SdrhAC_MSG_CHECKING([whether to support FTS3])
654ce1d9f54Sdrhif test "${enable_fts3}" = "yes" ; then
6558c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS3"
65624ec37c3Sdrh  AC_MSG_RESULT([yes])
65724ec37c3Sdrhelse
65824ec37c3Sdrh  AC_MSG_RESULT([no])
659ce1d9f54Sdrhfi
660ce1d9f54SdrhAC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4],
6618fa622d6Sdrh      [Enable the FTS4 extension]))
66224ec37c3SdrhAC_MSG_CHECKING([whether to support FTS4])
66329368eabSdrhif test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then
66424ec37c3Sdrh  AC_MSG_RESULT([yes])
6658c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS4"
666ce1d9f54Sdrh  AC_SEARCH_LIBS([log],[m])
66724ec37c3Sdrhelse
66824ec37c3Sdrh  AC_MSG_RESULT([no])
669ce1d9f54Sdrhfi
670ce1d9f54SdrhAC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5],
6718fa622d6Sdrh      [Enable the FTS5 extension]))
67224ec37c3SdrhAC_MSG_CHECKING([whether to support FTS5])
67329368eabSdrhif test "${enable_fts5}" = "yes" -o "${enable_all}" = "yes" ; then
67424ec37c3Sdrh  AC_MSG_RESULT([yes])
6758c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS5"
676ce1d9f54Sdrh  AC_SEARCH_LIBS([log],[m])
67724ec37c3Sdrhelse
67824ec37c3Sdrh  AC_MSG_RESULT([no])
679ce1d9f54Sdrhfi
680ce1d9f54Sdrh
681ce1d9f54Sdrh#########
68283bebddbSdrh# See whether we should enable the LIMIT clause on UPDATE and DELETE
68383bebddbSdrh# statements.
68483bebddbSdrhAC_ARG_ENABLE(update-limit, AC_HELP_STRING([--enable-update-limit],
6858fa622d6Sdrh      [Enable the UPDATE/DELETE LIMIT clause]))
68624ec37c3SdrhAC_MSG_CHECKING([whether to support LIMIT on UPDATE and DELETE statements])
687b13c3a33Sdrhif test "${enable_update_limit}" = "yes" ; then
68883bebddbSdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT"
68924ec37c3Sdrh  AC_MSG_RESULT([yes])
69024ec37c3Sdrhelse
69124ec37c3Sdrh  AC_MSG_RESULT([no])
69283bebddbSdrhfi
69383bebddbSdrh
69483bebddbSdrh#########
695748b8fdaSdrh# See whether we should enable GEOPOLY
696748b8fdaSdrhAC_ARG_ENABLE(geopoly, AC_HELP_STRING([--enable-geopoly],
697748b8fdaSdrh      [Enable the GEOPOLY extension]),
698748b8fdaSdrh      [enable_geopoly=yes],[enable_geopoly=no])
69924ec37c3SdrhAC_MSG_CHECKING([whether to support GEOPOLY])
70029368eabSdrhif test "${enable_geopoly}" = "yes" -o "${enable_all}" = "yes" ; then
701748b8fdaSdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_GEOPOLY"
702748b8fdaSdrh  enable_rtree=yes
70324ec37c3Sdrh  AC_MSG_RESULT([yes])
70424ec37c3Sdrhelse
70524ec37c3Sdrh  AC_MSG_RESULT([no])
706748b8fdaSdrhfi
707748b8fdaSdrh
708748b8fdaSdrh#########
709ce1d9f54Sdrh# See whether we should enable RTREE
710ce1d9f54SdrhAC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree],
7118fa622d6Sdrh      [Enable the RTREE extension]))
71224ec37c3SdrhAC_MSG_CHECKING([whether to support RTREE])
713ce1d9f54Sdrhif test "${enable_rtree}" = "yes" ; then
7148c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_RTREE"
71524ec37c3Sdrh  AC_MSG_RESULT([yes])
71624ec37c3Sdrhelse
71724ec37c3Sdrh  AC_MSG_RESULT([no])
718ce1d9f54Sdrhfi
719ce1d9f54Sdrh
720ce1d9f54Sdrh#########
7215e18d402Sdrh# See whether we should enable the SESSION extension
7225e18d402SdrhAC_ARG_ENABLE(session, AC_HELP_STRING([--enable-session],
7238fa622d6Sdrh      [Enable the SESSION extension]))
72424ec37c3SdrhAC_MSG_CHECKING([whether to support SESSION])
72529368eabSdrhif test "${enable_session}" = "yes" -o "${enable_all}" = "yes" ; then
7268c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_SESSION"
7278c9ed054Sdrh  OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_PREUPDATE_HOOK"
72824ec37c3Sdrh  AC_MSG_RESULT([yes])
72924ec37c3Sdrhelse
73024ec37c3Sdrh  AC_MSG_RESULT([no])
7315e18d402Sdrhfi
7325e18d402Sdrh
7335e18d402Sdrh#########
7348c9ed054Sdrh# attempt to duplicate any OMITS and ENABLES into the ${OPT_FEATURE_FLAGS} parameter
735fbededefSshanefor option in $CFLAGS $CPPFLAGS
736fbededefSshanedo
737fbededefSshane  case $option in
73833a14781Sdanielk1977    -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
739b1cd7308Sshane    -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
740fbededefSshane  esac
741fbededefSshanedone
742fbededefSshaneAC_SUBST(OPT_FEATURE_FLAGS)
743fbededefSshane
744fbededefSshane
745b1cd7308Sshane# attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter
746fbededefSshaneac_temp_CFLAGS=""
747fbededefSshanefor option in $CFLAGS
748fbededefSshanedo
749fbededefSshane  case $option in
750fbededefSshane    -DSQLITE_OMIT*) ;;
751b1cd7308Sshane    -DSQLITE_ENABLE*) ;;
75233a14781Sdanielk1977    *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";;
753fbededefSshane  esac
754fbededefSshanedone
755fbededefSshaneCFLAGS=$ac_temp_CFLAGS
756fbededefSshane
757fbededefSshane
758b1cd7308Sshane# attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter
759fbededefSshaneac_temp_CPPFLAGS=""
760fbededefSshanefor option in $CPPFLAGS
761fbededefSshanedo
762fbededefSshane  case $option in
763fbededefSshane    -DSQLITE_OMIT*) ;;
764b1cd7308Sshane    -DSQLITE_ENABLE*) ;;
76533a14781Sdanielk1977    *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";;
766fbededefSshane  esac
767fbededefSshanedone
768fbededefSshaneCPPFLAGS=$ac_temp_CPPFLAGS
769fbededefSshane
770fbededefSshane
771b1cd7308Sshane# attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter
772fbededefSshaneac_temp_BUILD_CFLAGS=""
773fbededefSshanefor option in $BUILD_CFLAGS
774fbededefSshanedo
775fbededefSshane  case $option in
776fbededefSshane    -DSQLITE_OMIT*) ;;
777b1cd7308Sshane    -DSQLITE_ENABLE*) ;;
77833a14781Sdanielk1977    *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";;
779fbededefSshane  esac
780fbededefSshanedone
781fbededefSshaneBUILD_CFLAGS=$ac_temp_BUILD_CFLAGS
782fbededefSshane
783fbededefSshane
784fbededefSshane#########
785fbededefSshane# See whether we should use GCOV
786aac7b93eSmlcreechAC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov],
7878fa622d6Sdrh      [Enable coverage testing using gcov]))
788aac7b93eSmlcreechif test "${use_gcov}" = "yes" ; then
789aac7b93eSmlcreech  USE_GCOV=1
790aac7b93eSmlcreechelse
791aac7b93eSmlcreech  USE_GCOV=0
792aac7b93eSmlcreechfi
793aac7b93eSmlcreechAC_SUBST(USE_GCOV)
794aac7b93eSmlcreech
7954a0a98d3Sdrh#########
7964a0a98d3Sdrh# Enable/disabled amalagamation line macros
7974a0a98d3Sdrh########
7984a0a98d3SdrhAMALGAMATION_LINE_MACROS=--linemacros=0
7994a0a98d3Sdrhif test "${amalgamation_line_macros}" = "yes" ; then
8004a0a98d3Sdrh  AMALGAMATION_LINE_MACROS=--linemacros=1
8014a0a98d3Sdrhfi
8024a0a98d3Sdrhif test "${amalgamation_line_macros}" = "no" ; then
8034a0a98d3Sdrh  AMALGAMATION_LINE_MACROS=--linemacros=0
8044a0a98d3Sdrhfi
8054a0a98d3SdrhAC_SUBST(AMALGAMATION_LINE_MACROS)
806af6edf55Sdrh
80771eb93eaSdrh#########
808b87057f2Smlcreech# Output the config header
809*a4b2f419SdrhAC_CONFIG_HEADERS(sqlite_cfg.h)
810b87057f2Smlcreech
811b87057f2Smlcreech#########
81271eb93eaSdrh# Generate the output files.
81371eb93eaSdrh#
8148390bc38SmlcreechAC_SUBST(BUILD_CFLAGS)
815c7e9383aSa.rottmannAC_OUTPUT([
816c7e9383aSa.rottmannMakefile
81712b34444Sdougcurriesqlite3.pc
818c7e9383aSa.rottmann])
819