blob: 01f8b0d03de2b0bec8510e7ea15f544a5c6f6843 [file] [log] [blame]
danf6f8ac62013-05-27 17:19:58 +00001
2#-----------------------------------------------------------------------
3# Supports the following non-standard switches.
4#
5# --enable-threadsafe
6# --enable-readline
dance6cbf92015-11-13 16:59:00 +00007# --enable-editline
8# --enable-static-shell
danf6f8ac62013-05-27 17:19:58 +00009# --enable-dynamic-extensions
10#
11
12AC_PREREQ(2.61)
dan991c5d62015-12-15 19:32:12 +000013AC_INIT(sqlite, --SQLITE-VERSION--, http://www.sqlite.org)
danf6f8ac62013-05-27 17:19:58 +000014AC_CONFIG_SRCDIR([sqlite3.c])
15
16# Use automake.
17AM_INIT_AUTOMAKE([foreign])
18
19AC_SYS_LARGEFILE
20
21# Check for required programs.
22AC_PROG_CC
danf6f8ac62013-05-27 17:19:58 +000023AC_PROG_LIBTOOL
24AC_PROG_MKDIR_P
25
26# Check for library functions that SQLite can optionally use.
27AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
28AC_FUNC_STRERROR_R
29
30AC_CONFIG_FILES([Makefile sqlite3.pc])
31AC_SUBST(BUILD_CFLAGS)
32
33#-----------------------------------------------------------------------
drhe44b8352015-10-30 14:25:57 +000034# --enable-editline
danf6f8ac62013-05-27 17:19:58 +000035# --enable-readline
36#
drhe44b8352015-10-30 14:25:57 +000037AC_ARG_ENABLE(editline, [AS_HELP_STRING(
38 [--enable-editline],
39 [use BSD libedit])],
40 [], [enable_editline=yes])
danf6f8ac62013-05-27 17:19:58 +000041AC_ARG_ENABLE(readline, [AS_HELP_STRING(
42 [--enable-readline],
drhe44b8352015-10-30 14:25:57 +000043 [use readline])],
drh17e0c472016-05-20 12:22:16 +000044 [], [enable_readline=yes])
drhe44b8352015-10-30 14:25:57 +000045if test x"$enable_editline" != xno ; then
46 sLIBS=$LIBS
47 LIBS=""
48 AC_SEARCH_LIBS([readline],[edit],[enable_readline=no],[enable_editline=no])
49 READLINE_LIBS=$LIBS
50 if test x"$LIBS" != "x"; then
drh17e0c472016-05-20 12:22:16 +000051 AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
52 enable_readline=no
dan30908c92016-01-20 15:19:56 +000053 else
54 unset ac_cv_search_readline
drhe44b8352015-10-30 14:25:57 +000055 fi
56 LIBS=$sLIBS
57fi
danf6f8ac62013-05-27 17:19:58 +000058if test x"$enable_readline" != xno ; then
59 sLIBS=$LIBS
60 LIBS=""
61 AC_SEARCH_LIBS(tgetent, curses ncurses ncursesw, [], [])
62 AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no])
63 AC_CHECK_FUNCS(readline, [], [])
64 READLINE_LIBS=$LIBS
65 LIBS=$sLIBS
66fi
67AC_SUBST(READLINE_LIBS)
68#-----------------------------------------------------------------------
69
70#-----------------------------------------------------------------------
71# --enable-threadsafe
72#
73AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
74 [--enable-threadsafe], [build a thread-safe library [default=yes]])],
75 [], [enable_threadsafe=yes])
76THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
77if test x"$enable_threadsafe" != "xno"; then
78 THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
drhba60fbb2016-01-28 02:47:32 +000079 AC_SEARCH_LIBS(pthread_create, pthread)
drh13c808a2016-01-13 21:23:48 +000080 AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
danf6f8ac62013-05-27 17:19:58 +000081fi
82AC_SUBST(THREADSAFE_FLAGS)
83#-----------------------------------------------------------------------
84
85#-----------------------------------------------------------------------
86# --enable-dynamic-extensions
87#
88AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
89 [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
90 [], [enable_dynamic_extensions=yes])
91if test x"$enable_dynamic_extensions" != "xno"; then
92 AC_SEARCH_LIBS(dlopen, dl)
93else
94 DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
95fi
96AC_MSG_CHECKING([for whether to support dynamic extensions])
97AC_MSG_RESULT($enable_dynamic_extensions)
98AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
99#-----------------------------------------------------------------------
100
dan25727512015-10-09 14:37:15 +0000101#-----------------------------------------------------------------------
102# --enable-fts5
103#
104AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
105 [--enable-fts5], [include fts5 support [default=no]])],
106 [], [enable_fts5=no])
drh582c0802016-05-04 14:20:15 +0000107if test x"$enable_fts5" = "xyes"; then
dan25727512015-10-09 14:37:15 +0000108 AC_SEARCH_LIBS(log, m)
109 FTS5_FLAGS=-DSQLITE_ENABLE_FTS5
110fi
111AC_SUBST(FTS5_FLAGS)
112#-----------------------------------------------------------------------
113
114#-----------------------------------------------------------------------
115# --enable-json1
116#
117AC_ARG_ENABLE(json1, [AS_HELP_STRING(
118 [--enable-json1], [include json1 support [default=no]])],
119 [], [enable_json1=no])
drh582c0802016-05-04 14:20:15 +0000120if test x"$enable_json1" = "xyes"; then
dan25727512015-10-09 14:37:15 +0000121 JSON1_FLAGS=-DSQLITE_ENABLE_JSON1
122fi
123AC_SUBST(JSON1_FLAGS)
124#-----------------------------------------------------------------------
125
dance6cbf92015-11-13 16:59:00 +0000126#-----------------------------------------------------------------------
drh5e18d402016-05-03 13:14:18 +0000127# --enable-session
128#
129AC_ARG_ENABLE(session, [AS_HELP_STRING(
130 [--enable-session], [enable the session extension [default=no]])],
131 [], [enable_session=no])
drh582c0802016-05-04 14:20:15 +0000132if test x"$enable_session" = "xyes"; then
drh5e18d402016-05-03 13:14:18 +0000133 SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
134fi
135AC_SUBST(SESSION_FLAGS)
136#-----------------------------------------------------------------------
137
138#-----------------------------------------------------------------------
dance6cbf92015-11-13 16:59:00 +0000139# --enable-static-shell
140#
141AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
142 [--enable-static-shell],
143 [statically link libsqlite3 into shell tool [default=yes]])],
144 [], [enable_static_shell=yes])
drh582c0802016-05-04 14:20:15 +0000145if test x"$enable_static_shell" = "xyes"; then
dane1f1ffa2016-03-11 15:25:13 +0000146 EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
dance6cbf92015-11-13 16:59:00 +0000147else
148 EXTRA_SHELL_OBJ=libsqlite3.la
149fi
150AC_SUBST(EXTRA_SHELL_OBJ)
151#-----------------------------------------------------------------------
152
danf6f8ac62013-05-27 17:19:58 +0000153AC_CHECK_FUNCS(posix_fallocate)
154
155#-----------------------------------------------------------------------
156# UPDATE: Maybe it's better if users just set CFLAGS before invoking
157# configure. This option doesn't really add much...
158#
159# --enable-tempstore
160#
161# AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
162# [--enable-tempstore],
163# [in-memory temporary tables (never, no, yes, always) [default=no]])],
164# [], [enable_tempstore=no])
165# AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
166# case "$enable_tempstore" in
167# never ) TEMP_STORE=0 ;;
168# no ) TEMP_STORE=1 ;;
169# always ) TEMP_STORE=3 ;;
170# yes ) TEMP_STORE=3 ;;
171# * )
172# TEMP_STORE=1
173# enable_tempstore=yes
174# ;;
175# esac
176# AC_MSG_RESULT($enable_tempstore)
177# AC_SUBST(TEMP_STORE)
178#-----------------------------------------------------------------------
179
180AC_OUTPUT