Index: config.h.in ================================================================== --- config.h.in +++ config.h.in @@ -19,10 +19,13 @@ #undef GEOS_ONLY_REENTRANT /* Should be defined in order to enable GEOS_REENTRANT (fully thread-safe). */ #undef GEOS_REENTRANT +/* depending on SQLite library version. */ +#undef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H Index: configure ================================================================== --- configure +++ configure @@ -2117,10 +2117,56 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libspatialite $as_me 4.4.0-RC0, which was @@ -3128,10 +3174,11 @@ $as_echo "#define NDEBUG 1" >>confdefs.h # config depending options + @@ -18794,10 +18841,18 @@ ANDROID_TRUE= ANDROID_FALSE='#' else ANDROID_TRUE='#' ANDROID_FALSE= +fi + + +ac_fn_c_check_decl "$LINENO" "SQLITE_INDEX_CONSTRAINT_LIKE" "ac_cv_have_decl_SQLITE_INDEX_CONSTRAINT_LIKE" "#include +" +if test "x$ac_cv_have_decl_SQLITE_INDEX_CONSTRAINT_LIKE" = xyes; then : + $as_echo "#define HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE 1" >>confdefs.h + fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -59,10 +59,12 @@ [Should be defined when linking liblwgeom from PostGIS 2.1 (or later).]) AH_TEMPLATE([POSTGIS_2_2], [Should be defined when linking liblwgeom from PostGIS 2.2 (or later).]) AH_TEMPLATE([TARGET_CPU], [Should contain a text-string describing the intended target CPU]) +AH_TEMPLATE([HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE], + [depending on SQLite library version.]) # Checks for header files. AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])]) AC_CHECK_HEADERS(stdio.h,, [AC_MSG_ERROR([cannot find stdio.h, bailing out])]) AC_CHECK_HEADERS(string.h,, [AC_MSG_ERROR([cannot find string.h, bailing out])]) @@ -423,10 +425,13 @@ # Checking for Mac OsX AM_CONDITIONAL([MACOSX], [test "$target_alias" = "macosx"]) # Checking for Android AM_CONDITIONAL([ANDROID], [test "$target_alias" = "android"]) +AC_CHECK_DECL([SQLITE_INDEX_CONSTRAINT_LIKE], + [AC_DEFINE(HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE)],[],[[#include ]]) + AC_OUTPUT #----------------------------------------------------------------------- # printing an eventual message reporting about GPL escalation #----------------------------------------------------------------------- Index: src/spatialite/virtualXL.c ================================================================== --- src/spatialite/virtualXL.c +++ src/spatialite/virtualXL.c @@ -688,10 +688,16 @@ break; case SQLITE_INDEX_CONSTRAINT_GE: if (ret >= 0) ok = 1; break; +#ifdef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE +case SQLITE_INDEX_CONSTRAINT_LIKE: + if (ret >= 0) + ok = 1; + break; +#endif }; } done: if (!ok) return 0; Index: src/spatialite/virtualdbf.c ================================================================== --- src/spatialite/virtualdbf.c +++ src/spatialite/virtualdbf.c @@ -659,10 +659,16 @@ break; case SQLITE_INDEX_CONSTRAINT_GE: if (ret >= 0) ok = 1; break; +#ifdef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE + case SQLITE_INDEX_CONSTRAINT_LIKE: + if (ret >= 0) + ok = 1; + break; +#endif }; } break; }; } Index: src/spatialite/virtualshape.c ================================================================== --- src/spatialite/virtualshape.c +++ src/spatialite/virtualshape.c @@ -945,10 +945,16 @@ break; case SQLITE_INDEX_CONSTRAINT_GE: if (ret >= 0) ok = 1; break; +#ifdef HAVE_DECL_SQLITE_INDEX_CONSTRAINT_LIKE + case SQLITE_INDEX_CONSTRAINT_LIKE: + if (ret >= 0) + ok = 1; + break; +#endif }; } break; }; } Index: test/test-legacy-3.0.1.sqlite ================================================================== --- test/test-legacy-3.0.1.sqlite +++ test/test-legacy-3.0.1.sqlite cannot compute difference between binary files