Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E50DBB255 for ; Sun, 22 Jan 2012 23:43:55 +0000 (UTC) Received: (qmail 19528 invoked by uid 500); 22 Jan 2012 23:43:55 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 19399 invoked by uid 500); 22 Jan 2012 23:43:55 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 19263 invoked by uid 99); 22 Jan 2012 23:43:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2012 23:43:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2012 23:43:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 35BF93190BB; Sun, 22 Jan 2012 23:43:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: fdmanana@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [9/50] git commit: Fix SpiderMonkey version detection Message-Id: <20120122234313.35BF93190BB@tyr.zones.apache.org> Date: Sun, 22 Jan 2012 23:43:13 +0000 (UTC) Fix SpiderMonkey version detection Randall's last patch to only test for JSOPTION_ANONFUNFIX ended up reordering the test before the headers were located. This ran into errors in version detection. This patch reorders the header location as well as adds a few more default search paths when no --with-js-include option is specified to account for newer SpiderMonkeys that puth their headers into $PREFIX/include/js. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/10047e75 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/10047e75 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/10047e75 Branch: refs/heads/COUCHDB-1342 Commit: 10047e75935818e0421bdd9ac96dc21334f90e95 Parents: da33e34 Author: Paul Joseph Davis Authored: Sat Jan 21 16:08:58 2012 -0600 Committer: Paul Joseph Davis Committed: Sat Jan 21 16:08:58 2012 -0600 ---------------------------------------------------------------------- configure.ac | 41 ++++++++++++++++++++++------------------- 1 files changed, 22 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/10047e75/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index c6d564a..adfd740 100644 --- a/configure.ac +++ b/configure.ac @@ -177,8 +177,11 @@ AS_CASE([$(uname -s)], [CYGWIN*], [] , [*], [ CPPFLAGS="$CPPFLAGS -I/opt/local/include" + CPPFLAGS="$CPPFLAGS -I/opt/local/include/js" CPPFLAGS="$CPPFLAGS -I/usr/local/include" + CPPFLAGS="$CPPFLAGS -I/usr/local/include/js" CPPFLAGS="$CPPFLAGS -I/usr/include" + CPPFLAGS="$CPPFLAGS -I/usr/include/js" LDFLAGS="$LDFLAGS -L/opt/local/lib" LDFLAGS="$LDFLAGS -L/usr/local/lib" ]) @@ -203,6 +206,17 @@ AS_CASE([$(uname -s)], AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE]) +AC_CHECK_HEADER([jsapi.h], [], [ + AC_CHECK_HEADER([js/jsapi.h], + [ + CPPFLAGS="$CPPFLAGS -I$JS_INCLUDE/js" + ], + [ + AC_MSG_ERROR([Could not find the jsapi header. + +Are the Mozilla SpiderMonkey headers installed?]) + ])]) + OLD_LIBS="$LIBS" LIBS="$JS_LIBS $LIBS" OLD_CPPFLAGS="$CPPFLAGS" @@ -247,6 +261,14 @@ AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength], # Else, hope that 1.7.0 works +# Deal with JSScript -> JSObject -> JSScript switcheroo + +AC_CHECK_TYPE([JSScript*], + [AC_DEFINE([JSSCRIPT_TYPE], [JSScript*], [Use JSObject* for scripts])], + [AC_DEFINE([JSSCRIPT_TYPE], [JSObject*], [Use JSScript* for scripts])], + [[#include ]] +) + AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."]) if test x${IS_WINDOWS} = xTRUE; then @@ -298,25 +320,6 @@ fi JS_LIBS="-l$JS_LIB_BASE -lm $JS_LIBS" AC_SUBST(JS_LIBS) -AC_CHECK_HEADER([jsapi.h], [], [ - AC_CHECK_HEADER([js/jsapi.h], - [ - CPPFLAGS="$CPPFLAGS -I$JS_INCLUDE/js" - ], - [ - AC_MSG_ERROR([Could not find the jsapi header. - -Are the Mozilla SpiderMonkey headers installed?]) - ])]) - -# Deal with JSScript -> JSObject -> JSScript switcheroo - -AC_CHECK_TYPE([JSScript*], - [AC_DEFINE([JSSCRIPT_TYPE], [JSScript*], [Use JSObject* for scripts])], - [AC_DEFINE([JSSCRIPT_TYPE], [JSObject*], [Use JSScript* for scripts])], - [[#include ]] -) - LIBS="$OLD_LIBS" CPPFLAGS="$OLD_CPPFLAGS"