couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject [1/3] git commit: Minor doc and configure fixes for old JS engines
Date Thu, 29 Dec 2011 05:32:11 GMT
Updated Branches:
  refs/heads/1.1.x 65c39616f -> 381610822
  refs/heads/1.2.x 7aa74fc3a -> b148b5be9
  refs/heads/master f599ba724 -> ee00d8183


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).

Conflicts:

	INSTALL.Unix
	configure.ac


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

Branch: refs/heads/1.1.x
Commit: 381610822b0b235f458f8f2c5e8e81af16486b16
Parents: 65c3961
Author: Randall Leeds <randall@apache.org>
Authored: Fri Dec 23 01:17:28 2011 -0800
Committer: Randall Leeds <randall@apache.org>
Committed: Thu Dec 29 00:10:11 2011 -0500

----------------------------------------------------------------------
 INSTALL.Unix    |    2 +-
 INSTALL.Windows |    2 +-
 configure.ac    |   70 ++++++++++++++++++++++++++-----------------------
 3 files changed, 39 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/38161082/INSTALL.Unix
----------------------------------------------------------------------
diff --git a/INSTALL.Unix b/INSTALL.Unix
index 720134d..b022baf 100644
--- a/INSTALL.Unix
+++ b/INSTALL.Unix
@@ -11,7 +11,7 @@ You will need the following installed:
  * Erlang OTP (>=R13B2)       (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/)
  * libcurl                    (http://curl.haxx.se/libcurl/)
  * 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/38161082/INSTALL.Windows
----------------------------------------------------------------------
diff --git a/INSTALL.Windows b/INSTALL.Windows
index d661f1d..0794a2c 100644
--- a/INSTALL.Windows
+++ b/INSTALL.Windows
@@ -11,7 +11,7 @@ You will need the following installed:
  * Erlang OTP (>=14B03)       (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/38161082/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 6a5d865..ca51f93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,10 @@ esac
 
 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], [
@@ -125,7 +129,35 @@ AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=mozjs185], [
 
 Is the Mozilla SpiderMonkey library installed?])])])])])])])
 
-AC_SUBST(JS_LIB_BASE)
+# 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]))
+
+AC_CHECK_LIB([$JS_LIB_BASE], [JS_ThrowStopIteration],
+    AC_DEFINE([SM180], [1],
+        [Use SpiderMonkey 1.8.0]))
+
+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
 
 AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."])
 
@@ -176,6 +208,7 @@ if test x${IS_WINDOWS} = xTRUE; then
 fi
 
 JSLIB=-l$JS_LIB_BASE
+AC_SUBST(JSLIB)
 
 AC_CHECK_HEADER([jsapi.h], [], [
     AC_CHECK_HEADER([js/jsapi.h],
@@ -188,37 +221,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
-
-AC_SUBST(JSLIB)
-
-AC_LANG_PUSH(C)
-
-AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject],
-    AC_DEFINE([SM185], [1],
-        [Use SpiderMonkey 1.8.5]))
-
-AC_CHECK_LIB([$JS_LIB_BASE], [JS_ThrowStopIteration],
-    AC_DEFINE([SM180], [1],
-        [Use SpiderMonkey 1.8.0]))
-
-AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength],
-    AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1],
-        [Use newer JS_GetCharsAndLength function.]))
-
 # Deal with JSScript -> JSObject -> JSScript switcheroo
 
 AC_CHECK_TYPE([JSScript*],
@@ -227,7 +229,9 @@ AC_CHECK_TYPE([JSScript*],
     [[#include <jsapi.h>]]
 )
 
-AC_LANG_POP(C)
+LIBS="$OLD_LIBS"
+CPPFLAGS="$OLD_CPPFLAGS"
+
 
 AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],
     [set PATH to the Win32 native ICU binaries directory])], [


Mime
View raw message