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