xref: /netbsd-src/external/public-domain/sqlite/dist/configure.ac (revision 9ee89622ee9a34959f95c9aacba6f98c2179267f)
18b8b4e78Schristos
28b8b4e78Schristos#-----------------------------------------------------------------------
38b8b4e78Schristos# Supports the following non-standard switches.
48b8b4e78Schristos#
58b8b4e78Schristos#   --enable-threadsafe
68b8b4e78Schristos#   --enable-readline
78b8b4e78Schristos#   --enable-editline
88b8b4e78Schristos#   --enable-static-shell
98b8b4e78Schristos#   --enable-dynamic-extensions
108b8b4e78Schristos#
118b8b4e78Schristos
128b8b4e78SchristosAC_PREREQ(2.61)
13*9ee89622SchristosAC_INIT(sqlite, 3.45.1, http://www.sqlite.org)
148b8b4e78SchristosAC_CONFIG_SRCDIR([sqlite3.c])
158b8b4e78SchristosAC_CONFIG_AUX_DIR([.])
168b8b4e78Schristos
178b8b4e78Schristos# Use automake.
188b8b4e78SchristosAM_INIT_AUTOMAKE([foreign])
198b8b4e78Schristos
208b8b4e78SchristosAC_SYS_LARGEFILE
218b8b4e78Schristos
228b8b4e78Schristos# Check for required programs.
238b8b4e78SchristosAC_PROG_CC
248b8b4e78SchristosAC_PROG_LIBTOOL
258b8b4e78SchristosAC_PROG_MKDIR_P
268b8b4e78Schristos
278b8b4e78Schristos# Check for library functions that SQLite can optionally use.
288b8b4e78SchristosAC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
298b8b4e78SchristosAC_FUNC_STRERROR_R
308b8b4e78Schristos
318b8b4e78SchristosAC_CONFIG_FILES([Makefile sqlite3.pc])
328b8b4e78SchristosBUILD_CFLAGS=
338b8b4e78SchristosAC_SUBST(BUILD_CFLAGS)
348b8b4e78Schristos
358b8b4e78Schristos#-------------------------------------------------------------------------
368b8b4e78Schristos# Two options to enable readline compatible libraries:
378b8b4e78Schristos#
388b8b4e78Schristos#   --enable-editline
398b8b4e78Schristos#   --enable-readline
408b8b4e78Schristos#
418b8b4e78Schristos# Both are enabled by default. If, after command line processing both are
428b8b4e78Schristos# still enabled, the script searches for editline first and automatically
438b8b4e78Schristos# disables readline if it is found. So, to use readline explicitly, the
448b8b4e78Schristos# user must pass "--disable-editline". To disable command line editing
458b8b4e78Schristos# support altogether, "--disable-editline --disable-readline".
468b8b4e78Schristos#
478b8b4e78Schristos# When searching for either library, check for headers before libraries
488b8b4e78Schristos# as some distros supply packages that contain libraries but not header
498b8b4e78Schristos# files, which come as a separate development package.
508b8b4e78Schristos#
518b8b4e78SchristosAC_ARG_ENABLE(editline, [AS_HELP_STRING([--enable-editline],[use BSD libedit])])
528b8b4e78SchristosAC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline],[use readline])])
538b8b4e78Schristos
548b8b4e78SchristosAS_IF([ test x"$enable_editline" != xno ],[
558b8b4e78Schristos  AC_CHECK_HEADERS([editline/readline.h],[
568b8b4e78Schristos    sLIBS=$LIBS
578b8b4e78Schristos    LIBS=""
588b8b4e78Schristos    AC_SEARCH_LIBS([readline],[edit],[
598b8b4e78Schristos      AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
608b8b4e78Schristos      READLINE_LIBS="$LIBS -ltinfo"
618b8b4e78Schristos      enable_readline=no
628b8b4e78Schristos    ],[],[-ltinfo])
638b8b4e78Schristos    AS_UNSET(ac_cv_search_readline)
648b8b4e78Schristos    LIBS=$sLIBS
658b8b4e78Schristos  ])
668b8b4e78Schristos])
678b8b4e78Schristos
688b8b4e78SchristosAS_IF([ test x"$enable_readline" != xno ],[
698b8b4e78Schristos  AC_CHECK_HEADERS([readline/readline.h],[
708b8b4e78Schristos    sLIBS=$LIBS
718b8b4e78Schristos    LIBS=""
728b8b4e78Schristos    AC_SEARCH_LIBS(tgetent, termcap curses ncurses ncursesw, [], [])
738b8b4e78Schristos    AC_SEARCH_LIBS(readline,[readline edit], [
748b8b4e78Schristos      AC_DEFINE([HAVE_READLINE],1,Define to use readline or wrapper)
758b8b4e78Schristos      READLINE_LIBS=$LIBS
768b8b4e78Schristos    ])
778b8b4e78Schristos    LIBS=$sLIBS
788b8b4e78Schristos  ])
798b8b4e78Schristos])
808b8b4e78Schristos
818b8b4e78SchristosAC_SUBST(READLINE_LIBS)
828b8b4e78Schristos#-----------------------------------------------------------------------
838b8b4e78Schristos
848b8b4e78Schristos#-----------------------------------------------------------------------
858b8b4e78Schristos#   --enable-threadsafe
868b8b4e78Schristos#
878b8b4e78SchristosAC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
888b8b4e78Schristos  [--enable-threadsafe], [build a thread-safe library [default=yes]])],
898b8b4e78Schristos  [], [enable_threadsafe=yes])
908b8b4e78Schristosif test x"$enable_threadsafe" == "xno"; then
918b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0"
928b8b4e78Schristoselse
938b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
948b8b4e78Schristos  AC_SEARCH_LIBS(pthread_create, pthread)
958b8b4e78Schristos  AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
968b8b4e78Schristosfi
978b8b4e78Schristos#-----------------------------------------------------------------------
988b8b4e78Schristos
998b8b4e78Schristos#-----------------------------------------------------------------------
1008b8b4e78Schristos#   --enable-dynamic-extensions
1018b8b4e78Schristos#
1028b8b4e78SchristosAC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
1038b8b4e78Schristos  [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
1048b8b4e78Schristos  [], [enable_dynamic_extensions=yes])
1058b8b4e78Schristosif test x"$enable_dynamic_extensions" != "xno"; then
1068b8b4e78Schristos  AC_SEARCH_LIBS(dlopen, dl)
1078b8b4e78Schristoselse
1088b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1"
1098b8b4e78Schristosfi
1108b8b4e78SchristosAC_MSG_CHECKING([for whether to support dynamic extensions])
1118b8b4e78SchristosAC_MSG_RESULT($enable_dynamic_extensions)
1128b8b4e78Schristos#-----------------------------------------------------------------------
1138b8b4e78Schristos
1148b8b4e78Schristos#-----------------------------------------------------------------------
1158b8b4e78Schristos#   --enable-math
1168b8b4e78Schristos#
1178b8b4e78SchristosAC_ARG_ENABLE(math, [AS_HELP_STRING(
1188b8b4e78Schristos  [--enable-math], [SQL math functions [default=yes]])],
1198b8b4e78Schristos  [], [enable_math=yes])
1208b8b4e78SchristosAC_MSG_CHECKING([SQL math functions])
1218b8b4e78Schristosif test x"$enable_math" = "xyes"; then
1228b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS"
1238b8b4e78Schristos  AC_MSG_RESULT([enabled])
1248b8b4e78Schristos  AC_SEARCH_LIBS(ceil, m)
1258b8b4e78Schristoselse
1268b8b4e78Schristos  AC_MSG_RESULT([disabled])
1278b8b4e78Schristosfi
1288b8b4e78Schristos#-----------------------------------------------------------------------
1298b8b4e78Schristos
1308b8b4e78Schristos#-----------------------------------------------------------------------
1318b8b4e78Schristos#   --enable-fts4
1328b8b4e78Schristos#
1338b8b4e78SchristosAC_ARG_ENABLE(fts4, [AS_HELP_STRING(
1348b8b4e78Schristos  [--enable-fts4], [include fts4 support [default=yes]])],
1358b8b4e78Schristos  [], [enable_fts4=yes])
1368b8b4e78SchristosAC_MSG_CHECKING([FTS4 extension])
1378b8b4e78Schristosif test x"$enable_fts4" = "xyes"; then
1388b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4"
1398b8b4e78Schristos  AC_MSG_RESULT([enabled])
1408b8b4e78Schristoselse
1418b8b4e78Schristos  AC_MSG_RESULT([disabled])
1428b8b4e78Schristosfi
1438b8b4e78Schristos#-----------------------------------------------------------------------
1448b8b4e78Schristos
1458b8b4e78Schristos#-----------------------------------------------------------------------
1468b8b4e78Schristos#   --enable-fts3
1478b8b4e78Schristos#
1488b8b4e78SchristosAC_ARG_ENABLE(fts3, [AS_HELP_STRING(
1498b8b4e78Schristos  [--enable-fts3], [include fts3 support [default=no]])],
1508b8b4e78Schristos  [], [])
1518b8b4e78SchristosAC_MSG_CHECKING([FTS3 extension])
1528b8b4e78Schristosif test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then
1538b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3"
1548b8b4e78Schristos  AC_MSG_RESULT([enabled])
1558b8b4e78Schristoselse
1568b8b4e78Schristos  AC_MSG_RESULT([disabled])
1578b8b4e78Schristosfi
1588b8b4e78Schristos#-----------------------------------------------------------------------
1598b8b4e78Schristos
1608b8b4e78Schristos#-----------------------------------------------------------------------
1618b8b4e78Schristos#   --enable-fts5
1628b8b4e78Schristos#
1638b8b4e78SchristosAC_ARG_ENABLE(fts5, [AS_HELP_STRING(
1648b8b4e78Schristos  [--enable-fts5], [include fts5 support [default=yes]])],
1658b8b4e78Schristos  [], [enable_fts5=yes])
1668b8b4e78SchristosAC_MSG_CHECKING([FTS5 extension])
1678b8b4e78Schristosif test x"$enable_fts5" = "xyes"; then
1688b8b4e78Schristos  AC_MSG_RESULT([enabled])
1698b8b4e78Schristos  AC_SEARCH_LIBS(log, m)
1708b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5"
1718b8b4e78Schristoselse
1728b8b4e78Schristos  AC_MSG_RESULT([disabled])
1738b8b4e78Schristosfi
1748b8b4e78Schristos#-----------------------------------------------------------------------
1758b8b4e78Schristos
1768b8b4e78Schristos#-----------------------------------------------------------------------
1778b8b4e78Schristos#   --enable-rtree
1788b8b4e78Schristos#
1798b8b4e78SchristosAC_ARG_ENABLE(rtree, [AS_HELP_STRING(
1808b8b4e78Schristos  [--enable-rtree], [include rtree support [default=yes]])],
1818b8b4e78Schristos  [], [enable_rtree=yes])
1828b8b4e78SchristosAC_MSG_CHECKING([RTREE extension])
1838b8b4e78Schristosif test x"$enable_rtree" = "xyes"; then
1848b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY"
1858b8b4e78Schristos  AC_MSG_RESULT([enabled])
1868b8b4e78Schristoselse
1878b8b4e78Schristos  AC_MSG_RESULT([disabled])
1888b8b4e78Schristosfi
1898b8b4e78Schristos#-----------------------------------------------------------------------
1908b8b4e78Schristos
1918b8b4e78Schristos#-----------------------------------------------------------------------
1928b8b4e78Schristos#   --enable-session
1938b8b4e78Schristos#
1948b8b4e78SchristosAC_ARG_ENABLE(session, [AS_HELP_STRING(
1958b8b4e78Schristos  [--enable-session], [enable the session extension [default=no]])],
1968b8b4e78Schristos  [], [])
1978b8b4e78SchristosAC_MSG_CHECKING([Session extension])
1988b8b4e78Schristosif test x"$enable_session" = "xyes"; then
1998b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
2008b8b4e78Schristos  AC_MSG_RESULT([enabled])
2018b8b4e78Schristoselse
2028b8b4e78Schristos  AC_MSG_RESULT([disabled])
2038b8b4e78Schristosfi
2048b8b4e78Schristos#-----------------------------------------------------------------------
2058b8b4e78Schristos
2068b8b4e78Schristos#-----------------------------------------------------------------------
2078b8b4e78Schristos#   --enable-debug
2088b8b4e78Schristos#
2098b8b4e78SchristosAC_ARG_ENABLE(debug, [AS_HELP_STRING(
2108b8b4e78Schristos  [--enable-debug], [build with debugging features enabled [default=no]])],
2118b8b4e78Schristos  [], [])
2128b8b4e78SchristosAC_MSG_CHECKING([Build type])
2138b8b4e78Schristosif test x"$enable_debug" = "xyes"; then
2148b8b4e78Schristos  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE"
2158b8b4e78Schristos  CFLAGS="-g -O0"
2168b8b4e78Schristos  AC_MSG_RESULT([debug])
2178b8b4e78Schristoselse
2188b8b4e78Schristos  AC_MSG_RESULT([release])
2198b8b4e78Schristosfi
2208b8b4e78Schristos#-----------------------------------------------------------------------
2218b8b4e78Schristos
2228b8b4e78Schristos#-----------------------------------------------------------------------
2238b8b4e78Schristos#   --enable-static-shell
2248b8b4e78Schristos#
2258b8b4e78SchristosAC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
2268b8b4e78Schristos  [--enable-static-shell],
2278b8b4e78Schristos  [statically link libsqlite3 into shell tool [default=yes]])],
2288b8b4e78Schristos  [], [enable_static_shell=yes])
2298b8b4e78Schristosif test x"$enable_static_shell" = "xyes"; then
2308b8b4e78Schristos  EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
2318b8b4e78Schristoselse
2328b8b4e78Schristos  EXTRA_SHELL_OBJ=libsqlite3.la
2338b8b4e78Schristosfi
2348b8b4e78SchristosAC_SUBST(EXTRA_SHELL_OBJ)
2358b8b4e78Schristos#-----------------------------------------------------------------------
2368b8b4e78Schristos
2378b8b4e78SchristosAC_CHECK_FUNCS(posix_fallocate)
2388b8b4e78SchristosAC_CHECK_HEADERS(zlib.h,[
2398b8b4e78Schristos  AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"])
2408b8b4e78Schristos])
2418b8b4e78Schristos
2428b8b4e78SchristosAC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"])
2438b8b4e78SchristosAC_SUBST(SHELL_CFLAGS)
2448b8b4e78Schristos
2458b8b4e78Schristos#-----------------------------------------------------------------------
2468b8b4e78Schristos# UPDATE: Maybe it's better if users just set CFLAGS before invoking
2478b8b4e78Schristos# configure. This option doesn't really add much...
2488b8b4e78Schristos#
2498b8b4e78Schristos#   --enable-tempstore
2508b8b4e78Schristos#
2518b8b4e78Schristos# AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
2528b8b4e78Schristos#   [--enable-tempstore],
2538b8b4e78Schristos#   [in-memory temporary tables (never, no, yes, always) [default=no]])],
2548b8b4e78Schristos#   [], [enable_tempstore=no])
2558b8b4e78Schristos# AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
2568b8b4e78Schristos# case "$enable_tempstore" in
2578b8b4e78Schristos#   never )  TEMP_STORE=0 ;;
2588b8b4e78Schristos#   no )     TEMP_STORE=1 ;;
2598b8b4e78Schristos#   always ) TEMP_STORE=3 ;;
2608b8b4e78Schristos#   yes )    TEMP_STORE=3 ;;
2618b8b4e78Schristos#   * )
2628b8b4e78Schristos#     TEMP_STORE=1
2638b8b4e78Schristos#     enable_tempstore=yes
2648b8b4e78Schristos#   ;;
2658b8b4e78Schristos# esac
2668b8b4e78Schristos# AC_MSG_RESULT($enable_tempstore)
2678b8b4e78Schristos# AC_SUBST(TEMP_STORE)
2688b8b4e78Schristos#-----------------------------------------------------------------------
2698b8b4e78Schristos
2708b8b4e78SchristosAC_OUTPUT
271