OLD | NEW |
1 # | 1 # |
2 # The build process allows for using a cross-compiler. But the default | 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 | 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 | 4 # configure script needs to discover the following properties of the |
5 # build and target systems: | 5 # build and target systems: |
6 # | 6 # |
7 # srcdir | 7 # srcdir |
8 # | 8 # |
9 # The is the name of the directory that contains the | 9 # The is the name of the directory that contains the |
10 # "configure" shell script. All source files are | 10 # "configure" shell script. All source files are |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 # | 115 # |
116 AC_SYS_LARGEFILE | 116 AC_SYS_LARGEFILE |
117 | 117 |
118 ######### | 118 ######### |
119 # Check for needed/wanted data types | 119 # Check for needed/wanted data types |
120 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t, | 120 AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t, |
121 uint16_t, uint32_t, uint64_t, uintptr_t]) | 121 uint16_t, uint32_t, uint64_t, uintptr_t]) |
122 | 122 |
123 ######### | 123 ######### |
124 # Check for needed/wanted headers | 124 # Check for needed/wanted headers |
125 AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h]) | 125 AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h malloc.h]) |
126 | 126 |
127 ######### | 127 ######### |
128 # Figure out whether or not we have these functions | 128 # Figure out whether or not we have these functions |
129 # | 129 # |
130 AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s]) | 130 AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r localtime_s utime malloc_u
sable_size]) |
131 | 131 |
132 ######### | 132 ######### |
133 # By default, we use the amalgamation (this may be changed below...) | 133 # By default, we use the amalgamation (this may be changed below...) |
134 # | 134 # |
135 USE_AMALGAMATION=1 | 135 USE_AMALGAMATION=1 |
136 | 136 |
137 ######### | 137 ######### |
138 # See whether we can run specific tclsh versions known to work well; | 138 # See whether we can run specific tclsh versions known to work well; |
139 # if not, then we fall back to plain tclsh. | 139 # if not, then we fall back to plain tclsh. |
140 # TODO: try other versions before falling back? | 140 # TODO: try other versions before falling back? |
141 # | 141 # |
142 AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.5 tclsh], none) | 142 AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh8.5 tclsh], none) |
143 if test "$TCLSH_CMD" = "none"; then | 143 if test "$TCLSH_CMD" = "none"; then |
144 # If we can't find a local tclsh, then building the amalgamation will fail. | 144 # If we can't find a local tclsh, then building the amalgamation will fail. |
145 # We act as though --disable-amalgamation has been used. | 145 # We act as though --disable-amalgamation has been used. |
146 echo "Warning: can't find tclsh - defaulting to non-amalgamation build." | 146 echo "Warning: can't find tclsh - defaulting to non-amalgamation build." |
147 USE_AMALGAMATION=0 | 147 USE_AMALGAMATION=0 |
148 TCLSH_CMD="tclsh" | 148 TCLSH_CMD="tclsh" |
149 fi | 149 fi |
150 AC_SUBST(TCLSH_CMD) | 150 AC_SUBST(TCLSH_CMD) |
151 | 151 |
152 AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) | 152 AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 BUILD_EXEEXT=.exe | 333 BUILD_EXEEXT=.exe |
334 else | 334 else |
335 BUILD_EXEEXT=$EXEEXT | 335 BUILD_EXEEXT=$EXEEXT |
336 fi | 336 fi |
337 if test x"$cross_compiling" = xno; then | 337 if test x"$cross_compiling" = xno; then |
338 TARGET_EXEEXT=$BUILD_EXEEXT | 338 TARGET_EXEEXT=$BUILD_EXEEXT |
339 else | 339 else |
340 TARGET_EXEEXT=$config_TARGET_EXEEXT | 340 TARGET_EXEEXT=$config_TARGET_EXEEXT |
341 fi | 341 fi |
342 if test "$TARGET_EXEEXT" = ".exe"; then | 342 if test "$TARGET_EXEEXT" = ".exe"; then |
343 if test $OS2_SHELL ; then | 343 SQLITE_OS_UNIX=0 |
344 SQLITE_OS_UNIX=0 | 344 SQLITE_OS_WIN=1 |
345 SQLITE_OS_WIN=0 | 345 CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" |
346 SQLITE_OS_OS2=1 | |
347 CFLAGS="$CFLAGS -DSQLITE_OS_OS2=1" | |
348 else | |
349 SQLITE_OS_UNIX=0 | |
350 SQLITE_OS_WIN=1 | |
351 SQLITE_OS_OS2=0 | |
352 CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" | |
353 fi | |
354 else | 346 else |
355 SQLITE_OS_UNIX=1 | 347 SQLITE_OS_UNIX=1 |
356 SQLITE_OS_WIN=0 | 348 SQLITE_OS_WIN=0 |
357 SQLITE_OS_OS2=0 | |
358 CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" | 349 CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" |
359 fi | 350 fi |
360 | 351 |
361 AC_SUBST(BUILD_EXEEXT) | 352 AC_SUBST(BUILD_EXEEXT) |
362 AC_SUBST(SQLITE_OS_UNIX) | 353 AC_SUBST(SQLITE_OS_UNIX) |
363 AC_SUBST(SQLITE_OS_WIN) | 354 AC_SUBST(SQLITE_OS_WIN) |
364 AC_SUBST(SQLITE_OS_OS2) | |
365 AC_SUBST(TARGET_EXEEXT) | 355 AC_SUBST(TARGET_EXEEXT) |
366 | 356 |
367 ########## | 357 ########## |
368 # Figure out all the parameters needed to compile against Tcl. | 358 # Figure out all the parameters needed to compile against Tcl. |
369 # | 359 # |
370 # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG | 360 # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG |
371 # macros in the in the tcl.m4 file of the standard TCL distribution. | 361 # macros in the in the tcl.m4 file of the standard TCL distribution. |
372 # Those macros could not be used directly since we have to make some | 362 # Those macros could not be used directly since we have to make some |
373 # minor changes to accomodate systems that do not have TCL installed. | 363 # minor changes to accomodate systems that do not have TCL installed. |
374 # | 364 # |
375 AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]), | 365 AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]), |
376 [use_tcl=$enableval],[use_tcl=yes]) | 366 [use_tcl=$enableval],[use_tcl=yes]) |
377 if test "${use_tcl}" = "yes" ; then | 367 if test "${use_tcl}" = "yes" ; then |
378 AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl con
figuration (tclConfig.sh)]), with_tclconfig=${withval}) | 368 AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl con
figuration (tclConfig.sh)]), with_tclconfig=${withval}) |
379 AC_MSG_CHECKING([for Tcl configuration]) | 369 AC_MSG_CHECKING([for Tcl configuration]) |
380 AC_CACHE_VAL(ac_cv_c_tclconfig,[ | 370 AC_CACHE_VAL(ac_cv_c_tclconfig,[ |
381 # First check to see if --with-tcl was specified. | 371 # First check to see if --with-tcl was specified. |
382 if test x"${with_tclconfig}" != x ; then | 372 if test x"${with_tclconfig}" != x ; then |
383 if test -f "${with_tclconfig}/tclConfig.sh" ; then | 373 if test -f "${with_tclconfig}/tclConfig.sh" ; then |
384 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` | 374 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` |
385 else | 375 else |
386 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) | 376 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) |
387 fi | 377 fi |
388 fi | 378 fi |
389 | 379 |
390 # Start autosearch by asking tclsh | 380 # Start autosearch by asking tclsh |
391 if test x"$cross_compiling" = xno; then | 381 if test x"${ac_cv_c_tclconfig}" = x ; then |
392 for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` | 382 if test x"$cross_compiling" = xno; then |
393 do | 383 for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` |
394 if test -f "$i/tclConfig.sh" ; then | 384 do |
395 ac_cv_c_tclconfig="$i" | 385 if test -f "$i/tclConfig.sh" ; then |
396 break | 386 ac_cv_c_tclconfig="$i" |
397 fi | 387 break |
398 done | 388 fi |
| 389 done |
| 390 fi |
399 fi | 391 fi |
400 | 392 |
401 # then check for a private Tcl installation | 393 # then check for a private Tcl installation |
402 if test x"${ac_cv_c_tclconfig}" = x ; then | 394 if test x"${ac_cv_c_tclconfig}" = x ; then |
403 for i in \ | 395 for i in \ |
404 ../tcl \ | 396 ../tcl \ |
405 `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ | 397 `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ |
406 `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ | 398 `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ |
407 `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ | 399 `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ |
408 ../../tcl \ | 400 ../../tcl \ |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" | 484 eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" |
493 eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" | 485 eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" |
494 | 486 |
495 eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" | 487 eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" |
496 eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" | 488 eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" |
497 eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" | 489 eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" |
498 | 490 |
499 AC_SUBST(TCL_VERSION) | 491 AC_SUBST(TCL_VERSION) |
500 AC_SUBST(TCL_BIN_DIR) | 492 AC_SUBST(TCL_BIN_DIR) |
501 AC_SUBST(TCL_SRC_DIR) | 493 AC_SUBST(TCL_SRC_DIR) |
502 AC_SUBST(TCL_LIBS) | |
503 AC_SUBST(TCL_INCLUDE_SPEC) | 494 AC_SUBST(TCL_INCLUDE_SPEC) |
504 | 495 |
505 AC_SUBST(TCL_LIB_FILE) | 496 AC_SUBST(TCL_LIB_FILE) |
506 AC_SUBST(TCL_LIB_FLAG) | 497 AC_SUBST(TCL_LIB_FLAG) |
507 AC_SUBST(TCL_LIB_SPEC) | 498 AC_SUBST(TCL_LIB_SPEC) |
508 | 499 |
509 AC_SUBST(TCL_STUB_LIB_FILE) | 500 AC_SUBST(TCL_STUB_LIB_FILE) |
510 AC_SUBST(TCL_STUB_LIB_FLAG) | 501 AC_SUBST(TCL_STUB_LIB_FLAG) |
511 AC_SUBST(TCL_STUB_LIB_SPEC) | 502 AC_SUBST(TCL_STUB_LIB_SPEC) |
512 fi | 503 fi |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 fi | 603 fi |
613 AC_SUBST(USE_AMALGAMATION) | 604 AC_SUBST(USE_AMALGAMATION) |
614 | 605 |
615 ######### | 606 ######### |
616 # See whether we should allow loadable extensions | 607 # See whether we should allow loadable extensions |
617 AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--enable-load-extension], | 608 AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--enable-load-extension], |
618 [Enable loading of external extensions]), | 609 [Enable loading of external extensions]), |
619 [use_loadextension=$enableval],[use_loadextension=no]) | 610 [use_loadextension=$enableval],[use_loadextension=no]) |
620 if test "${use_loadextension}" = "yes" ; then | 611 if test "${use_loadextension}" = "yes" ; then |
621 OPT_FEATURE_FLAGS="" | 612 OPT_FEATURE_FLAGS="" |
| 613 AC_SEARCH_LIBS(dlopen, dl) |
622 else | 614 else |
623 OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" | 615 OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" |
624 fi | 616 fi |
625 | 617 |
626 ######### | 618 ######### |
627 # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) param
eter | 619 # attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) param
eter |
628 for option in $CFLAGS $CPPFLAGS | 620 for option in $CFLAGS $CPPFLAGS |
629 do | 621 do |
630 case $option in | 622 case $option in |
631 -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; | 623 -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 AC_CONFIG_HEADERS(config.h) | 684 AC_CONFIG_HEADERS(config.h) |
693 | 685 |
694 ######### | 686 ######### |
695 # Generate the output files. | 687 # Generate the output files. |
696 # | 688 # |
697 AC_SUBST(BUILD_CFLAGS) | 689 AC_SUBST(BUILD_CFLAGS) |
698 AC_OUTPUT([ | 690 AC_OUTPUT([ |
699 Makefile | 691 Makefile |
700 sqlite3.pc | 692 sqlite3.pc |
701 ]) | 693 ]) |
OLD | NEW |