subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1566960 - /subversion/trunk/build/ac-macros/sqlite.m4
Date Tue, 11 Feb 2014 02:15:57 GMT
Author: breser
Date: Tue Feb 11 02:15:57 2014
New Revision: 1566960

URL: http://svn.apache.org/r1566960
Log:
Add tests for the broken SQLite STAT3 and STAT4 options and disallow their
use with SQLite 3.8.1 through 3.8.3 (inclusive).

* build/ac-macros/sqlite.m4
  (SVN_SQLITE_BROKEN_OPTIONS): New macro.
  (SVN_LIB_SQLITE): Use our new macro.

Modified:
    subversion/trunk/build/ac-macros/sqlite.m4

Modified: subversion/trunk/build/ac-macros/sqlite.m4
URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/sqlite.m4?rev=1566960&r1=1566959&r2=1566960&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/sqlite.m4 (original)
+++ subversion/trunk/build/ac-macros/sqlite.m4 Tue Feb 11 02:15:57 2014
@@ -96,6 +96,8 @@ AC_DEFUN(SVN_LIB_SQLITE,
     fi
   ])
 
+  SVN_SQLITE_BROKEN_OPTIONS
+
   AC_SUBST(SVN_SQLITE_INCLUDES)
   AC_SUBST(SVN_SQLITE_LIBS)
 ])
@@ -304,3 +306,56 @@ AC_DEFUN(_SVN_SQLITE_DSO_LIBS,
     AC_MSG_RESULT(none)
   fi
 ])
+
+dnl SQLIte 3.8.1 - 3.8.3 have a buggy SQLITE_ENABLE_STAT3 and
+dnl SQLITE_ENABLE_STAT4 options.  Discourage users from using
+dnl these versions.  See this SQLite bug:
+dnl https://www.sqlite.org/src/info/4c86b126f2
+AC_DEFUN(SVN_SQLITE_BROKEN_OPTIONS,
+[
+  AC_MSG_CHECKING([for broken sqlite options])
+
+  SVN_SQLITE_VERNUM_PARSE([3.8.1], [sqlite_min_buggy_stat])
+  SVN_SQLITE_VERNUM_PARSE([3.8.3], [sqlite_max_buggy_stat])
+
+  save_CPPFLAGS="$CPPFLAGS"
+  save_LDFLAGS="$LDFLAGS"
+
+  CPPFLAGS="$CPPFLAGS $SVN_SQLITE_INCLUDES"
+  LDFLAGS="$LDFLAGS $SVN_SQLITE_LIBS"
+
+  if test -z "$sqlite_amalg"; then
+
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdlib.h>
+#include <sqlite3.h>
+
+int main() {
+#if SQLITE_VERSION_NUMBER < $sqlite_min_buggy_stat || SQLITE_VERSION_NUMBER > $sqlite_max_buggy_stat
+  exit(0);
+#else
+  exit(sqlite3_compileoption_used("ENABLE_STAT3") | sqlite3_compileoption_used("ENABLE_STAT4"));
+#endif
+}
+    ]])],
+    [AC_MSG_RESULT([okay])],
+    [AC_MSG_ERROR([SQLITE_ENABLE_STAT3 or SQLITE_ENABLE_STAT4 defined with buggy SQLite version])],
+    [AC_MSG_RESULT([skipped])])
+
+  else
+
+    AC_TRY_CPP([
+#include "$sqlite_amalg"
+#if SQLITE_VERSION_NUMBER >= $sqlite_min_buggy_stat && \
+    SQLITE_VERSION_NUMBER <= $sqlite_max_buggy_stat && \
+    (defined(SQLITE_ENABLE_STAT3) || defined(SQLITE_ENABLE_STAT4))
+#error "SQLITE_ENABLE_STAT3 or SQLITE_ENABLE_STAT4 found"
+#endif],
+      [AC_MSG_RESULT([okay])],
+      [AC_MSG_ERROR([SQLITE_ENABLE_STAT3 or SQLITE_ENABLE_STAT4 defined with buggy SQLite
version])
+    ])
+  fi
+
+  CPPFLAGS="$save_CPPFLAGS"
+  LDFLAGS="$save_LDFLAGS"
+])



Mime
View raw message