You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2011/10/26 20:05:32 UTC

[7/50] git commit: Prevent linking against too new of a SpiderMonkey

Prevent linking against too new of a SpiderMonkey

Versions of SpiderMonkey newer than js185-1.0.0 have removed the
JSOPTION_ANONFUNFIX which basically invalidates all CouchDB JavaScript
functions ever written.

This configure patch prevents the accidental linking to a library that
has this new behavior while allowing people to forcefully override the
check.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9ffc1df0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9ffc1df0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9ffc1df0

Branch: refs/heads/1319-large-headers-are-corrupted
Commit: 9ffc1df0e849b0022fc554ef2d0bcea3af736033
Parents: 6167310
Author: Paul Joseph Davis <da...@apache.org>
Authored: Tue Oct 18 16:18:01 2011 -0500
Committer: Paul Joseph Davis <da...@apache.org>
Committed: Tue Oct 18 16:20:51 2011 -0500

----------------------------------------------------------------------
 configure.ac |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9ffc1df0/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 89d9b10..c7b9930 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,12 @@ AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=PATH],
     JS_LIBS="-L$withval"
 ], [])
 
+use_js_trunk=no
+AC_ARG_ENABLE([js-trunk], [AC_HELP_STRING([--enable-js-trunk],
+    [allow use of SpiderMonkey versions newer than js185-1.0.0])], [
+    use_js_trunk=$enableval
+], [])
+
 AC_ARG_VAR([ERLC_FLAGS], [general flags to prepend to ERLC_FLAGS])
 AC_ARG_VAR([FLAGS], [general flags to prepend to LDFLAGS and CPPFLAGS])
 AS_CASE([$(uname -s)],
@@ -271,6 +277,22 @@ AC_CHECK_HEADER([jsapi.h], [], [
 
 Are the Mozilla SpiderMonkey headers installed?])
         ])])
+
+# Prevent people from accidentally using SpiderMonkey's that are too new
+
+if test "$use_js_trunk" = "no"; then
+AC_CHECK_DECL([JSOPTION_ANONFUNFIX], [], [
+    AC_MSG_ERROR([Your SpiderMonkey library is too new.
+
+Versions of SpiderMonkey after the js185-1.0.0 release remove the optional
+enforcement of preventing anonymous functions in a statement context. This
+will most likely break your existing JavaScript code as well as render all
+example code invalid.
+
+If you wish to ignore this error pass --enable-js-trunk to ./configure.])],
+    [[#include <jsapi.h>]])
+fi
+
 CPPFLAGS="$OLD_CPPFLAGS"