2013-05-27 19:19:58 +02:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# Supports the following non-standard switches.
|
|
|
|
#
|
|
|
|
# --enable-threadsafe
|
|
|
|
# --enable-readline
|
2015-11-13 17:59:00 +01:00
|
|
|
# --enable-editline
|
|
|
|
# --enable-static-shell
|
2013-05-27 19:19:58 +02:00
|
|
|
# --enable-dynamic-extensions
|
|
|
|
#
|
|
|
|
|
|
|
|
AC_PREREQ(2.61)
|
2015-12-15 20:32:12 +01:00
|
|
|
AC_INIT(sqlite, --SQLITE-VERSION--, http://www.sqlite.org)
|
2013-05-27 19:19:58 +02:00
|
|
|
AC_CONFIG_SRCDIR([sqlite3.c])
|
2017-10-26 17:21:56 +02:00
|
|
|
AC_CONFIG_AUX_DIR([.])
|
2013-05-27 19:19:58 +02:00
|
|
|
|
|
|
|
# Use automake.
|
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
|
|
|
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
|
|
|
# Check for required programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_MKDIR_P
|
|
|
|
|
|
|
|
# Check for library functions that SQLite can optionally use.
|
|
|
|
AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
|
|
|
|
AC_FUNC_STRERROR_R
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile sqlite3.pc])
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS=
|
2013-05-27 19:19:58 +02:00
|
|
|
AC_SUBST(BUILD_CFLAGS)
|
|
|
|
|
2016-05-28 17:09:35 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Two options to enable readline compatible libraries:
|
|
|
|
#
|
2015-10-30 15:25:57 +01:00
|
|
|
# --enable-editline
|
2013-05-27 19:19:58 +02:00
|
|
|
# --enable-readline
|
|
|
|
#
|
2016-05-28 17:09:35 +02:00
|
|
|
# Both are enabled by default. If, after command line processing both are
|
|
|
|
# still enabled, the script searches for editline first and automatically
|
|
|
|
# disables readline if it is found. So, to use readline explicitly, the
|
|
|
|
# user must pass "--disable-editline". To disable command line editing
|
|
|
|
# support altogether, "--disable-editline --disable-readline".
|
|
|
|
#
|
|
|
|
# When searching for either library, check for headers before libraries
|
|
|
|
# as some distros supply packages that contain libraries but not header
|
|
|
|
# files, which come as a separate development package.
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(editline, [AS_HELP_STRING([--enable-editline],[use BSD libedit])])
|
|
|
|
AC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline],[use readline])])
|
|
|
|
|
|
|
|
AS_IF([ test x"$enable_editline" != xno ],[
|
|
|
|
AC_CHECK_HEADERS([editline/readline.h],[
|
|
|
|
sLIBS=$LIBS
|
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS([readline],[edit],[
|
|
|
|
AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
|
2017-03-23 20:51:38 +01:00
|
|
|
READLINE_LIBS="$LIBS -ltinfo"
|
2016-05-28 17:09:35 +02:00
|
|
|
enable_readline=no
|
2017-03-23 20:51:38 +01:00
|
|
|
],[],[-ltinfo])
|
2016-05-28 17:09:35 +02:00
|
|
|
AS_UNSET(ac_cv_search_readline)
|
|
|
|
LIBS=$sLIBS
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AS_IF([ test x"$enable_readline" != xno ],[
|
|
|
|
AC_CHECK_HEADERS([readline/readline.h],[
|
|
|
|
sLIBS=$LIBS
|
|
|
|
LIBS=""
|
|
|
|
AC_SEARCH_LIBS(tgetent, termcap curses ncurses ncursesw, [], [])
|
|
|
|
AC_SEARCH_LIBS(readline,[readline edit], [
|
|
|
|
AC_DEFINE([HAVE_READLINE],1,Define to use readline or wrapper)
|
|
|
|
READLINE_LIBS=$LIBS
|
|
|
|
])
|
|
|
|
LIBS=$sLIBS
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2013-05-27 19:19:58 +02:00
|
|
|
AC_SUBST(READLINE_LIBS)
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-threadsafe
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
|
|
|
|
[--enable-threadsafe], [build a thread-safe library [default=yes]])],
|
|
|
|
[], [enable_threadsafe=yes])
|
|
|
|
if test x"$enable_threadsafe" != "xno"; then
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
|
2016-01-28 03:47:32 +01:00
|
|
|
AC_SEARCH_LIBS(pthread_create, pthread)
|
2016-01-13 22:23:48 +01:00
|
|
|
AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
|
2013-05-27 19:19:58 +02:00
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-dynamic-extensions
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
|
|
|
|
[--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
|
|
|
|
[], [enable_dynamic_extensions=yes])
|
|
|
|
if test x"$enable_dynamic_extensions" != "xno"; then
|
|
|
|
AC_SEARCH_LIBS(dlopen, dl)
|
|
|
|
else
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1"
|
2013-05-27 19:19:58 +02:00
|
|
|
fi
|
|
|
|
AC_MSG_CHECKING([for whether to support dynamic extensions])
|
|
|
|
AC_MSG_RESULT($enable_dynamic_extensions)
|
2018-06-11 23:33:08 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-fts4
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(fts4, [AS_HELP_STRING(
|
|
|
|
[--enable-fts4], [include fts4 support [default=yes]])],
|
|
|
|
[], [enable_fts4=yes])
|
|
|
|
if test x"$enable_fts4" = "xyes"; then
|
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4"
|
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-fts3
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(fts3, [AS_HELP_STRING(
|
|
|
|
[--enable-fts3], [include fts3 support [default=no]])],
|
|
|
|
[], [])
|
|
|
|
if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then
|
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3"
|
|
|
|
fi
|
2013-05-27 19:19:58 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
2015-10-09 16:37:15 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-fts5
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
|
2018-05-04 06:49:55 +02:00
|
|
|
[--enable-fts5], [include fts5 support [default=yes]])],
|
|
|
|
[], [enable_fts5=yes])
|
2016-05-04 16:20:15 +02:00
|
|
|
if test x"$enable_fts5" = "xyes"; then
|
2015-10-09 16:37:15 +02:00
|
|
|
AC_SEARCH_LIBS(log, m)
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5"
|
2015-10-09 16:37:15 +02:00
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-json1
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(json1, [AS_HELP_STRING(
|
2018-05-04 06:49:55 +02:00
|
|
|
[--enable-json1], [include json1 support [default=yes]])],
|
2018-06-11 23:33:08 +02:00
|
|
|
[],[enable_json1=yes])
|
2016-05-04 16:20:15 +02:00
|
|
|
if test x"$enable_json1" = "xyes"; then
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1"
|
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-rtree
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(rtree, [AS_HELP_STRING(
|
|
|
|
[--enable-rtree], [include rtree support [default=yes]])],
|
|
|
|
[], [enable_rtree=yes])
|
|
|
|
if test x"$enable_rtree" = "xyes"; then
|
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE"
|
2015-10-09 16:37:15 +02:00
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
2016-05-03 15:14:18 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-session
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(session, [AS_HELP_STRING(
|
|
|
|
[--enable-session], [enable the session extension [default=no]])],
|
2018-06-11 23:33:08 +02:00
|
|
|
[], [])
|
2016-05-04 16:20:15 +02:00
|
|
|
if test x"$enable_session" = "xyes"; then
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
|
2016-05-03 15:14:18 +02:00
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
2018-05-04 06:49:55 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-debug
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(debug, [AS_HELP_STRING(
|
|
|
|
[--enable-debug], [build with debugging features enabled [default=no]])],
|
2018-06-11 23:33:08 +02:00
|
|
|
[], [])
|
2018-05-04 06:49:55 +02:00
|
|
|
if test x"$enable_debug" = "xyes"; then
|
2018-06-11 23:33:08 +02:00
|
|
|
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE"
|
|
|
|
CFLAGS="-g -O0"
|
2018-05-04 06:49:55 +02:00
|
|
|
fi
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
2015-11-13 17:59:00 +01:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# --enable-static-shell
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
|
|
|
|
[--enable-static-shell],
|
|
|
|
[statically link libsqlite3 into shell tool [default=yes]])],
|
|
|
|
[], [enable_static_shell=yes])
|
2016-05-04 16:20:15 +02:00
|
|
|
if test x"$enable_static_shell" = "xyes"; then
|
2016-03-11 16:25:13 +01:00
|
|
|
EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
|
2015-11-13 17:59:00 +01:00
|
|
|
else
|
|
|
|
EXTRA_SHELL_OBJ=libsqlite3.la
|
|
|
|
fi
|
|
|
|
AC_SUBST(EXTRA_SHELL_OBJ)
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
2013-05-27 19:19:58 +02:00
|
|
|
AC_CHECK_FUNCS(posix_fallocate)
|
2018-01-18 18:46:08 +01:00
|
|
|
AC_CHECK_HEADERS(zlib.h,[
|
2018-06-11 23:33:08 +02:00
|
|
|
AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"])
|
2018-01-18 18:46:08 +01:00
|
|
|
])
|
2013-05-27 19:19:58 +02:00
|
|
|
|
2018-01-31 02:38:44 +01:00
|
|
|
AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"])
|
|
|
|
AC_SUBST(SHELL_CFLAGS)
|
|
|
|
|
2013-05-27 19:19:58 +02:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
# UPDATE: Maybe it's better if users just set CFLAGS before invoking
|
|
|
|
# configure. This option doesn't really add much...
|
|
|
|
#
|
|
|
|
# --enable-tempstore
|
|
|
|
#
|
|
|
|
# AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
|
|
|
|
# [--enable-tempstore],
|
|
|
|
# [in-memory temporary tables (never, no, yes, always) [default=no]])],
|
|
|
|
# [], [enable_tempstore=no])
|
|
|
|
# AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
|
|
|
|
# case "$enable_tempstore" in
|
|
|
|
# never ) TEMP_STORE=0 ;;
|
|
|
|
# no ) TEMP_STORE=1 ;;
|
|
|
|
# always ) TEMP_STORE=3 ;;
|
|
|
|
# yes ) TEMP_STORE=3 ;;
|
|
|
|
# * )
|
|
|
|
# TEMP_STORE=1
|
|
|
|
# enable_tempstore=yes
|
|
|
|
# ;;
|
|
|
|
# esac
|
|
|
|
# AC_MSG_RESULT($enable_tempstore)
|
|
|
|
# AC_SUBST(TEMP_STORE)
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
AC_OUTPUT
|