]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/sqlite3/configure.ac
Import the skein hashing algorithm, based on the threefish block cipher
[FreeBSD/FreeBSD.git] / contrib / sqlite3 / configure.ac
1
2 #-----------------------------------------------------------------------
3 # Supports the following non-standard switches.
4 #
5 #   --enable-threadsafe
6 #   --enable-readline
7 #   --enable-editline
8 #   --enable-static-shell
9 #   --enable-dynamic-extensions
10 #
11
12 AC_PREREQ(2.61)
13 AC_INIT(sqlite, 3.12.1, http://www.sqlite.org)
14 AC_CONFIG_SRCDIR([sqlite3.c])
15
16 # Use automake.
17 AM_INIT_AUTOMAKE([foreign])
18
19 AC_SYS_LARGEFILE
20
21 # Check for required programs.
22 AC_PROG_CC
23 AC_PROG_LIBTOOL
24 AC_PROG_MKDIR_P
25
26 # Check for library functions that SQLite can optionally use.
27 AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r])
28 AC_FUNC_STRERROR_R
29
30 AC_CONFIG_FILES([Makefile sqlite3.pc])
31 AC_SUBST(BUILD_CFLAGS)
32
33 #-----------------------------------------------------------------------
34 #   --enable-editline
35 #   --enable-readline
36 #
37 AC_ARG_ENABLE(editline, [AS_HELP_STRING(
38   [--enable-editline], 
39   [use BSD libedit])], 
40   [], [enable_editline=yes])
41 AC_ARG_ENABLE(readline, [AS_HELP_STRING(
42   [--enable-readline], 
43   [use readline])], 
44   [], [enable_readline=no])
45 if 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)
52   else
53     unset ac_cv_search_readline
54   fi
55   LIBS=$sLIBS
56 fi
57 if 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
65 fi
66 AC_SUBST(READLINE_LIBS)
67 #-----------------------------------------------------------------------
68
69 #-----------------------------------------------------------------------
70 #   --enable-threadsafe
71 #
72 AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
73   [--enable-threadsafe], [build a thread-safe library [default=yes]])], 
74   [], [enable_threadsafe=yes])
75 THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
76 if test x"$enable_threadsafe" != "xno"; then
77   THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
78   AC_SEARCH_LIBS(pthread_create, pthread)
79   AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
80 fi
81 AC_SUBST(THREADSAFE_FLAGS)
82 #-----------------------------------------------------------------------
83
84 #-----------------------------------------------------------------------
85 #   --enable-dynamic-extensions
86 #
87 AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING(
88   [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], 
89   [], [enable_dynamic_extensions=yes])
90 if test x"$enable_dynamic_extensions" != "xno"; then
91   AC_SEARCH_LIBS(dlopen, dl)
92 else
93   DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1
94 fi
95 AC_MSG_CHECKING([for whether to support dynamic extensions])
96 AC_MSG_RESULT($enable_dynamic_extensions)
97 AC_SUBST(DYNAMIC_EXTENSION_FLAGS)
98 #-----------------------------------------------------------------------
99
100 #-----------------------------------------------------------------------
101 #   --enable-fts5
102 #
103 AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
104   [--enable-fts5], [include fts5 support [default=no]])], 
105   [], [enable_fts5=no])
106 if test x"$enable_fts5" == "xyes"; then
107   AC_SEARCH_LIBS(log, m)
108   FTS5_FLAGS=-DSQLITE_ENABLE_FTS5
109 fi
110 AC_SUBST(FTS5_FLAGS)
111 #-----------------------------------------------------------------------
112
113 #-----------------------------------------------------------------------
114 #   --enable-json1
115 #
116 AC_ARG_ENABLE(json1, [AS_HELP_STRING(
117   [--enable-json1], [include json1 support [default=no]])], 
118   [], [enable_json1=no])
119 if test x"$enable_json1" == "xyes"; then
120   JSON1_FLAGS=-DSQLITE_ENABLE_JSON1
121 fi
122 AC_SUBST(JSON1_FLAGS)
123 #-----------------------------------------------------------------------
124
125 #-----------------------------------------------------------------------
126 #   --enable-static-shell
127 #
128 AC_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])
132 if test x"$enable_static_shell" == "xyes"; then
133   EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
134 else
135   EXTRA_SHELL_OBJ=libsqlite3.la
136 fi
137 AC_SUBST(EXTRA_SHELL_OBJ)
138 #-----------------------------------------------------------------------
139
140 AC_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
167 AC_OUTPUT