2001-09-28 05:34:43 +04:00
|
|
|
#
|
|
|
|
# The build process allows for using a cross-compiler. But the default
|
|
|
|
# action is to target the same platform that we are running on. The
|
|
|
|
# configure script needs to discover the following properties of the
|
|
|
|
# build and target systems:
|
|
|
|
#
|
|
|
|
# srcdir
|
|
|
|
#
|
|
|
|
# The is the name of the directory that contains the
|
|
|
|
# "configure" shell script. All source files are
|
|
|
|
# located relative to this directory.
|
|
|
|
#
|
|
|
|
# bindir
|
|
|
|
#
|
|
|
|
# The name of the directory where executables should be
|
|
|
|
# written by the "install" target of the makefile.
|
|
|
|
#
|
|
|
|
# program_prefix
|
|
|
|
#
|
|
|
|
# Add this prefix to the names of all executables that run
|
|
|
|
# on the target machine. Default: ""
|
|
|
|
#
|
|
|
|
# ENABLE_SHARED
|
|
|
|
#
|
|
|
|
# True if shared libraries should be generated.
|
|
|
|
#
|
|
|
|
# BUILD_CC
|
|
|
|
#
|
|
|
|
# The name of a command that is used to convert C
|
|
|
|
# source files into executables that run on the build
|
|
|
|
# platform.
|
|
|
|
#
|
|
|
|
# BUILD_CFLAGS
|
|
|
|
#
|
|
|
|
# Switches that the build compiler needs in order to construct
|
|
|
|
# command-line programs.
|
|
|
|
#
|
|
|
|
# BUILD_LIBS
|
|
|
|
#
|
|
|
|
# Libraries that the build compiler needs in order to construct
|
|
|
|
# command-line programs.
|
|
|
|
#
|
|
|
|
# BUILD_EXEEXT
|
|
|
|
#
|
|
|
|
# The filename extension for executables on the build
|
|
|
|
# platform. "" for Unix and ".exe" for Windows.
|
|
|
|
#
|
2004-11-25 16:50:01 +03:00
|
|
|
# TCL_*
|
2001-09-28 05:34:43 +04:00
|
|
|
#
|
2004-11-25 16:50:01 +03:00
|
|
|
# Lots of values are read in from the tclConfig.sh script,
|
2004-11-27 18:52:16 +03:00
|
|
|
# if that script is available. This values are used for
|
|
|
|
# constructing and installing the TCL extension.
|
2001-09-28 05:34:43 +04:00
|
|
|
#
|
|
|
|
# TARGET_READLINE_LIBS
|
|
|
|
#
|
|
|
|
# This is the library directives passed to the target linker
|
|
|
|
# that cause the executable to link against the readline library.
|
|
|
|
# This might be a switch like "-lreadline" or pathnames of library
|
|
|
|
# file like "../../src/libreadline.a".
|
|
|
|
#
|
|
|
|
# TARGET_READLINE_INC
|
|
|
|
#
|
|
|
|
# This variables define the directory that contain header
|
|
|
|
# files for the readline library. If the compiler is able
|
|
|
|
# to find <readline.h> on its own, then this can be blank.
|
|
|
|
#
|
|
|
|
# TARGET_EXEEXT
|
|
|
|
#
|
|
|
|
# The filename extension for executables on the
|
|
|
|
# target platform. "" for Unix and ".exe" for windows.
|
|
|
|
#
|
|
|
|
# This configure.in file is easy to reuse on other projects. Just
|
|
|
|
# change the argument to AC_INIT(). And disable any features that
|
|
|
|
# you don't need (for example BLT) by erasing or commenting out
|
|
|
|
# the corresponding code.
|
|
|
|
#
|
2008-03-06 10:19:20 +03:00
|
|
|
AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n']))
|
2001-09-28 05:34:43 +04:00
|
|
|
|
2009-04-01 11:38:31 +04:00
|
|
|
dnl Make sure the local VERSION file matches this configure script
|
2009-04-25 12:39:14 +04:00
|
|
|
sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'`
|
2009-04-01 11:38:31 +04:00
|
|
|
if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then
|
|
|
|
AC_MSG_ERROR([configure script is out of date:
|
|
|
|
configure \$PACKAGE_VERSION = $PACKAGE_VERSION
|
|
|
|
top level VERSION file = $sqlite_version_sanity_check
|
|
|
|
please regen with autoconf])
|
|
|
|
fi
|
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
#########
|
|
|
|
# Programs needed
|
|
|
|
#
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
2008-05-06 02:52:56 +04:00
|
|
|
#########
|
|
|
|
# Enable large file support (if special flags are necessary)
|
|
|
|
#
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
2008-03-06 10:19:20 +03:00
|
|
|
#########
|
|
|
|
# Check for needed/wanted data types
|
|
|
|
AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t,
|
|
|
|
uint16_t, uint32_t, uint64_t, uintptr_t])
|
|
|
|
|
|
|
|
#########
|
|
|
|
# Check for needed/wanted headers
|
2012-02-08 16:13:28 +04:00
|
|
|
AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h])
|
2008-03-09 04:38:09 +03:00
|
|
|
|
|
|
|
#########
|
|
|
|
# Figure out whether or not we have these functions
|
|
|
|
#
|
2016-03-04 05:38:00 +03:00
|
|
|
AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64])
|
2008-03-09 04:38:09 +03:00
|
|
|
|
2008-03-11 21:03:30 +03:00
|
|
|
#########
|
|
|
|
# By default, we use the amalgamation (this may be changed below...)
|
|
|
|
#
|
|
|
|
USE_AMALGAMATION=1
|
|
|
|
|
2008-03-09 05:51:10 +03:00
|
|
|
#########
|
|
|
|
# See whether we can run specific tclsh versions known to work well;
|
|
|
|
# if not, then we fall back to plain tclsh.
|
|
|
|
# TODO: try other versions before falling back?
|
|
|
|
#
|
2013-08-28 22:06:26 +04:00
|
|
|
AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh8.5 tclsh], none)
|
2008-03-11 21:03:30 +03:00
|
|
|
if test "$TCLSH_CMD" = "none"; then
|
|
|
|
# If we can't find a local tclsh, then building the amalgamation will fail.
|
|
|
|
# We act as though --disable-amalgamation has been used.
|
|
|
|
echo "Warning: can't find tclsh - defaulting to non-amalgamation build."
|
|
|
|
USE_AMALGAMATION=0
|
|
|
|
TCLSH_CMD="tclsh"
|
|
|
|
fi
|
2008-03-09 05:51:10 +03:00
|
|
|
AC_SUBST(TCLSH_CMD)
|
|
|
|
|
2009-01-28 07:46:14 +03:00
|
|
|
AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin])
|
|
|
|
if test "x${TCLLIBDIR+set}" != "xset" ; then
|
|
|
|
TCLLIBDIR='$(libdir)'
|
|
|
|
for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do
|
|
|
|
TCLLIBDIR=$i
|
|
|
|
break
|
|
|
|
done
|
|
|
|
TCLLIBDIR="${TCLLIBDIR}/sqlite3"
|
|
|
|
fi
|
|
|
|
|
2008-03-06 10:19:20 +03:00
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
#########
|
|
|
|
# Set up an appropriate program prefix
|
|
|
|
#
|
|
|
|
if test "$program_prefix" = "NONE"; then
|
|
|
|
program_prefix=""
|
|
|
|
fi
|
|
|
|
AC_SUBST(program_prefix)
|
|
|
|
|
2004-11-27 18:52:16 +03:00
|
|
|
VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`]
|
2009-01-27 00:43:16 +03:00
|
|
|
AC_MSG_NOTICE(Version set to $VERSION)
|
2003-03-24 12:39:32 +03:00
|
|
|
AC_SUBST(VERSION)
|
2004-11-27 18:52:16 +03:00
|
|
|
RELEASE=`cat $srcdir/VERSION`
|
2009-01-27 00:43:16 +03:00
|
|
|
AC_MSG_NOTICE(Release set to $RELEASE)
|
2004-11-27 18:52:16 +03:00
|
|
|
AC_SUBST(RELEASE)
|
2009-01-27 00:43:16 +03:00
|
|
|
VERSION_NUMBER=[`cat $srcdir/VERSION \
|
2005-02-16 06:45:51 +03:00
|
|
|
| sed 's/[^0-9]/ /g' \
|
2005-07-06 17:51:27 +04:00
|
|
|
| awk '{printf "%d%03d%03d",$1,$2,$3}'`]
|
2009-01-27 00:43:16 +03:00
|
|
|
AC_MSG_NOTICE(Version number set to $VERSION_NUMBER)
|
2005-02-16 06:45:51 +03:00
|
|
|
AC_SUBST(VERSION_NUMBER)
|
2003-03-24 12:39:32 +03:00
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
#########
|
|
|
|
# Locate a compiler for the build machine. This compiler should
|
|
|
|
# generate command-line programs that run on the build machine.
|
|
|
|
#
|
2007-02-17 17:31:55 +03:00
|
|
|
if test x"$cross_compiling" = xno; then
|
|
|
|
BUILD_CC=$CC
|
|
|
|
BUILD_CFLAGS=$CFLAGS
|
2001-09-28 05:34:43 +04:00
|
|
|
else
|
2007-02-17 17:31:55 +03:00
|
|
|
if test "${BUILD_CC+set}" != set; then
|
|
|
|
AC_CHECK_PROGS(BUILD_CC, gcc cc cl)
|
|
|
|
fi
|
|
|
|
if test "${BUILD_CFLAGS+set}" != set; then
|
|
|
|
BUILD_CFLAGS="-g"
|
|
|
|
fi
|
2001-09-28 05:34:43 +04:00
|
|
|
fi
|
|
|
|
AC_SUBST(BUILD_CC)
|
|
|
|
|
|
|
|
##########
|
2004-06-21 22:57:29 +04:00
|
|
|
# Do we want to support multithreaded use of sqlite
|
2003-04-13 22:26:49 +04:00
|
|
|
#
|
2004-06-21 22:57:29 +04:00
|
|
|
AC_ARG_ENABLE(threadsafe,
|
2015-01-10 17:27:17 +03:00
|
|
|
AC_HELP_STRING([--disable-threadsafe],[Disable mutexing]),,enable_threadsafe=yes)
|
2004-06-21 22:57:29 +04:00
|
|
|
AC_MSG_CHECKING([whether to support threadsafe operation])
|
|
|
|
if test "$enable_threadsafe" = "no"; then
|
2007-09-03 20:12:09 +04:00
|
|
|
SQLITE_THREADSAFE=0
|
2003-04-13 22:26:49 +04:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
else
|
2007-09-03 20:12:09 +04:00
|
|
|
SQLITE_THREADSAFE=1
|
2003-04-13 22:26:49 +04:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
fi
|
2007-09-03 20:12:09 +04:00
|
|
|
AC_SUBST(SQLITE_THREADSAFE)
|
2003-04-13 22:26:49 +04:00
|
|
|
|
2007-09-03 20:12:09 +04:00
|
|
|
if test "$SQLITE_THREADSAFE" = "1"; then
|
2016-01-28 05:47:32 +03:00
|
|
|
AC_SEARCH_LIBS(pthread_create, pthread)
|
2016-01-14 00:23:48 +03:00
|
|
|
AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
|
2004-09-20 18:57:23 +04:00
|
|
|
fi
|
|
|
|
|
2003-09-23 04:36:50 +04:00
|
|
|
##########
|
|
|
|
# Do we want to support release
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(releasemode,
|
2006-02-15 05:00:25 +03:00
|
|
|
AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no)
|
2003-09-23 04:36:50 +04:00
|
|
|
AC_MSG_CHECKING([whether to support shared library linked as release mode or not])
|
|
|
|
if test "$enable_releasemode" = "no"; then
|
|
|
|
ALLOWRELEASE=""
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
else
|
2007-11-27 17:50:06 +03:00
|
|
|
ALLOWRELEASE="-release `cat $srcdir/VERSION`"
|
2003-09-23 04:36:50 +04:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
fi
|
|
|
|
AC_SUBST(ALLOWRELEASE)
|
|
|
|
|
2003-04-13 22:26:49 +04:00
|
|
|
##########
|
|
|
|
# Do we want temporary databases in memory
|
|
|
|
#
|
2004-06-21 22:57:29 +04:00
|
|
|
AC_ARG_ENABLE(tempstore,
|
2006-02-15 05:00:25 +03:00
|
|
|
AC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no)
|
2003-04-13 22:26:49 +04:00
|
|
|
AC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
|
2004-06-21 22:57:29 +04:00
|
|
|
case "$enable_tempstore" in
|
2003-04-13 22:26:49 +04:00
|
|
|
never )
|
2003-04-20 15:46:34 +04:00
|
|
|
TEMP_STORE=0
|
2003-04-13 22:26:49 +04:00
|
|
|
AC_MSG_RESULT([never])
|
|
|
|
;;
|
|
|
|
no )
|
2003-04-20 15:46:34 +04:00
|
|
|
TEMP_STORE=1
|
2003-04-13 22:26:49 +04:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
;;
|
2005-10-10 04:05:50 +04:00
|
|
|
yes )
|
2009-01-19 21:18:40 +03:00
|
|
|
TEMP_STORE=2
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
;;
|
|
|
|
always )
|
2005-10-10 04:05:50 +04:00
|
|
|
TEMP_STORE=3
|
|
|
|
AC_MSG_RESULT([always])
|
|
|
|
;;
|
2003-04-13 22:26:49 +04:00
|
|
|
* )
|
2005-10-10 04:05:50 +04:00
|
|
|
TEMP_STORE=1
|
2009-01-19 21:18:40 +03:00
|
|
|
AC_MSG_RESULT([no])
|
2003-04-13 22:26:49 +04:00
|
|
|
;;
|
|
|
|
esac
|
2003-04-20 15:46:34 +04:00
|
|
|
|
|
|
|
AC_SUBST(TEMP_STORE)
|
2003-04-13 22:26:49 +04:00
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
###########
|
|
|
|
# Lots of things are different if we are compiling for Windows using
|
|
|
|
# the CYGWIN environment. So check for that special case and handle
|
|
|
|
# things accordingly.
|
|
|
|
#
|
|
|
|
AC_MSG_CHECKING([if executables have the .exe suffix])
|
|
|
|
if test "$config_BUILD_EXEEXT" = ".exe"; then
|
|
|
|
CYGWIN=yes
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(unknown)
|
|
|
|
fi
|
|
|
|
if test "$CYGWIN" != "yes"; then
|
|
|
|
AC_CYGWIN
|
|
|
|
fi
|
|
|
|
if test "$CYGWIN" = "yes"; then
|
|
|
|
BUILD_EXEEXT=.exe
|
|
|
|
else
|
2003-12-19 23:09:51 +03:00
|
|
|
BUILD_EXEEXT=$EXEEXT
|
2001-09-28 05:34:43 +04:00
|
|
|
fi
|
2007-02-17 17:31:55 +03:00
|
|
|
if test x"$cross_compiling" = xno; then
|
2001-09-28 05:34:43 +04:00
|
|
|
TARGET_EXEEXT=$BUILD_EXEEXT
|
|
|
|
else
|
|
|
|
TARGET_EXEEXT=$config_TARGET_EXEEXT
|
|
|
|
fi
|
|
|
|
if test "$TARGET_EXEEXT" = ".exe"; then
|
2013-08-28 22:06:26 +04:00
|
|
|
SQLITE_OS_UNIX=0
|
|
|
|
SQLITE_OS_WIN=1
|
|
|
|
CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1"
|
2001-09-28 05:34:43 +04:00
|
|
|
else
|
2008-06-26 14:41:19 +04:00
|
|
|
SQLITE_OS_UNIX=1
|
|
|
|
SQLITE_OS_WIN=0
|
|
|
|
CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1"
|
2001-09-28 05:34:43 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(BUILD_EXEEXT)
|
2008-06-26 14:41:19 +04:00
|
|
|
AC_SUBST(SQLITE_OS_UNIX)
|
|
|
|
AC_SUBST(SQLITE_OS_WIN)
|
2001-09-28 05:34:43 +04:00
|
|
|
AC_SUBST(TARGET_EXEEXT)
|
|
|
|
|
|
|
|
##########
|
2004-11-25 16:50:01 +03:00
|
|
|
# Figure out all the parameters needed to compile against Tcl.
|
|
|
|
#
|
|
|
|
# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
|
|
|
|
# macros in the in the tcl.m4 file of the standard TCL distribution.
|
|
|
|
# Those macros could not be used directly since we have to make some
|
|
|
|
# minor changes to accomodate systems that do not have TCL installed.
|
|
|
|
#
|
2006-02-15 05:00:25 +03:00
|
|
|
AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]),
|
2004-11-25 16:50:01 +03:00
|
|
|
[use_tcl=$enableval],[use_tcl=yes])
|
|
|
|
if test "${use_tcl}" = "yes" ; then
|
2006-02-15 05:00:25 +03:00
|
|
|
AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval})
|
2004-11-25 16:50:01 +03:00
|
|
|
AC_MSG_CHECKING([for Tcl configuration])
|
|
|
|
AC_CACHE_VAL(ac_cv_c_tclconfig,[
|
|
|
|
# First check to see if --with-tcl was specified.
|
|
|
|
if test x"${with_tclconfig}" != x ; then
|
|
|
|
if test -f "${with_tclconfig}/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
|
|
|
|
fi
|
|
|
|
fi
|
2009-01-27 00:39:33 +03:00
|
|
|
|
|
|
|
# Start autosearch by asking tclsh
|
2012-08-15 20:06:54 +04:00
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
if test x"$cross_compiling" = xno; then
|
|
|
|
for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}`
|
|
|
|
do
|
|
|
|
if test -f "$i/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2009-01-27 00:39:33 +03:00
|
|
|
fi
|
|
|
|
|
2015-05-31 01:57:49 +03:00
|
|
|
# On ubuntu 14.10, $auto_path on tclsh is not quite correct.
|
|
|
|
# So try again after applying corrections.
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
if test x"$cross_compiling" = xno; then
|
|
|
|
for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD} | sed 's,/tcltk/tcl,/tcl,g'`
|
|
|
|
do
|
|
|
|
if test -f "$i/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-05-23 03:10:58 +03:00
|
|
|
# Recent versions of Xcode on Macs hid the tclConfig.sh file
|
|
|
|
# in a strange place.
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
if test x"$cross_compiling" = xno; then
|
|
|
|
for i in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX*.sdk/usr/lib
|
|
|
|
do
|
|
|
|
if test -f "$i/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2004-11-25 16:50:01 +03:00
|
|
|
# then check for a private Tcl installation
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
for i in \
|
|
|
|
../tcl \
|
|
|
|
`ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
|
|
|
`ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
../../tcl \
|
|
|
|
`ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
|
|
|
`ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
../../../tcl \
|
|
|
|
`ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
|
|
|
`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null`
|
|
|
|
do
|
|
|
|
if test -f "$i/unix/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2001-09-28 05:34:43 +04:00
|
|
|
|
2004-11-25 16:50:01 +03:00
|
|
|
# check in a few common install locations
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
for i in \
|
|
|
|
`ls -d ${libdir} 2>/dev/null` \
|
|
|
|
`ls -d /usr/local/lib 2>/dev/null` \
|
|
|
|
`ls -d /usr/contrib/lib 2>/dev/null` \
|
|
|
|
`ls -d /usr/lib 2>/dev/null`
|
|
|
|
do
|
|
|
|
if test -f "$i/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd $i; pwd)`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check in a few other private locations
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
for i in \
|
|
|
|
${srcdir}/../tcl \
|
|
|
|
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
|
|
|
|
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
|
|
|
|
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null`
|
|
|
|
do
|
|
|
|
if test -f "$i/unix/tclConfig.sh" ; then
|
|
|
|
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
if test x"${ac_cv_c_tclconfig}" = x ; then
|
|
|
|
use_tcl=no
|
|
|
|
AC_MSG_WARN(Can't find Tcl configuration definitions)
|
|
|
|
AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***)
|
|
|
|
AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***)
|
2001-09-28 05:34:43 +04:00
|
|
|
else
|
2004-11-25 16:50:01 +03:00
|
|
|
TCL_BIN_DIR=${ac_cv_c_tclconfig}
|
|
|
|
AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
|
|
|
|
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
|
|
|
|
AC_MSG_RESULT([loading])
|
|
|
|
. $TCL_BIN_DIR/tclConfig.sh
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([file not found])
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# If the TCL_BIN_DIR is the build directory (not the install directory),
|
|
|
|
# then set the common variable name to the value of the build variables.
|
|
|
|
# For example, the variable TCL_LIB_SPEC will be set to the value
|
|
|
|
# of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
|
|
|
|
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
|
|
|
|
# installed and uninstalled version of Tcl.
|
|
|
|
#
|
|
|
|
|
2008-03-09 05:51:10 +03:00
|
|
|
if test -f $TCL_BIN_DIR/Makefile ; then
|
2004-11-25 16:50:01 +03:00
|
|
|
TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
|
|
|
|
TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
|
|
|
|
TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# eval is required to do the TCL_DBGX substitution
|
|
|
|
#
|
|
|
|
|
|
|
|
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
|
|
|
|
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
|
|
|
|
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
|
|
|
|
|
|
|
|
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
|
|
|
|
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
|
|
|
|
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
|
|
|
|
|
|
|
|
AC_SUBST(TCL_VERSION)
|
|
|
|
AC_SUBST(TCL_BIN_DIR)
|
|
|
|
AC_SUBST(TCL_SRC_DIR)
|
|
|
|
AC_SUBST(TCL_INCLUDE_SPEC)
|
|
|
|
|
|
|
|
AC_SUBST(TCL_LIB_FILE)
|
|
|
|
AC_SUBST(TCL_LIB_FLAG)
|
|
|
|
AC_SUBST(TCL_LIB_SPEC)
|
|
|
|
|
|
|
|
AC_SUBST(TCL_STUB_LIB_FILE)
|
|
|
|
AC_SUBST(TCL_STUB_LIB_FLAG)
|
|
|
|
AC_SUBST(TCL_STUB_LIB_SPEC)
|
2015-03-31 20:01:52 +03:00
|
|
|
AC_SUBST(TCL_SHLIB_SUFFIX)
|
2001-09-28 05:34:43 +04:00
|
|
|
fi
|
|
|
|
fi
|
2004-11-25 16:50:01 +03:00
|
|
|
if test "${use_tcl}" = "no" ; then
|
|
|
|
HAVE_TCL=""
|
2001-09-28 05:34:43 +04:00
|
|
|
else
|
2004-11-25 16:50:01 +03:00
|
|
|
HAVE_TCL=1
|
2001-09-28 05:34:43 +04:00
|
|
|
fi
|
2004-11-25 16:50:01 +03:00
|
|
|
AC_SUBST(HAVE_TCL)
|
2001-09-28 05:34:43 +04:00
|
|
|
|
|
|
|
##########
|
|
|
|
# Figure out what C libraries are required to compile programs
|
|
|
|
# that use "readline()" library.
|
|
|
|
#
|
2007-02-17 17:28:26 +03:00
|
|
|
TARGET_READLINE_LIBS=""
|
|
|
|
TARGET_READLINE_INC=""
|
|
|
|
TARGET_HAVE_READLINE=0
|
2015-10-30 17:25:57 +03:00
|
|
|
TARGET_HAVE_EDITLINE=0
|
|
|
|
AC_ARG_ENABLE([editline],
|
|
|
|
[AC_HELP_STRING([--enable-editline],[enable BSD editline support])],
|
|
|
|
[with_editline=$enableval],
|
|
|
|
[with_editline=auto])
|
2007-02-17 17:28:26 +03:00
|
|
|
AC_ARG_ENABLE([readline],
|
2015-10-30 17:25:57 +03:00
|
|
|
[AC_HELP_STRING([--disable-readline],[disable readline support])],
|
2007-02-17 17:28:26 +03:00
|
|
|
[with_readline=$enableval],
|
|
|
|
[with_readline=auto])
|
|
|
|
|
2015-10-30 17:25:57 +03:00
|
|
|
if test x"$with_editline" != xno; then
|
|
|
|
sLIBS=$LIBS
|
|
|
|
LIBS=""
|
|
|
|
TARGET_HAVE_EDITLINE=1
|
|
|
|
AC_SEARCH_LIBS(readline,edit,[with_readline=no],[TARGET_HAVE_EDITLINE=0])
|
|
|
|
TARGET_READLINE_LIBS=$LIBS
|
|
|
|
LIBS=$sLIBS
|
|
|
|
fi
|
2007-02-17 17:28:26 +03:00
|
|
|
if test x"$with_readline" != xno; then
|
|
|
|
found="yes"
|
|
|
|
|
|
|
|
AC_ARG_WITH([readline-lib],
|
|
|
|
[AC_HELP_STRING([--with-readline-lib],[specify readline library])],
|
|
|
|
[with_readline_lib=$withval],
|
|
|
|
[with_readline_lib="auto"])
|
|
|
|
if test "x$with_readline_lib" = xauto; then
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""])
|
|
|
|
AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"])
|
|
|
|
TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS"
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
else
|
|
|
|
TARGET_READLINE_LIBS="$with_readline_lib"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_WITH([readline-inc],
|
|
|
|
[AC_HELP_STRING([--with-readline-inc],[specify readline include paths])],
|
|
|
|
[with_readline_inc=$withval],
|
|
|
|
[with_readline_inc="auto"])
|
|
|
|
if test "x$with_readline_inc" = xauto; then
|
|
|
|
AC_CHECK_HEADER(readline.h, [found="yes"], [
|
|
|
|
found="no"
|
|
|
|
if test "$cross_compiling" != yes; then
|
|
|
|
for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
|
|
|
|
for subdir in include include/readline; do
|
|
|
|
AC_CHECK_FILE($dir/$subdir/readline.h, found=yes)
|
|
|
|
if test "$found" = "yes"; then
|
|
|
|
TARGET_READLINE_INC="-I$dir/$subdir"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
test "$found" = "yes" && break
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
else
|
|
|
|
TARGET_READLINE_INC="$with_readline_inc"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x"$found" = xno; then
|
|
|
|
TARGET_READLINE_LIBS=""
|
|
|
|
TARGET_READLINE_INC=""
|
|
|
|
TARGET_HAVE_READLINE=0
|
|
|
|
else
|
|
|
|
TARGET_HAVE_READLINE=1
|
|
|
|
fi
|
2001-09-28 05:34:43 +04:00
|
|
|
fi
|
2007-02-17 17:28:26 +03:00
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
AC_SUBST(TARGET_READLINE_LIBS)
|
2007-02-17 17:28:26 +03:00
|
|
|
AC_SUBST(TARGET_READLINE_INC)
|
|
|
|
AC_SUBST(TARGET_HAVE_READLINE)
|
2015-10-30 17:25:57 +03:00
|
|
|
AC_SUBST(TARGET_HAVE_EDITLINE)
|
2001-09-28 05:34:43 +04:00
|
|
|
|
2006-01-23 21:06:52 +03:00
|
|
|
##########
|
|
|
|
# Figure out what C libraries are required to compile programs
|
|
|
|
# that use "fdatasync()" function.
|
|
|
|
#
|
|
|
|
AC_SEARCH_LIBS(fdatasync, [rt])
|
|
|
|
|
2005-01-04 00:28:56 +03:00
|
|
|
#########
|
|
|
|
# check for debug enabled
|
2006-02-15 05:00:25 +03:00
|
|
|
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]),
|
2005-01-04 00:28:56 +03:00
|
|
|
[use_debug=$enableval],[use_debug=no])
|
|
|
|
if test "${use_debug}" = "yes" ; then
|
2006-03-03 23:37:52 +03:00
|
|
|
TARGET_DEBUG="-DSQLITE_DEBUG=1"
|
2005-01-04 00:28:56 +03:00
|
|
|
else
|
|
|
|
TARGET_DEBUG="-DNDEBUG"
|
|
|
|
fi
|
|
|
|
AC_SUBST(TARGET_DEBUG)
|
|
|
|
|
2008-03-04 22:03:08 +03:00
|
|
|
#########
|
|
|
|
# See whether we should use the amalgamation to build
|
|
|
|
AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation],
|
2008-03-14 07:11:03 +03:00
|
|
|
[Disable the amalgamation and instead build all files separately]),
|
2008-03-04 22:03:08 +03:00
|
|
|
[use_amalgamation=$enableval],[use_amalgamation=yes])
|
2008-03-11 21:03:30 +03:00
|
|
|
if test "${use_amalgamation}" != "yes" ; then
|
2008-03-04 22:03:08 +03:00
|
|
|
USE_AMALGAMATION=0
|
|
|
|
fi
|
|
|
|
AC_SUBST(USE_AMALGAMATION)
|
|
|
|
|
2008-03-06 07:14:17 +03:00
|
|
|
#########
|
|
|
|
# See whether we should allow loadable extensions
|
2015-01-10 17:27:17 +03:00
|
|
|
AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--disable-load-extension],
|
|
|
|
[Disable loading of external extensions]),
|
|
|
|
[use_loadextension=$enableval],[use_loadextension=yes])
|
2008-03-06 07:14:17 +03:00
|
|
|
if test "${use_loadextension}" = "yes" ; then
|
2008-07-22 09:05:01 +04:00
|
|
|
OPT_FEATURE_FLAGS=""
|
2011-06-20 22:00:17 +04:00
|
|
|
AC_SEARCH_LIBS(dlopen, dl)
|
2008-03-06 07:14:17 +03:00
|
|
|
else
|
2008-07-22 09:05:01 +04:00
|
|
|
OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1"
|
2008-03-06 07:14:17 +03:00
|
|
|
fi
|
|
|
|
|
2015-10-09 15:48:33 +03:00
|
|
|
#########
|
|
|
|
# See whether we should enable Full Text Search extensions
|
|
|
|
AC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3],
|
|
|
|
[Enable the FTS3 extension]),
|
|
|
|
[enable_fts3=yes],[enable_fts3=no])
|
|
|
|
if test "${enable_fts3}" = "yes" ; then
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS3"
|
|
|
|
fi
|
|
|
|
AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4],
|
|
|
|
[Enable the FTS4 extension]),
|
|
|
|
[enable_fts4=yes],[enable_fts4=no])
|
|
|
|
if test "${enable_fts4}" = "yes" ; then
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS4"
|
|
|
|
AC_SEARCH_LIBS([log],[m])
|
|
|
|
fi
|
|
|
|
AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5],
|
|
|
|
[Enable the FTS5 extension]),
|
|
|
|
[enable_fts5=yes],[enable_fts5=no])
|
|
|
|
if test "${enable_fts5}" = "yes" ; then
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS5"
|
|
|
|
AC_SEARCH_LIBS([log],[m])
|
|
|
|
fi
|
|
|
|
|
|
|
|
#########
|
|
|
|
# See whether we should enable JSON1
|
|
|
|
AC_ARG_ENABLE(json1, AC_HELP_STRING([--enable-json1],
|
|
|
|
[Enable the JSON1 extension]),
|
|
|
|
[enable_json1=yes],[enable_json1=no])
|
|
|
|
if test "${enable_json1}" = "yes" ; then
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_JSON1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#########
|
|
|
|
# See whether we should enable RTREE
|
|
|
|
AC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree],
|
|
|
|
[Enable the RTREE extension]),
|
|
|
|
[enable_rtree=yes],[enable_rtree=no])
|
|
|
|
if test "${enable_rtree}" = "yes" ; then
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_RTREE"
|
|
|
|
fi
|
|
|
|
|
2016-05-03 16:14:18 +03:00
|
|
|
#########
|
|
|
|
# See whether we should enable the SESSION extension
|
|
|
|
AC_ARG_ENABLE(session, AC_HELP_STRING([--enable-session],
|
|
|
|
[Enable the SESSION extension]),
|
|
|
|
[enable_session=yes],[enable_session=no])
|
|
|
|
if test "${enable_session}" = "yes" ; then
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_SESSION"
|
|
|
|
OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_PREUPDATE_HOOK"
|
|
|
|
fi
|
|
|
|
|
2008-04-01 06:45:22 +04:00
|
|
|
#########
|
2008-10-22 22:27:31 +04:00
|
|
|
# attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter
|
2008-07-22 09:05:01 +04:00
|
|
|
for option in $CFLAGS $CPPFLAGS
|
|
|
|
do
|
|
|
|
case $option in
|
2008-08-04 18:50:05 +04:00
|
|
|
-DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
|
2008-10-22 22:27:31 +04:00
|
|
|
-DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";;
|
2008-07-22 09:05:01 +04:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
AC_SUBST(OPT_FEATURE_FLAGS)
|
|
|
|
|
|
|
|
|
2008-10-22 22:27:31 +04:00
|
|
|
# attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter
|
2008-07-22 09:05:01 +04:00
|
|
|
ac_temp_CFLAGS=""
|
|
|
|
for option in $CFLAGS
|
|
|
|
do
|
|
|
|
case $option in
|
|
|
|
-DSQLITE_OMIT*) ;;
|
2008-10-22 22:27:31 +04:00
|
|
|
-DSQLITE_ENABLE*) ;;
|
2008-08-04 18:50:05 +04:00
|
|
|
*) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";;
|
2008-07-22 09:05:01 +04:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
CFLAGS=$ac_temp_CFLAGS
|
|
|
|
|
|
|
|
|
2008-10-22 22:27:31 +04:00
|
|
|
# attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter
|
2008-07-22 09:05:01 +04:00
|
|
|
ac_temp_CPPFLAGS=""
|
|
|
|
for option in $CPPFLAGS
|
|
|
|
do
|
|
|
|
case $option in
|
|
|
|
-DSQLITE_OMIT*) ;;
|
2008-10-22 22:27:31 +04:00
|
|
|
-DSQLITE_ENABLE*) ;;
|
2008-08-04 18:50:05 +04:00
|
|
|
*) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";;
|
2008-07-22 09:05:01 +04:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
CPPFLAGS=$ac_temp_CPPFLAGS
|
|
|
|
|
|
|
|
|
2008-10-22 22:27:31 +04:00
|
|
|
# attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter
|
2008-07-22 09:05:01 +04:00
|
|
|
ac_temp_BUILD_CFLAGS=""
|
|
|
|
for option in $BUILD_CFLAGS
|
|
|
|
do
|
|
|
|
case $option in
|
|
|
|
-DSQLITE_OMIT*) ;;
|
2008-10-22 22:27:31 +04:00
|
|
|
-DSQLITE_ENABLE*) ;;
|
2008-08-04 18:50:05 +04:00
|
|
|
*) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";;
|
2008-07-22 09:05:01 +04:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS
|
|
|
|
|
|
|
|
|
|
|
|
#########
|
|
|
|
# See whether we should use GCOV
|
2008-04-01 06:45:22 +04:00
|
|
|
AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov],
|
|
|
|
[Enable coverage testing using gcov]),
|
|
|
|
[use_gcov=$enableval],[use_gcov=no])
|
|
|
|
if test "${use_gcov}" = "yes" ; then
|
|
|
|
USE_GCOV=1
|
|
|
|
else
|
|
|
|
USE_GCOV=0
|
|
|
|
fi
|
|
|
|
AC_SUBST(USE_GCOV)
|
|
|
|
|
2005-10-04 22:38:49 +04:00
|
|
|
|
2008-03-06 10:19:20 +03:00
|
|
|
#########
|
|
|
|
# Output the config header
|
2008-03-20 05:25:35 +03:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2008-03-06 10:19:20 +03:00
|
|
|
|
2001-09-28 05:34:43 +04:00
|
|
|
#########
|
|
|
|
# Generate the output files.
|
|
|
|
#
|
2008-03-06 11:54:38 +03:00
|
|
|
AC_SUBST(BUILD_CFLAGS)
|
2003-03-24 12:39:32 +03:00
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
2004-07-19 07:24:59 +04:00
|
|
|
sqlite3.pc
|
2003-03-24 12:39:32 +03:00
|
|
|
])
|