blob: 9492530680a166774fe0848cd5db830e8bfd05fd [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])],
44 [], [enable_readline=no])
45if 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
51 AC_DEFINE([HAVE_EDITLINE],1,Define to use BSD editline)
dan30908c92016-01-20 15:19:56 +000052 else
53 unset ac_cv_search_readline
drhe44b8352015-10-30 14:25:57 +000054 fi
55 LIBS=$sLIBS
56fi
danf6f8ac62013-05-27 17:19:58 +000057if test x"$enable_readline" != xno ; then
58 sLIBS=$LIBS
59 LIBS=""
60 AC_SEARCH_LIBS(tgetent, curses ncurses ncursesw, [], [])
61 AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no])
62 AC_CHECK_FUNCS(readline, [], [])
63 READLINE_LIBS=$LIBS
64 LIBS=$sLIBS
65fi
66AC_SUBST(READLINE_LIBS)
67#-----------------------------------------------------------------------
68
69#-----------------------------------------------------------------------
70# --enable-threadsafe
71#
72AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
73 [--enable-threadsafe], [build a thread-safe library [default=yes]])],
74 [], [enable_threadsafe=yes])
75THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
76if test x"$enable_threadsafe" != "xno"; then
77 THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
drhba60fbb2016-01-28 02:47:32 +000078 AC_SEARCH_LIBS(pthread_create, pthread)
drh13c808a2016-01-13 21:23:48 +000079 AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
danf6f8ac62013-05-27 17:19:58 +000080fi
81AC_SUBST(THREADSAFE_FLAGS)
82#-----------------------------------------------------------------------
83
84#-----------------------------------------------------------------------
85# --enable-dynamic-extensions
86#
87AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
88 [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
89 [], [enable_dynamic_extensions=yes])
90if test x"$enable_dynamic_extensions" != "xno"; then
91 AC_SEARCH_LIBS(dlopen, dl)
92else
93 DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
94fi
95AC_MSG_CHECKING([for whether to support dynamic extensions])
96AC_MSG_RESULT($enable_dynamic_extensions)
97AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
98#-----------------------------------------------------------------------
99
dan25727512015-10-09 14:37:15 +0000100#-----------------------------------------------------------------------
101# --enable-fts5
102#
103AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
104 [--enable-fts5], [include fts5 support [default=no]])],
105 [], [enable_fts5=no])
106if test x"$enable_fts5" == "xyes"; then
107 AC_SEARCH_LIBS(log, m)
108 FTS5_FLAGS=-DSQLITE_ENABLE_FTS5
109fi
110AC_SUBST(FTS5_FLAGS)
111#-----------------------------------------------------------------------
112
113#-----------------------------------------------------------------------
114# --enable-json1
115#
116AC_ARG_ENABLE(json1, [AS_HELP_STRING(
117 [--enable-json1], [include json1 support [default=no]])],
118 [], [enable_json1=no])
119if test x"$enable_json1" == "xyes"; then
120 JSON1_FLAGS=-DSQLITE_ENABLE_JSON1
121fi
122AC_SUBST(JSON1_FLAGS)
123#-----------------------------------------------------------------------
124
dance6cbf92015-11-13 16:59:00 +0000125#-----------------------------------------------------------------------
126# --enable-static-shell
127#
128AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
129 [--enable-static-shell],
130 [statically link libsqlite3 into shell tool [default=yes]])],
131 [], [enable_static_shell=yes])
132if test x"$enable_static_shell" == "xyes"; then
133 EXTRA_SHELL_OBJ=sqlite3.$OBJEXT
134else
135 EXTRA_SHELL_OBJ=libsqlite3.la
136fi
137AC_SUBST(EXTRA_SHELL_OBJ)
138#-----------------------------------------------------------------------
139
danf6f8ac62013-05-27 17:19:58 +0000140AC_CHECK_FUNCS(posix_fallocate)
141
142#-----------------------------------------------------------------------
143# UPDATE: Maybe it's better if users just set CFLAGS before invoking
144# configure. This option doesn't really add much...
145#
146# --enable-tempstore
147#
148# AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
149# [--enable-tempstore],
150# [in-memory temporary tables (never, no, yes, always) [default=no]])],
151# [], [enable_tempstore=no])
152# AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
153# case "$enable_tempstore" in
154# never ) TEMP_STORE=0 ;;
155# no ) TEMP_STORE=1 ;;
156# always ) TEMP_STORE=3 ;;
157# yes ) TEMP_STORE=3 ;;
158# * )
159# TEMP_STORE=1
160# enable_tempstore=yes
161# ;;
162# esac
163# AC_MSG_RESULT($enable_tempstore)
164# AC_SUBST(TEMP_STORE)
165#-----------------------------------------------------------------------
166
167AC_OUTPUT