xref: /freebsd/contrib/sqlite3/configure.ac (revision 3e5645b78f476816ca3b5acc28b29bbafbb9c444)
1
2#-----------------------------------------------------------------------
3# Supports the following non-standard switches.
4#
5#   --enable-threadsafe
6#   --enable-readline
7#   --enable-dynamic-extensions
8#
9
10AC_PREREQ(2.61)
11AC_INIT(sqlite, 3.8.9, http://www.sqlite.org)
12AC_CONFIG_SRCDIR([sqlite3.c])
13
14# Use automake.
15AM_INIT_AUTOMAKE([foreign])
16
17AC_SYS_LARGEFILE
18
19# Check for required programs.
20AC_PROG_CC
21AC_PROG_RANLIB
22AC_PROG_LIBTOOL
23AC_PROG_MKDIR_P
24
25# Check for library functions that SQLite can optionally use.
26AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
27AC_FUNC_STRERROR_R
28
29AC_CONFIG_FILES([Makefile sqlite3.pc])
30AC_SUBST(BUILD_CFLAGS)
31
32#-----------------------------------------------------------------------
33#   --enable-readline
34#
35AC_ARG_ENABLE(readline, [AS_HELP_STRING(
36  [--enable-readline],
37  [use readline in shell tool (yes, no) [default=yes]])],
38  [], [enable_readline=yes])
39if test x"$enable_readline" != xno ; then
40  sLIBS=$LIBS
41  LIBS=""
42  AC_SEARCH_LIBS(tgetent, curses ncurses ncursesw, [], [])
43  AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no])
44  AC_CHECK_FUNCS(readline, [], [])
45  READLINE_LIBS=$LIBS
46  LIBS=$sLIBS
47fi
48AC_SUBST(READLINE_LIBS)
49#-----------------------------------------------------------------------
50
51#-----------------------------------------------------------------------
52#   --enable-threadsafe
53#
54AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
55  [--enable-threadsafe], [build a thread-safe library [default=yes]])],
56  [], [enable_threadsafe=yes])
57THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
58if test x"$enable_threadsafe" != "xno"; then
59  THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
60  AC_SEARCH_LIBS(pthread_create, pthread)
61fi
62AC_SUBST(THREADSAFE_FLAGS)
63#-----------------------------------------------------------------------
64
65#-----------------------------------------------------------------------
66#   --enable-dynamic-extensions
67#
68AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
69  [--enable-dynamic-extensions], [support loadable extensions [default=yes]])],
70  [], [enable_dynamic_extensions=yes])
71if test x"$enable_dynamic_extensions" != "xno"; then
72  AC_SEARCH_LIBS(dlopen, dl)
73else
74  DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
75fi
76AC_MSG_CHECKING([for whether to support dynamic extensions])
77AC_MSG_RESULT($enable_dynamic_extensions)
78AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
79#-----------------------------------------------------------------------
80
81AC_CHECK_FUNCS(posix_fallocate)
82
83#-----------------------------------------------------------------------
84# UPDATE: Maybe it's better if users just set CFLAGS before invoking
85# configure. This option doesn't really add much...
86#
87#   --enable-tempstore
88#
89# AC_ARG_ENABLE(tempstore, [AS_HELP_STRING(
90#   [--enable-tempstore],
91#   [in-memory temporary tables (never, no, yes, always) [default=no]])],
92#   [], [enable_tempstore=no])
93# AC_MSG_CHECKING([for whether or not to store temp tables in-memory])
94# case "$enable_tempstore" in
95#   never )  TEMP_STORE=0 ;;
96#   no )     TEMP_STORE=1 ;;
97#   always ) TEMP_STORE=3 ;;
98#   yes )    TEMP_STORE=3 ;;
99#   * )
100#     TEMP_STORE=1
101#     enable_tempstore=yes
102#   ;;
103# esac
104# AC_MSG_RESULT($enable_tempstore)
105# AC_SUBST(TEMP_STORE)
106#-----------------------------------------------------------------------
107
108AC_OUTPUT
109