blob: 0d1fb6cc423c71f1d30afe1c0772c13c970fbfde [file] [log] [blame]
drh71eb93e2001-09-28 01:34:43 +00001#
drh71eb93e2001-09-28 01:34:43 +00002# 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# TARGET_CC
49#
50# The name of a command that runs on the build platform
51# and converts C source files into *.o files for the
52# target platform. In other words, the cross-compiler.
53#
54# TARGET_CFLAGS
55#
56# Switches that the target compiler needs to turn C source files
57# into *.o files. Do not include TARGET_TCL_INC in this list.
58# Makefiles might add additional switches such as "-I.".
59#
drh7b5717e2004-11-25 13:50:01 +000060# TCL_*
drh71eb93e2001-09-28 01:34:43 +000061#
drh7b5717e2004-11-25 13:50:01 +000062# Lots of values are read in from the tclConfig.sh script,
drh4b2266a2004-11-27 15:52:16 +000063# if that script is available. This values are used for
64# constructing and installing the TCL extension.
drh71eb93e2001-09-28 01:34:43 +000065#
66# TARGET_READLINE_LIBS
67#
68# This is the library directives passed to the target linker
69# that cause the executable to link against the readline library.
70# This might be a switch like "-lreadline" or pathnames of library
71# file like "../../src/libreadline.a".
72#
73# TARGET_READLINE_INC
74#
75# This variables define the directory that contain header
76# files for the readline library. If the compiler is able
77# to find <readline.h> on its own, then this can be blank.
78#
79# TARGET_LINK
80#
81# The name of the linker that combines *.o files generated
82# by TARGET_CC into executables for the target platform.
83#
84# TARGET_LIBS
85#
86# Additional libraries or other switch that the target linker needs
87# to build an executable on the target. Do not include
88# on this list any libraries in TARGET_TCL_LIBS and
89# TARGET_READLINE_LIBS, etc.
90#
91# TARGET_EXEEXT
92#
93# The filename extension for executables on the
94# target platform. "" for Unix and ".exe" for windows.
95#
96# The generated configure script will make an attempt to guess
97# at all of the above parameters. You can override any of
98# the guesses by setting the environment variable named
99# "config_AAAA" where "AAAA" is the name of the parameter
100# described above. (Exception: srcdir cannot be set this way.)
101# If you have a file that sets one or more of these environment
102# variables, you can invoke configure as follows:
103#
104# configure --with-hints=FILE
105#
106# where FILE is the name of the file that sets the environment
107# variables. FILE should be an absolute pathname.
108#
drh71eb93e2001-09-28 01:34:43 +0000109# This configure.in file is easy to reuse on other projects. Just
110# change the argument to AC_INIT(). And disable any features that
111# you don't need (for example BLT) by erasing or commenting out
112# the corresponding code.
113#
114AC_INIT(src/sqlite.h.in)
115
116dnl Put the RCS revision string after AC_INIT so that it will also
117dnl show in in configure.
118# The following RCS revision string applies to configure.in
drhb571b452004-12-10 02:20:27 +0000119# $Revision: 1.14 $
drh71eb93e2001-09-28 01:34:43 +0000120
121#########
122# Programs needed
123#
124AC_PROG_LIBTOOL
125AC_PROG_INSTALL
126
127#########
128# Set up an appropriate program prefix
129#
130if test "$program_prefix" = "NONE"; then
131 program_prefix=""
132fi
133AC_SUBST(program_prefix)
134
drh4b2266a2004-11-27 15:52:16 +0000135VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`]
136echo "Version set to $VERSION"
a.rottmannc7e93832003-03-24 09:39:32 +0000137AC_SUBST(VERSION)
drh4b2266a2004-11-27 15:52:16 +0000138RELEASE=`cat $srcdir/VERSION`
139echo "Release set to $RELEASE"
140AC_SUBST(RELEASE)
a.rottmannc7e93832003-03-24 09:39:32 +0000141
drh71eb93e2001-09-28 01:34:43 +0000142#########
143# Check to see if the --with-hints=FILE option is used. If there is none,
144# then check for a files named "$host.hints" and ../$hosts.hints where
145# $host is the hostname of the build system. If still no hints are
146# found, try looking in $system.hints and ../$system.hints where
147# $system is the result of uname -s.
148#
149AC_ARG_WITH(hints,
150 [ --with-hints=FILE Read configuration options from FILE],
151 hints=$withval)
152if test "$hints" = ""; then
153 host=`hostname | sed 's/\..*//'`
154 if test -r $host.hints; then
155 hints=$host.hints
156 else
157 if test -r ../$host.hints; then
158 hints=../$host.hints
159 fi
160 fi
161fi
162if test "$hints" = ""; then
163 sys=`uname -s`
164 if test -r $sys.hints; then
165 hints=$sys.hints
166 else
167 if test -r ../$sys.hints; then
168 hints=../$sys.hints
169 fi
170 fi
171fi
172if test "$hints" != ""; then
173 AC_MSG_RESULT(reading hints from $hints)
174 . $hints
175fi
176
177#########
178# Locate a compiler for the build machine. This compiler should
179# generate command-line programs that run on the build machine.
180#
181default_build_cflags="-g"
182if test "$config_BUILD_CC" = ""; then
183 AC_PROG_CC
184 if test "$cross_compiling" = "yes"; then
185 AC_MSG_ERROR([unable to find a compiler for building build tools])
186 fi
187 BUILD_CC=$CC
188 default_build_cflags=$CFLAGS
189else
190 BUILD_CC=$config_BUILD_CC
191 AC_MSG_CHECKING([host compiler])
192 CC=$BUILD_CC
193 AC_MSG_RESULT($BUILD_CC)
194fi
195AC_MSG_CHECKING([switches for the host compiler])
196if test "$config_BUILD_CFLAGS" != ""; then
197 CFLAGS=$config_BUILD_CFLAGS
198 BUILD_CFLAGS=$config_BUILD_CFLAGS
199else
200 BUILD_CFLAGS=$default_build_cflags
201fi
202AC_MSG_RESULT($BUILD_CFLAGS)
203if test "$config_BUILD_LIBS" != ""; then
204 BUILD_LIBS=$config_BUILD_LIBS
205fi
206AC_SUBST(BUILD_CC)
207AC_SUBST(BUILD_CFLAGS)
208AC_SUBST(BUILD_LIBS)
209
210##########
211# Locate a compiler that converts C code into *.o files that run on
212# the target machine.
213#
214AC_MSG_CHECKING([target compiler])
215if test "$config_TARGET_CC" != ""; then
216 TARGET_CC=$config_TARGET_CC
217else
218 TARGET_CC=$BUILD_CC
219fi
220AC_MSG_RESULT($TARGET_CC)
221AC_MSG_CHECKING([switches on the target compiler])
222if test "$config_TARGET_CFLAGS" != ""; then
223 TARGET_CFLAGS=$config_TARGET_CFLAGS
224else
225 TARGET_CFLAGS=$BUILD_CFLAGS
226fi
227AC_MSG_RESULT($TARGET_CFLAGS)
228AC_MSG_CHECKING([target linker])
229if test "$config_TARGET_LINK" = ""; then
230 TARGET_LINK=$TARGET_CC
231else
232 TARGET_LINK=$config_TARGET_LINK
233fi
234AC_MSG_RESULT($TARGET_LINK)
235AC_MSG_CHECKING([switches on the target compiler])
236if test "$config_TARGET_TFLAGS" != ""; then
237 TARGET_TFLAGS=$config_TARGET_TFLAGS
238else
239 TARGET_TFLAGS=$BUILD_CFLAGS
240fi
241if test "$config_TARGET_RANLIB" != ""; then
242 TARGET_RANLIB=$config_TARGET_RANLIB
243else
244 AC_PROG_RANLIB
245 TARGET_RANLIB=$RANLIB
246fi
247if test "$config_TARGET_AR" != ""; then
248 TARGET_AR=$config_TARGET_AR
249else
250 TARGET_AR='ar cr'
251fi
252AC_MSG_RESULT($TARGET_TFLAGS)
253AC_SUBST(TARGET_CC)
254AC_SUBST(TARGET_CFLAGS)
255AC_SUBST(TARGET_LINK)
256AC_SUBST(TARGET_LFLAGS)
257AC_SUBST(TARGET_RANLIB)
258AC_SUBST(TARGET_AR)
259
260# Set the $cross variable if we are cross-compiling. Make
261# it 0 if we are not.
262#
263AC_MSG_CHECKING([if host and target compilers are the same])
264if test "$BUILD_CC" = "$TARGET_CC"; then
265 cross=0
266 AC_MSG_RESULT(yes)
267else
268 cross=1
269 AC_MSG_RESULT(no)
270fi
271
272##########
dougcurrie0f290bf2004-06-21 18:57:29 +0000273# Do we want to support multithreaded use of sqlite
drh71eb93e2001-09-28 01:34:43 +0000274#
dougcurrie0f290bf2004-06-21 18:57:29 +0000275AC_ARG_ENABLE(threadsafe,
276[ --enable-threadsafe Support threadsafe operation],,enable_threadsafe=no)
277AC_MSG_CHECKING([whether to support threadsafe operation])
278if test "$enable_threadsafe" = "no"; then
279 THREADSAFE=0
paulb0208cc2003-04-13 18:26:49 +0000280 AC_MSG_RESULT([no])
281else
dougcurrie0f290bf2004-06-21 18:57:29 +0000282 THREADSAFE=1
paulb0208cc2003-04-13 18:26:49 +0000283 AC_MSG_RESULT([yes])
284fi
dougcurrie0f290bf2004-06-21 18:57:29 +0000285AC_SUBST(THREADSAFE)
paulb0208cc2003-04-13 18:26:49 +0000286
dougcurrie65623c72004-09-20 14:57:23 +0000287if test "$THREADSAFE" = "1"; then
288 LIBS=""
289 AC_CHECK_LIB(pthread, pthread_create)
290 TARGET_THREAD_LIB="$LIBS"
291 LIBS=""
292else
293 TARGET_THREAD_LIB=""
294fi
295AC_SUBST(TARGET_THREAD_LIB)
296
paulb0208cc2003-04-13 18:26:49 +0000297##########
xdong3b5543c2003-09-23 00:36:50 +0000298# Do we want to support release
299#
300AC_ARG_ENABLE(releasemode,
301[ --enable-releasemode Support libtool link to release mode],,enable_releasemode=no)
302AC_MSG_CHECKING([whether to support shared library linked as release mode or not])
303if test "$enable_releasemode" = "no"; then
304 ALLOWRELEASE=""
305 AC_MSG_RESULT([no])
306else
307 ALLOWRELEASE="-release `cat VERSION`"
308 AC_MSG_RESULT([yes])
309fi
310AC_SUBST(ALLOWRELEASE)
311
312##########
paulb0208cc2003-04-13 18:26:49 +0000313# Do we want temporary databases in memory
314#
dougcurrie0f290bf2004-06-21 18:57:29 +0000315AC_ARG_ENABLE(tempstore,
316[ --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always)],,enable_tempstore=yes)
paulb0208cc2003-04-13 18:26:49 +0000317AC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
dougcurrie0f290bf2004-06-21 18:57:29 +0000318case "$enable_tempstore" in
paulb0208cc2003-04-13 18:26:49 +0000319 never )
paul2dc96f92003-04-20 11:46:34 +0000320 TEMP_STORE=0
paulb0208cc2003-04-13 18:26:49 +0000321 AC_MSG_RESULT([never])
322 ;;
323 no )
paul2dc96f92003-04-20 11:46:34 +0000324 TEMP_STORE=1
paulb0208cc2003-04-13 18:26:49 +0000325 AC_MSG_RESULT([no])
326 ;;
327 always )
dougcurrie0f290bf2004-06-21 18:57:29 +0000328 TEMP_STORE=3
paulb0208cc2003-04-13 18:26:49 +0000329 AC_MSG_RESULT([always])
330 ;;
331 * )
paul2dc96f92003-04-20 11:46:34 +0000332 TEMP_STORE=2
paulb0208cc2003-04-13 18:26:49 +0000333 AC_MSG_RESULT([yes])
334 ;;
335esac
paul2dc96f92003-04-20 11:46:34 +0000336
paul2dc96f92003-04-20 11:46:34 +0000337AC_SUBST(TEMP_STORE)
paulb0208cc2003-04-13 18:26:49 +0000338
drh71eb93e2001-09-28 01:34:43 +0000339###########
340# Lots of things are different if we are compiling for Windows using
341# the CYGWIN environment. So check for that special case and handle
342# things accordingly.
343#
344AC_MSG_CHECKING([if executables have the .exe suffix])
345if test "$config_BUILD_EXEEXT" = ".exe"; then
346 CYGWIN=yes
347 AC_MSG_RESULT(yes)
348else
349 AC_MSG_RESULT(unknown)
350fi
351if test "$CYGWIN" != "yes"; then
352 AC_CYGWIN
353fi
354if test "$CYGWIN" = "yes"; then
355 BUILD_EXEEXT=.exe
356else
dougcurrie6194a5f2003-12-19 20:09:51 +0000357 BUILD_EXEEXT=$EXEEXT
drh71eb93e2001-09-28 01:34:43 +0000358fi
359if test "$cross" = "0"; then
360 TARGET_EXEEXT=$BUILD_EXEEXT
361else
362 TARGET_EXEEXT=$config_TARGET_EXEEXT
363fi
364if test "$TARGET_EXEEXT" = ".exe"; then
365 OS_UNIX=0
366 OS_WIN=1
367 tclsubdir=win
dougcurrie0f290bf2004-06-21 18:57:29 +0000368 TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1"
drh71eb93e2001-09-28 01:34:43 +0000369else
370 OS_UNIX=1
371 OS_WIN=0
372 tclsubdir=unix
dougcurrie0f290bf2004-06-21 18:57:29 +0000373 TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1"
drh71eb93e2001-09-28 01:34:43 +0000374fi
drh71eb93e2001-09-28 01:34:43 +0000375
376AC_SUBST(BUILD_EXEEXT)
377AC_SUBST(OS_UNIX)
378AC_SUBST(OS_WIN)
379AC_SUBST(TARGET_EXEEXT)
380
381##########
382# Extract generic linker options from the environment.
383#
384if test "$config_TARGET_LIBS" != ""; then
385 TARGET_LIBS=$config_TARGET_LIBS
386else
387 TARGET_LIBS=""
388fi
389AC_SUBST(TARGET_LIBS)
390
391##########
drh7b5717e2004-11-25 13:50:01 +0000392# Figure out all the parameters needed to compile against Tcl.
drh71eb93e2001-09-28 01:34:43 +0000393#
drh7b5717e2004-11-25 13:50:01 +0000394# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
395# macros in the in the tcl.m4 file of the standard TCL distribution.
396# Those macros could not be used directly since we have to make some
397# minor changes to accomodate systems that do not have TCL installed.
drh71eb93e2001-09-28 01:34:43 +0000398#
drh7b5717e2004-11-25 13:50:01 +0000399AC_ARG_ENABLE(tcl, [ --disable-tcl do not build TCL extension],
400 [use_tcl=$enableval],[use_tcl=yes])
401if test "${use_tcl}" = "yes" ; then
drhb571b452004-12-10 02:20:27 +0000402 AC_ARG_WITH(tcl, [ --with-tcl=DIR directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval})
drh7b5717e2004-11-25 13:50:01 +0000403 AC_MSG_CHECKING([for Tcl configuration])
404 AC_CACHE_VAL(ac_cv_c_tclconfig,[
405 # First check to see if --with-tcl was specified.
406 if test x"${with_tclconfig}" != x ; then
407 if test -f "${with_tclconfig}/tclConfig.sh" ; then
408 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
409 else
410 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
411 fi
drh71eb93e2001-09-28 01:34:43 +0000412 fi
drh7b5717e2004-11-25 13:50:01 +0000413 # then check for a private Tcl installation
414 if test x"${ac_cv_c_tclconfig}" = x ; then
415 for i in \
416 ../tcl \
417 `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
418 `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
419 `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
420 ../../tcl \
421 `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
422 `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
423 `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
424 ../../../tcl \
425 `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
426 `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
427 `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null`
428 do
429 if test -f "$i/unix/tclConfig.sh" ; then
430 ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
431 break
432 fi
433 done
434 fi
435
436 # check in a few common install locations
437 if test x"${ac_cv_c_tclconfig}" = x ; then
438 for i in \
439 `ls -d ${libdir} 2>/dev/null` \
440 `ls -d /usr/local/lib 2>/dev/null` \
441 `ls -d /usr/contrib/lib 2>/dev/null` \
442 `ls -d /usr/lib 2>/dev/null`
443 do
444 if test -f "$i/tclConfig.sh" ; then
445 ac_cv_c_tclconfig=`(cd $i; pwd)`
446 break
447 fi
448 done
449 fi
450
451 # check in a few other private locations
452 if test x"${ac_cv_c_tclconfig}" = x ; then
453 for i in \
454 ${srcdir}/../tcl \
455 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
456 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
457 `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null`
458 do
459 if test -f "$i/unix/tclConfig.sh" ; then
460 ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
461 break
462 fi
463 done
464 fi
465 ])
466
467 if test x"${ac_cv_c_tclconfig}" = x ; then
468 use_tcl=no
469 AC_MSG_WARN(Can't find Tcl configuration definitions)
470 AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***)
471 AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***)
472 else
473 TCL_BIN_DIR=${ac_cv_c_tclconfig}
474 AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
475
476 AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
477 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
478 AC_MSG_RESULT([loading])
479 . $TCL_BIN_DIR/tclConfig.sh
480 else
481 AC_MSG_RESULT([file not found])
482 fi
483
484 #
485 # If the TCL_BIN_DIR is the build directory (not the install directory),
486 # then set the common variable name to the value of the build variables.
487 # For example, the variable TCL_LIB_SPEC will be set to the value
488 # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
489 # instead of TCL_BUILD_LIB_SPEC since it will work with both an
490 # installed and uninstalled version of Tcl.
491 #
492
493 if test -f $TCL_BIN_DIR/Makefile ; then
494 TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
495 TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
496 TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
497 fi
498
499 #
500 # eval is required to do the TCL_DBGX substitution
501 #
502
503 eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
504 eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
505 eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
506
507 eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
508 eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
509 eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
510
511 AC_SUBST(TCL_VERSION)
512 AC_SUBST(TCL_BIN_DIR)
513 AC_SUBST(TCL_SRC_DIR)
514 AC_SUBST(TCL_LIBS)
515 AC_SUBST(TCL_INCLUDE_SPEC)
516
517 AC_SUBST(TCL_LIB_FILE)
518 AC_SUBST(TCL_LIB_FLAG)
519 AC_SUBST(TCL_LIB_SPEC)
520
521 AC_SUBST(TCL_STUB_LIB_FILE)
522 AC_SUBST(TCL_STUB_LIB_FLAG)
523 AC_SUBST(TCL_STUB_LIB_SPEC)
524 fi
drh71eb93e2001-09-28 01:34:43 +0000525fi
drh7b5717e2004-11-25 13:50:01 +0000526if test "${use_tcl}" = "no" ; then
527 HAVE_TCL=""
528else
529 HAVE_TCL=1
drh71eb93e2001-09-28 01:34:43 +0000530fi
drh7b5717e2004-11-25 13:50:01 +0000531AC_SUBST(HAVE_TCL)
drh71eb93e2001-09-28 01:34:43 +0000532
533##########
534# Figure out what C libraries are required to compile programs
535# that use "readline()" library.
536#
537if test "$config_TARGET_READLINE_LIBS" != ""; then
538 TARGET_READLINE_LIBS="$config_TARGET_READLINE_LIBS"
539else
540 CC=$TARGET_CC
541 LIBS=""
paul38372372003-04-22 08:04:49 +0000542 AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap])
543 AC_CHECK_LIB([readline], [readline])
drh71eb93e2001-09-28 01:34:43 +0000544 TARGET_READLINE_LIBS="$LIBS"
545fi
546AC_SUBST(TARGET_READLINE_LIBS)
547
548##########
549# Figure out where to get the READLINE header files.
550#
551AC_MSG_CHECKING([readline header files])
552found=no
553if test "$config_TARGET_READLINE_INC" != ""; then
554 TARGET_READLINE_INC=$config_TARGET_READLINE_INC
555 found=yes
556fi
557if test "$found" = "yes"; then
558 AC_MSG_RESULT($TARGET_READLINE_INC)
559else
560 AC_MSG_RESULT(not specified: still searching...)
561 AC_CHECK_HEADER(readline.h, [found=yes])
562fi
563if test "$found" = "no"; then
dougcurrie6194a5f2003-12-19 20:09:51 +0000564 for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
drh71eb93e2001-09-28 01:34:43 +0000565 AC_CHECK_FILE($dir/include/readline.h, found=yes)
566 if test "$found" = "yes"; then
567 TARGET_READLINE_INC="-I$dir/include"
568 break
569 fi
570 AC_CHECK_FILE($dir/include/readline/readline.h, found=yes)
571 if test "$found" = "yes"; then
572 TARGET_READLINE_INC="-I$dir/include/readline"
573 break
574 fi
575 done
576fi
577if test "$found" = "yes"; then
578 if test "$TARGET_READLINE_LIBS" = ""; then
579 TARGET_HAVE_READLINE=0
580 else
581 TARGET_HAVE_READLINE=1
582 fi
583else
584 TARGET_HAVE_READLINE=0
585fi
586AC_SUBST(TARGET_READLINE_INC)
587AC_SUBST(TARGET_HAVE_READLINE)
588
589#########
590# Figure out whether or not we have a "usleep()" function.
591#
592AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])
593
594#########
595# Generate the output files.
596#
a.rottmannc7e93832003-03-24 09:39:32 +0000597AC_OUTPUT([
598Makefile
dougcurrie12b34442004-07-19 03:24:59 +0000599sqlite3.pc
a.rottmannc7e93832003-03-24 09:39:32 +0000600])