summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2011-09-08 05:00:10 +0000
committerPaul Joseph Davis <davisp@apache.org>2011-09-08 05:00:10 +0000
commit71081311b2b11ed923869ce5bd11ce7b0fd1da2c (patch)
tree85c5613959f8435e4b3de922765b01ecb945477d /configure.ac
parent61ca44e384ca10b0b7bf68123c79ed43715ea9c9 (diff)
Fix CouchJS compatibility with older SpiderMonkey.
This is a backport of the work to make CouchJS build against all of the major versions of SpiderMonkey. Thanks to Randall Leeds and Chris Coulson for the original patches. Backport based on r1137464 and r1164346 Fixes COUCHDB-1078 Fixes COUCHDB-1260 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1166525 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac41
1 files changed, 23 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 2bdf5aed..5cf37635 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,13 +108,15 @@ esac
AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
-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([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.
-Is the Mozilla SpiderMonkey library installed?])])])])])
+Is the Mozilla SpiderMonkey library installed?])])])])])])])
AC_SUBST(JS_LIB_BASE)
@@ -177,16 +179,19 @@ Are the Mozilla SpiderMonkey headers installed?])
AC_SUBST(JSLIB)
AC_LANG_PUSH(C)
-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_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.]))
+
AC_LANG_POP(C)
AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],
@@ -228,10 +233,10 @@ case "$(uname -s)" in
CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS"
;;
FreeBSD)
- LIBS="$LIBS -lcrypt"
+ LIBS="$LIBS -lm -lcrypt"
;;
OpenBSD)
- LIBS="$LIBS -lcrypto"
+ LIBS="$LIBS -lm -lcrypto"
;;
esac