Permalink
Browse files

Remove SpiderMonkey 1.8.5 compatibility

This commit reverts 1.8.5 compatibility including the corresponding couchjs
paren hack as this leads to significant breakage in existing functions.
  • Loading branch information...
1 parent e6c0fc9 commit 5b558c81ed9709fb286a6821e9ae6d6478012c2c @rnewson rnewson committed Oct 6, 2011
View
@@ -109,15 +109,13 @@ esac
AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
-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], [
- AC_CHECK_LIB([js], [JS_NewContext], [JS_LIB_BASE=js], [
- AC_CHECK_LIB([js3250], [JS_NewContext], [JS_LIB_BASE=js3250], [
- AC_CHECK_LIB([js32], [JS_NewContext], [JS_LIB_BASE=js32], [
- AC_MSG_ERROR([Could not find the js library.
+AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_BASE=mozjs], [
+ AC_CHECK_LIB([js], [JS_NewContext], [JS_LIB_BASE=js], [
+ AC_CHECK_LIB([js3250], [JS_NewContext], [JS_LIB_BASE=js3250], [
+ AC_CHECK_LIB([js32], [JS_NewContext], [JS_LIB_BASE=js32], [
+ AC_MSG_ERROR([Could not find the js library.
-Is the Mozilla SpiderMonkey library installed?])])])])])])])
+Is the Mozilla SpiderMonkey library installed?])])])])])
AC_SUBST(JS_LIB_BASE)
@@ -180,19 +178,16 @@ Are the Mozilla SpiderMonkey headers installed?])
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.]))
-
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="-Werror-implicit-function-declaration"
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <jsapi.h>]],
+ [[JS_SetOperationCallback(0, 0);]]
+ )],
+ AC_DEFINE([USE_JS_SETOPCB], [], [Use new JS_SetOperationCallback])
+)
+CFLAGS="$OLD_CFLAGS"
AC_LANG_POP(C)
AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],
@@ -234,10 +229,10 @@ case "$(uname -s)" in
CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS"
;;
FreeBSD)
- LIBS="$LIBS -lm -lcrypt"
+ LIBS="$LIBS -lcrypt"
;;
OpenBSD)
- LIBS="$LIBS -lm -lcrypto"
+ LIBS="$LIBS -lcrypto"
;;
esac
@@ -97,7 +97,7 @@ var Mimeparse = (function() {
if ((type == targetType || type == "*" || targetType == "*") &&
(subtype == targetSubtype || subtype == "*" || targetSubtype == "*")) {
var matchCount = 0;
- for (var param in targetParams) {
+ for (param in targetParams) {
if (param != 'q' && params[param] && params[param] == targetParams[param]) {
matchCount += 1;
}
View
@@ -63,11 +63,6 @@ var Couch = {
},
compileFunction : function(source, ddoc) {
if (!source) throw(["error","not_found","missing function"]);
- // Some newer SpiderMonkey's appear to not like evaluating
- // an anonymous function at global scope. Simple fix just
- // wraps the source with parens so the function object is
- // returned correctly.
- source = "(" + source + ")";
try {
if (sandbox) {
if (ddoc) {
@@ -414,23 +414,10 @@ function waitForSuccess(fun, tag) {
function waitForRestart() {
var waiting = true;
- // Wait for the server to go down but don't
- // wait too long because we might miss the
- // unavailable period.
- var count = 25;
- while (waiting && count > 0) {
- count--;
- try {
- CouchDB.request("GET", "/");
- } catch(e) {
- waiting = false;
- }
- }
- // Wait for it to come back up
- waiting = true;
while (waiting) {
try {
CouchDB.request("GET", "/");
+ CouchDB.request("GET", "/");
waiting = false;
} catch(e) {
// the request will fail until restart completes
@@ -20,10 +20,7 @@ endif
EXTRA_DIST = \
spawnkillable/couchspawnkillable.sh \
- stat_descriptions.cfg.in \
- couch_js/sm170.c \
- couch_js/sm180.c \
- couch_js/sm185.c
+ stat_descriptions.cfg.in
CLEANFILES = $(dist_man1_MANS) stat_descriptions.cfg
@@ -50,14 +47,12 @@ COUCHJS_SRCS = \
couch_js/http.h \
couch_js/main.c \
couch_js/utf8.c \
- couch_js/utf8.h \
- couch_js/util.h \
- couch_js/util.c
+ couch_js/utf8.h
locallibbin_PROGRAMS = couchjs
couchjs_SOURCES = $(COUCHJS_SRCS)
couchjs_LDFLAGS = $(CURL_LDFLAGS)
-couchjs_CFLAGS = -g -Wall -Werror -D_BSD_SOURCE $(CURL_CFLAGS)
+couchjs_CFLAGS = -D_BSD_SOURCE $(CURL_CFLAGS)
couchjs_LDADD = $(CURL_LDFLAGS) @JSLIB@
couchpriv_DATA = stat_descriptions.cfg
Oops, something went wrong.

0 comments on commit 5b558c8

Please sign in to comment.