OLD | NEW |
| (Empty) |
1 # | |
2 # The build process allows for using a cross-compiler. But the default | |
3 # action is to target the same platform that we are running on. The | |
4 # configure script needs to discover the following properties of the | |
5 # build and target systems: | |
6 # | |
7 # srcdir | |
8 # | |
9 # The is the name of the directory that contains the | |
10 # "configure" shell script. All source files are | |
11 # located relative to this directory. | |
12 # | |
13 # bindir | |
14 # | |
15 # The name of the directory where executables should be | |
16 # written by the "install" target of the makefile. | |
17 # | |
18 # program_prefix | |
19 # | |
20 # Add this prefix to the names of all executables that run | |
21 # on the target machine. Default: "" | |
22 # | |
23 # ENABLE_SHARED | |
24 # | |
25 # True if shared libraries should be generated. | |
26 # | |
27 # BUILD_CC | |
28 # | |
29 # The name of a command that is used to convert C | |
30 # source files into executables that run on the build | |
31 # platform. | |
32 # | |
33 # BUILD_CFLAGS | |
34 # | |
35 # Switches that the build compiler needs in order to construct | |
36 # command-line programs. | |
37 # | |
38 # BUILD_LIBS | |
39 # | |
40 # Libraries that the build compiler needs in order to construct | |
41 # command-line programs. | |
42 # | |
43 # BUILD_EXEEXT | |
44 # | |
45 # The filename extension for executables on the build | |
46 # platform. "" for Unix and ".exe" for Windows. | |
47 # | |
48 # TCL_* | |
49 # | |
50 # Lots of values are read in from the tclConfig.sh script, | |
51 # if that script is available. This values are used for | |
52 # constructing and installing the TCL extension. | |
53 # | |
54 # TARGET_READLINE_LIBS | |
55 # | |
56 # This is the library directives passed to the target linker | |
57 # that cause the executable to link against the readline library. | |
58 # This might be a switch like "-lreadline" or pathnames of library | |
59 # file like "../../src/libreadline.a". | |
60 # | |
61 # TARGET_READLINE_INC | |
62 # | |
63 # This variables define the directory that contain header | |
64 # files for the readline library. If the compiler is able | |
65 # to find <readline.h> on its own, then this can be blank. | |
66 # | |
67 # TARGET_EXEEXT | |
68 # | |
69 # The filename extension for executables on the | |
70 # target platform. "" for Unix and ".exe" for windows. | |
71 # | |
72 # This configure.in file is easy to reuse on other projects. Just | |
73 # change the argument to AC_INIT(). And disable any features that | |
74 # you don't need (for example BLT) by erasing or commenting out | |
75 # the corresponding code. | |
76 # | |
77 AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) | |
78 | |
79 dnl Make sure the local VERSION file matches this configure script | |
80 sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'` | |
81 if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then | |
82 AC_MSG_ERROR([configure script is out of date: | |
83 configure \$PACKAGE_VERSION = $PACKAGE_VERSION | |
84 top level VERSION file = $sqlite_version_sanity_check | |
85 please regen with autoconf]) | |
86 fi | |
87 | |
88 ######### | |
89 # Programs needed | |
90 # | |
91 AC_PROG_LIBTOOL | |
92 AC_PROG_INSTALL | |
93 | |
94 ######### | |
95 # Enable large file support (if special flags are necessary) | |
96 # | |
97 AC_SYS_LARGEFILE | |
98 | |
99 ######### | |
100 # Check for needed/wanted data types | |
101 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t, | |
102 uint16_t, uint32_t, uint64_t, uintptr_t]) | |
103 | |
104 ######### | |
105 # Check for needed/wanted headers | |
106 AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h]) | |
107 | |
108 ######### | |
109 # Figure out whether or not we have these functions | |
110 # | |
111 AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_s
ize strchrnul usleep utime]) | |
112 | |
113 ######### | |
114 # By default, we use the amalgamation (this may be changed below...) | |
115 # | |
116 USE_AMALGAMATION=1 | |
117 | |
118 ######### | |
119 # See whether we can run specific tclsh versions known to work well; | |
120 # if not, then we fall back to plain tclsh. | |
121 # TODO: try other versions before falling back? | |
122 # | |
123 AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh8.5 tclsh], none) | |
124 if test "$TCLSH_CMD" = "none"; then | |
125 # If we can't find a local tclsh, then building the amalgamation will fail. | |
126 # We act as though --disable-amalgamation has been used. | |
127 echo "Warning: can't find tclsh - defaulting to non-amalgamation build." | |
128 USE_AMALGAMATION=0 | |
129 TCLSH_CMD="tclsh" | |
130 fi | |
131 AC_SUBST(TCLSH_CMD) | |
132 | |
133 AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) | |
134 if test "x${TCLLIBDIR+set}" != "xset" ; then | |
135 TCLLIBDIR='$(libdir)' | |
136 for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do | |
137 TCLLIBDIR=$i | |
138 break | |
139 done | |
140 TCLLIBDIR="${TCLLIBDIR}/sqlite3" | |
141 fi | |
142 | |
143 | |
144 ######### | |
145 # Set up an appropriate program prefix | |
146 # | |
147 if test "$program_prefix" = "NONE"; then | |
148 program_prefix="" | |
149 fi | |
150 AC_SUBST(program_prefix) | |
151 | |
152 VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`] | |
153 AC_MSG_NOTICE(Version set to $VERSION) | |
154 AC_SUBST(VERSION) | |
155 RELEASE=`cat $srcdir/VERSION` | |
156 AC_MSG_NOTICE(Release set to $RELEASE) | |
157 AC_SUBST(RELEASE) | |
158 VERSION_NUMBER=[`cat $srcdir/VERSION \ | |
159 | sed 's/[^0-9]/ /g' \ | |
160 | awk '{printf "%d%03d%03d",$1,$2,$3}'`] | |
161 AC_MSG_NOTICE(Version number set to $VERSION_NUMBER) | |
162 AC_SUBST(VERSION_NUMBER) | |
163 | |
164 ######### | |
165 # Locate a compiler for the build machine. This compiler should | |
166 # generate command-line programs that run on the build machine. | |
167 # | |
168 if test x"$cross_compiling" = xno; then | |
169 BUILD_CC=$CC | |
170 BUILD_CFLAGS=$CFLAGS | |
171 else | |
172 if test "${BUILD_CC+set}" != set; then | |
173 AC_CHECK_PROGS(BUILD_CC, gcc cc cl) | |
174 fi | |
175 if test "${BUILD_CFLAGS+set}" != set; then | |
176 BUILD_CFLAGS="-g" | |
177 fi | |
178 fi | |
179 AC_SUBST(BUILD_CC) | |
180 | |
181 ########## | |
182 # Do we want to support multithreaded use of sqlite | |
183 # | |
184 AC_ARG_ENABLE(threadsafe, | |
185 AC_HELP_STRING([--disable-threadsafe],[Disable mutexing]),,enable_threadsafe=yes
) | |
186 AC_MSG_CHECKING([whether to support threadsafe operation]) | |
187 if test "$enable_threadsafe" = "no"; then | |
188 SQLITE_THREADSAFE=0 | |
189 AC_MSG_RESULT([no]) | |
190 else | |
191 SQLITE_THREADSAFE=1 | |
192 AC_MSG_RESULT([yes]) | |
193 fi | |
194 AC_SUBST(SQLITE_THREADSAFE) | |
195 | |
196 if test "$SQLITE_THREADSAFE" = "1"; then | |
197 AC_SEARCH_LIBS(pthread_create, pthread) | |
198 fi | |
199 | |
200 ########## | |
201 # Do we want to support release | |
202 # | |
203 AC_ARG_ENABLE(releasemode, | |
204 AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,e
nable_releasemode=no) | |
205 AC_MSG_CHECKING([whether to support shared library linked as release mode or not
]) | |
206 if test "$enable_releasemode" = "no"; then | |
207 ALLOWRELEASE="" | |
208 AC_MSG_RESULT([no]) | |
209 else | |
210 ALLOWRELEASE="-release `cat $srcdir/VERSION`" | |
211 AC_MSG_RESULT([yes]) | |
212 fi | |
213 AC_SUBST(ALLOWRELEASE) | |
214 | |
215 ########## | |
216 # Do we want temporary databases in memory | |
217 # | |
218 AC_ARG_ENABLE(tempstore, | |
219 AC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables
(never,no,yes,always)]),,enable_tempstore=no) | |
220 AC_MSG_CHECKING([whether to use an in-ram database for temporary tables]) | |
221 case "$enable_tempstore" in | |
222 never ) | |
223 TEMP_STORE=0 | |
224 AC_MSG_RESULT([never]) | |
225 ;; | |
226 no ) | |
227 TEMP_STORE=1 | |
228 AC_MSG_RESULT([no]) | |
229 ;; | |
230 yes ) | |
231 TEMP_STORE=2 | |
232 AC_MSG_RESULT([yes]) | |
233 ;; | |
234 always ) | |
235 TEMP_STORE=3 | |
236 AC_MSG_RESULT([always]) | |
237 ;; | |
238 * ) | |
239 TEMP_STORE=1 | |
240 AC_MSG_RESULT([no]) | |
241 ;; | |
242 esac | |
243 | |
244 AC_SUBST(TEMP_STORE) | |
245 | |
246 ########### | |
247 # Lots of things are different if we are compiling for Windows using | |
248 # the CYGWIN environment. So check for that special case and handle | |
249 # things accordingly. | |
250 # | |
251 AC_MSG_CHECKING([if executables have the .exe suffix]) | |
252 if test "$config_BUILD_EXEEXT" = ".exe"; then | |
253 CYGWIN=yes | |
254 AC_MSG_RESULT(yes) | |
255 else | |
256 AC_MSG_RESULT(unknown) | |
257 fi | |
258 if test "$CYGWIN" != "yes"; then | |
259 AC_CYGWIN | |
260 fi | |
261 if test "$CYGWIN" = "yes"; then | |
262 BUILD_EXEEXT=.exe | |
263 else | |
264 BUILD_EXEEXT=$EXEEXT | |
265 fi | |
266 if test x"$cross_compiling" = xno; then | |
267 TARGET_EXEEXT=$BUILD_EXEEXT | |
268 else | |
269 TARGET_EXEEXT=$config_TARGET_EXEEXT | |
270 fi | |
271 if test "$TARGET_EXEEXT" = ".exe"; then | |
272 SQLITE_OS_UNIX=0 | |
273 SQLITE_OS_WIN=1 | |
274 CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" | |
275 else | |
276 SQLITE_OS_UNIX=1 | |
277 SQLITE_OS_WIN=0 | |
278 CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" | |
279 fi | |
280 | |
281 AC_SUBST(BUILD_EXEEXT) | |
282 AC_SUBST(SQLITE_OS_UNIX) | |
283 AC_SUBST(SQLITE_OS_WIN) | |
284 AC_SUBST(TARGET_EXEEXT) | |
285 | |
286 ########## | |
287 # Figure out all the parameters needed to compile against Tcl. | |
288 # | |
289 # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG | |
290 # macros in the in the tcl.m4 file of the standard TCL distribution. | |
291 # Those macros could not be used directly since we have to make some | |
292 # minor changes to accomodate systems that do not have TCL installed. | |
293 # | |
294 AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]), | |
295 [use_tcl=$enableval],[use_tcl=yes]) | |
296 if test "${use_tcl}" = "yes" ; then | |
297 AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl con
figuration (tclConfig.sh)]), with_tclconfig=${withval}) | |
298 AC_MSG_CHECKING([for Tcl configuration]) | |
299 AC_CACHE_VAL(ac_cv_c_tclconfig,[ | |
300 # First check to see if --with-tcl was specified. | |
301 if test x"${with_tclconfig}" != x ; then | |
302 if test -f "${with_tclconfig}/tclConfig.sh" ; then | |
303 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` | |
304 else | |
305 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) | |
306 fi | |
307 fi | |
308 | |
309 # Start autosearch by asking tclsh | |
310 if test x"${ac_cv_c_tclconfig}" = x ; then | |
311 if test x"$cross_compiling" = xno; then | |
312 for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` | |
313 do | |
314 if test -f "$i/tclConfig.sh" ; then | |
315 ac_cv_c_tclconfig="$i" | |
316 break | |
317 fi | |
318 done | |
319 fi | |
320 fi | |
321 | |
322 # On ubuntu 14.10, $auto_path on tclsh is not quite correct. | |
323 # So try again after applying corrections. | |
324 if test x"${ac_cv_c_tclconfig}" = x ; then | |
325 if test x"$cross_compiling" = xno; then | |
326 for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD} | sed 's,/tcltk/t
cl,/tcl,g'` | |
327 do | |
328 if test -f "$i/tclConfig.sh" ; then | |
329 ac_cv_c_tclconfig="$i" | |
330 break | |
331 fi | |
332 done | |
333 fi | |
334 fi | |
335 | |
336 # then check for a private Tcl installation | |
337 if test x"${ac_cv_c_tclconfig}" = x ; then | |
338 for i in \ | |
339 ../tcl \ | |
340 `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ | |
341 `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ | |
342 `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ | |
343 ../../tcl \ | |
344 `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ | |
345 `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ | |
346 `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ | |
347 ../../../tcl \ | |
348 `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ | |
349 `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ | |
350 `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` | |
351 do | |
352 if test -f "$i/unix/tclConfig.sh" ; then | |
353 ac_cv_c_tclconfig=`(cd $i/unix; pwd)` | |
354 break | |
355 fi | |
356 done | |
357 fi | |
358 | |
359 # check in a few common install locations | |
360 if test x"${ac_cv_c_tclconfig}" = x ; then | |
361 for i in \ | |
362 `ls -d ${libdir} 2>/dev/null` \ | |
363 `ls -d /usr/local/lib 2>/dev/null` \ | |
364 `ls -d /usr/contrib/lib 2>/dev/null` \ | |
365 `ls -d /usr/lib 2>/dev/null` | |
366 do | |
367 if test -f "$i/tclConfig.sh" ; then | |
368 ac_cv_c_tclconfig=`(cd $i; pwd)` | |
369 break | |
370 fi | |
371 done | |
372 fi | |
373 | |
374 # check in a few other private locations | |
375 if test x"${ac_cv_c_tclconfig}" = x ; then | |
376 for i in \ | |
377 ${srcdir}/../tcl \ | |
378 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ | |
379 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ | |
380 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` | |
381 do | |
382 if test -f "$i/unix/tclConfig.sh" ; then | |
383 ac_cv_c_tclconfig=`(cd $i/unix; pwd)` | |
384 break | |
385 fi | |
386 done | |
387 fi | |
388 ]) | |
389 | |
390 if test x"${ac_cv_c_tclconfig}" = x ; then | |
391 use_tcl=no | |
392 AC_MSG_WARN(Can't find Tcl configuration definitions) | |
393 AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***) | |
394 AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***) | |
395 else | |
396 TCL_BIN_DIR=${ac_cv_c_tclconfig} | |
397 AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) | |
398 | |
399 AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) | |
400 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then | |
401 AC_MSG_RESULT([loading]) | |
402 . $TCL_BIN_DIR/tclConfig.sh | |
403 else | |
404 AC_MSG_RESULT([file not found]) | |
405 fi | |
406 | |
407 # | |
408 # If the TCL_BIN_DIR is the build directory (not the install directory), | |
409 # then set the common variable name to the value of the build variables. | |
410 # For example, the variable TCL_LIB_SPEC will be set to the value | |
411 # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC | |
412 # instead of TCL_BUILD_LIB_SPEC since it will work with both an | |
413 # installed and uninstalled version of Tcl. | |
414 # | |
415 | |
416 if test -f $TCL_BIN_DIR/Makefile ; then | |
417 TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} | |
418 TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} | |
419 TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} | |
420 fi | |
421 | |
422 # | |
423 # eval is required to do the TCL_DBGX substitution | |
424 # | |
425 | |
426 eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" | |
427 eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" | |
428 eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" | |
429 | |
430 eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" | |
431 eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" | |
432 eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" | |
433 | |
434 AC_SUBST(TCL_VERSION) | |
435 AC_SUBST(TCL_BIN_DIR) | |
436 AC_SUBST(TCL_SRC_DIR) | |
437 AC_SUBST(TCL_INCLUDE_SPEC) | |
438 | |
439 AC_SUBST(TCL_LIB_FILE) | |
440 AC_SUBST(TCL_LIB_FLAG) | |
441 AC_SUBST(TCL_LIB_SPEC) | |
442 | |
443 AC_SUBST(TCL_STUB_LIB_FILE) | |
444 AC_SUBST(TCL_STUB_LIB_FLAG) | |
445 AC_SUBST(TCL_STUB_LIB_SPEC) | |
446 AC_SUBST(TCL_SHLIB_SUFFIX) | |
447 fi | |
448 fi | |
449 if test "${use_tcl}" = "no" ; then | |
450 HAVE_TCL="" | |
451 else | |
452 HAVE_TCL=1 | |
453 fi | |
454 AC_SUBST(HAVE_TCL) | |
455 | |
456 ########## | |
457 # Figure out what C libraries are required to compile programs | |
458 # that use "readline()" library. | |
459 # | |
460 TARGET_READLINE_LIBS="" | |
461 TARGET_READLINE_INC="" | |
462 TARGET_HAVE_READLINE=0 | |
463 TARGET_HAVE_EDITLINE=0 | |
464 AC_ARG_ENABLE([editline], | |
465 [AC_HELP_STRING([--enable-editline],[enable BSD editline support])], | |
466 [with_editline=$enableval], | |
467 [with_editline=auto]) | |
468 AC_ARG_ENABLE([readline], | |
469 [AC_HELP_STRING([--disable-readline],[disable readline support])], | |
470 [with_readline=$enableval], | |
471 [with_readline=auto]) | |
472 | |
473 if test x"$with_editline" != xno; then | |
474 sLIBS=$LIBS | |
475 LIBS="" | |
476 TARGET_HAVE_EDITLINE=1 | |
477 AC_SEARCH_LIBS(readline,edit,[with_readline=no],[TARGET_HAVE_EDITLINE=0]
) | |
478 TARGET_READLINE_LIBS=$LIBS | |
479 LIBS=$sLIBS | |
480 fi | |
481 if test x"$with_readline" != xno; then | |
482 found="yes" | |
483 | |
484 AC_ARG_WITH([readline-lib], | |
485 [AC_HELP_STRING([--with-readline-lib],[specify readline library]
)], | |
486 [with_readline_lib=$withval], | |
487 [with_readline_lib="auto"]) | |
488 if test "x$with_readline_lib" = xauto; then | |
489 save_LIBS="$LIBS" | |
490 LIBS="" | |
491 AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term
_LIBS="$LIBS"], [term_LIBS=""]) | |
492 AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lre
adline"], [found="no"]) | |
493 TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS" | |
494 LIBS="$save_LIBS" | |
495 else | |
496 TARGET_READLINE_LIBS="$with_readline_lib" | |
497 fi | |
498 | |
499 AC_ARG_WITH([readline-inc], | |
500 [AC_HELP_STRING([--with-readline-inc],[specify readline include
paths])], | |
501 [with_readline_inc=$withval], | |
502 [with_readline_inc="auto"]) | |
503 if test "x$with_readline_inc" = xauto; then | |
504 AC_CHECK_HEADER(readline.h, [found="yes"], [ | |
505 found="no" | |
506 if test "$cross_compiling" != yes; then | |
507 for dir in /usr /usr/local /usr/local/readline /
usr/contrib /mingw; do | |
508 for subdir in include include/readline;
do | |
509 AC_CHECK_FILE($dir/$subdir/readl
ine.h, found=yes) | |
510 if test "$found" = "yes"; then | |
511 TARGET_READLINE_INC="-I$
dir/$subdir" | |
512 break | |
513 fi | |
514 done | |
515 test "$found" = "yes" && break | |
516 done | |
517 fi | |
518 ]) | |
519 else | |
520 TARGET_READLINE_INC="$with_readline_inc" | |
521 fi | |
522 | |
523 if test x"$found" = xno; then | |
524 TARGET_READLINE_LIBS="" | |
525 TARGET_READLINE_INC="" | |
526 TARGET_HAVE_READLINE=0 | |
527 else | |
528 TARGET_HAVE_READLINE=1 | |
529 fi | |
530 fi | |
531 | |
532 AC_SUBST(TARGET_READLINE_LIBS) | |
533 AC_SUBST(TARGET_READLINE_INC) | |
534 AC_SUBST(TARGET_HAVE_READLINE) | |
535 AC_SUBST(TARGET_HAVE_EDITLINE) | |
536 | |
537 ########## | |
538 # Figure out what C libraries are required to compile programs | |
539 # that use "fdatasync()" function. | |
540 # | |
541 AC_SEARCH_LIBS(fdatasync, [rt]) | |
542 | |
543 ######### | |
544 # check for debug enabled | |
545 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose
explain]), | |
546 [use_debug=$enableval],[use_debug=no]) | |
547 if test "${use_debug}" = "yes" ; then | |
548 TARGET_DEBUG="-DSQLITE_DEBUG=1" | |
549 else | |
550 TARGET_DEBUG="-DNDEBUG" | |
551 fi | |
552 AC_SUBST(TARGET_DEBUG) | |
553 | |
554 ######### | |
555 # See whether we should use the amalgamation to build | |
556 AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation], | |
557 [Disable the amalgamation and instead build all files separately]), | |
558 [use_amalgamation=$enableval],[use_amalgamation=yes]) | |
559 if test "${use_amalgamation}" != "yes" ; then | |
560 USE_AMALGAMATION=0 | |
561 fi | |
562 AC_SUBST(USE_AMALGAMATION) | |
563 | |
564 ######### | |
565 # See whether we should allow loadable extensions | |
566 AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--disable-load-extension], | |
567 [Disable loading of external extensions]), | |
568 [use_loadextension=$enableval],[use_loadextension=yes]) | |
569 if test "${use_loadextension}" = "yes" ; then | |
570 OPT_FEATURE_FLAGS="" | |
571 AC_SEARCH_LIBS(dlopen, dl) | |
572 else | |
573 OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" | |
574 fi | |
575 | |
576 ######### | |
577 # See whether we should enable Full Text Search extensions | |
578 AC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3], | |
579 [Enable the FTS3 extension]), | |
580 [enable_fts3=yes],[enable_fts3=no]) | |
581 if test "${enable_fts3}" = "yes" ; then | |
582 OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS3" | |
583 fi | |
584 AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4], | |
585 [Enable the FTS4 extension]), | |
586 [enable_fts4=yes],[enable_fts4=no]) | |
587 if test "${enable_fts4}" = "yes" ; then | |
588 OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS4" | |
589 AC_SEARCH_LIBS([log],[m]) | |
590 fi | |
591 AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5], | |
592 [Enable the FTS5 extension]), | |
593 [enable_fts5=yes],[enable_fts5=no]) | |
594 if test "${enable_fts5}" = "yes" ; then | |
595 OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_FTS5" | |
596 AC_SEARCH_LIBS([log],[m]) | |
597 fi | |
598 | |
599 ######### | |
600 # See whether we should enable JSON1 | |
601 AC_ARG_ENABLE(json1, AC_HELP_STRING([--enable-json1], | |
602 [Enable the JSON1 extension]), | |
603 [enable_json1=yes],[enable_json1=no]) | |
604 if test "${enable_json1}" = "yes" ; then | |
605 OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_JSON1" | |
606 fi | |
607 | |
608 ######### | |
609 # See whether we should enable RTREE | |
610 AC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree], | |
611 [Enable the RTREE extension]), | |
612 [enable_rtree=yes],[enable_rtree=no]) | |
613 if test "${enable_rtree}" = "yes" ; then | |
614 OPT_FEATURE_FLAGS+=" -DSQLITE_ENABLE_RTREE" | |
615 fi | |
616 | |
617 ######### | |
618 # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) param
eter | |
619 for option in $CFLAGS $CPPFLAGS | |
620 do | |
621 case $option in | |
622 -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; | |
623 -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; | |
624 esac | |
625 done | |
626 AC_SUBST(OPT_FEATURE_FLAGS) | |
627 | |
628 | |
629 # attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter | |
630 ac_temp_CFLAGS="" | |
631 for option in $CFLAGS | |
632 do | |
633 case $option in | |
634 -DSQLITE_OMIT*) ;; | |
635 -DSQLITE_ENABLE*) ;; | |
636 *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";; | |
637 esac | |
638 done | |
639 CFLAGS=$ac_temp_CFLAGS | |
640 | |
641 | |
642 # attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter | |
643 ac_temp_CPPFLAGS="" | |
644 for option in $CPPFLAGS | |
645 do | |
646 case $option in | |
647 -DSQLITE_OMIT*) ;; | |
648 -DSQLITE_ENABLE*) ;; | |
649 *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";; | |
650 esac | |
651 done | |
652 CPPFLAGS=$ac_temp_CPPFLAGS | |
653 | |
654 | |
655 # attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter | |
656 ac_temp_BUILD_CFLAGS="" | |
657 for option in $BUILD_CFLAGS | |
658 do | |
659 case $option in | |
660 -DSQLITE_OMIT*) ;; | |
661 -DSQLITE_ENABLE*) ;; | |
662 *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";; | |
663 esac | |
664 done | |
665 BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS | |
666 | |
667 | |
668 ######### | |
669 # See whether we should use GCOV | |
670 AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov], | |
671 [Enable coverage testing using gcov]), | |
672 [use_gcov=$enableval],[use_gcov=no]) | |
673 if test "${use_gcov}" = "yes" ; then | |
674 USE_GCOV=1 | |
675 else | |
676 USE_GCOV=0 | |
677 fi | |
678 AC_SUBST(USE_GCOV) | |
679 | |
680 | |
681 ######### | |
682 # Output the config header | |
683 AC_CONFIG_HEADERS(config.h) | |
684 | |
685 ######### | |
686 # Generate the output files. | |
687 # | |
688 AC_SUBST(BUILD_CFLAGS) | |
689 AC_OUTPUT([ | |
690 Makefile | |
691 sqlite3.pc | |
692 ]) | |
OLD | NEW |