You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ra...@apache.org on 2011/12/29 06:32:11 UTC
[2/3] git commit: Minor doc and configure fixes for old JS engines
Minor doc and configure fixes for old JS engines
Old, 1.7 series, versions of SpiderMonkey don't have the symbol
JSOPTION_ANONFUNFIX so don't perform the check for it unless building
with a newer version (1.8.5+).
And as long as 1.7 is still supported, don't say that 1.8 is required
in the INSTALL docs.
Fixes COUCHDB-1371
Backported from master (55cd0ed).
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/b148b5be
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/b148b5be
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/b148b5be
Branch: refs/heads/1.2.x
Commit: b148b5be982a959fde8f0925a268d1ba62224bb4
Parents: 7aa74fc
Author: Randall Leeds <ra...@apache.org>
Authored: Fri Dec 23 01:17:28 2011 -0800
Committer: Randall Leeds <ra...@apache.org>
Committed: Thu Dec 29 00:07:26 2011 -0500
----------------------------------------------------------------------
INSTALL.Unix | 2 +-
INSTALL.Windows | 2 +-
configure.ac | 36 +++++++++++++++++-------------------
3 files changed, 19 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/b148b5be/INSTALL.Unix
----------------------------------------------------------------------
diff --git a/INSTALL.Unix b/INSTALL.Unix
index 9b0a59c..becbf06 100644
--- a/INSTALL.Unix
+++ b/INSTALL.Unix
@@ -11,7 +11,7 @@ You will need the following installed:
* Erlang OTP (>=R12B5) (http://erlang.org/)
* ICU (http://icu.sourceforge.net/)
* OpenSSL (http://www.openssl.org/)
- * Mozilla SpiderMonkey (1.8) (http://www.mozilla.org/js/spidermonkey/)
+ * Mozilla SpiderMonkey (1.7) (http://www.mozilla.org/js/spidermonkey/)
* GNU Make (http://www.gnu.org/software/make/)
* GNU Compiler Collection (http://gcc.gnu.org/)
http://git-wip-us.apache.org/repos/asf/couchdb/blob/b148b5be/INSTALL.Windows
----------------------------------------------------------------------
diff --git a/INSTALL.Windows b/INSTALL.Windows
index c3f8c0b..b027b52 100644
--- a/INSTALL.Windows
+++ b/INSTALL.Windows
@@ -11,7 +11,7 @@ You will need the following installed:
* Erlang OTP (=14B01) (http://erlang.org/)
* ICU (=4.4.*) (http://icu.sourceforge.net/)
* OpenSSL (http://www.openssl.org/)
- * Mozilla SpiderMonkey (1.8) (http://www.mozilla.org/js/spidermonkey/)
+ * Mozilla SpiderMonkey (1.7) (http://www.mozilla.org/js/spidermonkey/)
* libcurl (http://curl.haxx.se/libcurl/)
* Cygwin (http://www.cygwin.com/)
* Visual Studio 2008 (http://msdn.microsoft.com/en-gb/vstudio/default.aspx)
http://git-wip-us.apache.org/repos/asf/couchdb/blob/b148b5be/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 697a37f..eb763c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -205,6 +205,8 @@ AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
OLD_LIBS="$LIBS"
LIBS="$JS_LIBS $LIBS"
+OLD_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$JS_CFLAGS $CPPFLAGS"
AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=mozjs185], [
AC_CHECK_LIB([mozjs185-1.0], [JS_NewContext], [JS_LIB_BASE=mozjs185-1.0], [
AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_BASE=mozjs], [
@@ -218,6 +220,20 @@ Is the Mozilla SpiderMonkey library installed?])])])])])])])
# Figure out what version of SpiderMonkey to use
AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject],
+ # 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
AC_DEFINE([SM185], [1],
[Use SpiderMonkey 1.8.5]))
@@ -229,9 +245,7 @@ AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength],
AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1],
[Use newer JS_GetCharsAndLength function.]))
-
# Else, hope that 1.7.0 works
-LIBS="$OLD_LIBS"
AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."])
@@ -284,8 +298,6 @@ fi
JS_LIBS="-l$JS_LIB_BASE -lm $JS_LIBS"
AC_SUBST(JS_LIBS)
-OLD_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$JS_CFLAGS $CPPFLAGS"
AC_CHECK_HEADER([jsapi.h], [], [
AC_CHECK_HEADER([js/jsapi.h],
[
@@ -297,21 +309,6 @@ 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
-
# Deal with JSScript -> JSObject -> JSScript switcheroo
AC_CHECK_TYPE([JSScript*],
@@ -320,6 +317,7 @@ AC_CHECK_TYPE([JSScript*],
[[#include <jsapi.h>]]
)
+LIBS="$OLD_LIBS"
CPPFLAGS="$OLD_CPPFLAGS"