Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C23BE9B53 for ; Thu, 1 Mar 2012 18:15:27 +0000 (UTC) Received: (qmail 87155 invoked by uid 500); 1 Mar 2012 18:15:27 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 87119 invoked by uid 500); 1 Mar 2012 18:15:27 -0000 Mailing-List: contact dev-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 dev@couchdb.apache.org Received: (qmail 87111 invoked by uid 99); 1 Mar 2012 18:15:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2012 18:15:27 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_BLACK X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2012 18:15:20 +0000 Received: by iage36 with SMTP id e36so1485455iag.11 for ; Thu, 01 Mar 2012 10:14:59 -0800 (PST) Received-SPF: pass (google.com: domain of paul.joseph.davis@gmail.com designates 10.42.156.7 as permitted sender) client-ip=10.42.156.7; Authentication-Results: mr.google.com; spf=pass (google.com: domain of paul.joseph.davis@gmail.com designates 10.42.156.7 as permitted sender) smtp.mail=paul.joseph.davis@gmail.com; dkim=pass header.i=paul.joseph.davis@gmail.com Received: from mr.google.com ([10.42.156.7]) by 10.42.156.7 with SMTP id x7mr4581198icw.56.1330625699288 (num_hops = 1); Thu, 01 Mar 2012 10:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=yO6ihZ0EcHKSPuDFQSytACfLoGS9oJTDvggWWHRZ5NE=; b=PPLvNbmECF0+7wRpDD2pis3XrTcDtbigL5ttii6rJyJetDHJJBflaW9iw/8c/hhXMK 1lcVly1CY6FfZI1bPKaTtqZpNVAXWgKNYvMAKgvL6aVrz+vJ6qvmcnWJd4BgW2FPteZy Fkzl8lJelwMQ0Qpo3SpQ73jQWpmz2GD8qsjJI= Received: by 10.42.156.7 with SMTP id x7mr3747320icw.56.1330625699201; Thu, 01 Mar 2012 10:14:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.55.195 with HTTP; Thu, 1 Mar 2012 10:14:19 -0800 (PST) In-Reply-To: <20120301000121.473434D220@tyr.zones.apache.org> References: <20120301000121.473434D220@tyr.zones.apache.org> From: Paul Davis Date: Thu, 1 Mar 2012 12:14:19 -0600 Message-ID: Subject: Re: git commit: fix build with custom path - close #COUCHDB-1426 To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org A few hunks in here concern me: - CPPFLAGS=3D"$CPPFLAGS -I/opt/local/include/js" CPPFLAGS=3D"$CPPFLAGS -I/usr/local/include" - CPPFLAGS=3D"$CPPFLAGS -I/usr/local/include/js" CPPFLAGS=3D"$CPPFLAGS -I/usr/include" - CPPFLAGS=3D"$CPPFLAGS -I/usr/include/js" I remember having to add some of these for extremely specific scenarios. Are we absolutely sure this isn't going to lead to a regression for some people? +AC_MSG_RESULT(js flags $CPPFLAGS) + This syntax looks weird to me. Its probably right but does anyone know the rules on when strings need square brackets? +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], + [[ + #if JS_VERSION =3D=3D 170 + // Use spidermonkey 1.7.0 + #else + # Not Spidermonkey 1.7.0 + #endif + ]])], + [use_js170=3Dyes], + []) Please don't invent a new indentation scheme for random hunks in a patch. Also, what's actually being tested here? I'm not seeing how this would fail unless we're depending on jsconfig.h only existing in 1.7.0 builds, in which case a test compile is not the way to run this check. Everything after that hunk looks quite weird to me. I'm fairly certain we just had a commit that fixes this issue. I don't remember the details off the top of my head but this is getting into the land of silly walks with all the bending over backwards to find SpiderMonkey. At a certain point we might want to just ixnay a lot of this and just guess at the most common cases and if we can't find a version then we should just add a configure option. On Wed, Feb 29, 2012 at 6:01 PM, wrote: > Updated Branches: > =A0refs/heads/COUCHDB-1426 [created] 56a00ede8 > > > fix build with custom path - close #COUCHDB-1426 > > This patch make sure that js libs and include given using the options > --with-js-lib and --with-js-include are used in priority, ie before the > detection of the version. Also if spidermonkey 1.7.0 is detected it > removes useless tests. > > > Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo > Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/56a00ede > Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/56a00ede > Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/56a00ede > > Branch: refs/heads/COUCHDB-1426 > Commit: 56a00ede8ab237fc3b2c1a3ea23a688e5aa997c0 > Parents: 766d461 > Author: benoitc > Authored: Thu Mar 1 00:16:14 2012 +0100 > Committer: Jason Smith (air) > Committed: Wed Feb 29 23:59:55 2012 +0000 > > ---------------------------------------------------------------------- > =A0configure.ac | =A0128 +++++++++++++++++++++++++++++++++---------------= ----- > =A01 files changed, 80 insertions(+), 48 deletions(-) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/couchdb/blob/56a00ede/configure.ac > ---------------------------------------------------------------------- > diff --git a/configure.ac b/configure.ac > index 7ce4842..e526a18 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -137,13 +137,33 @@ AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlan= g=3DPATH], > =A0]) > =A0AC_SUBST(ERLANG_FLAGS) > > -PKG_CHECK_MODULES([JS], [mozjs185], [ > +AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=3DPATH], > + =A0 =A0 =A0 =A0 =A0 =A0[set PATH to the SpiderMonkey library directory]= )], > + =A0 =A0[ > + =A0 =A0JS_LIB_DIR=3D$withval > + =A0 =A0JS_LIBS=3D"-L$JS_LIB_DIR" > + =A0 =A0AC_MSG_RESULT(yo $JS_LIBS) > +], [ > + =A0 =A0PKG_CHECK_MODULES([JS], [mozjs185], [ > =A0 =A0 JS_LIB_DIR=3D"$(${PKG_CONFIG} --variable=3Dlibdir mozjs185)" > + =A0 =A0], [ > + =A0 =A0 =A0 =A0PKG_CHECK_MODULES([JS], [mozilla-js >=3D 1.7], [ > + =A0 =A0 =A0 =A0 =A0 =A0JS_LIB_DIR=3D"$(${PKG_CONFIG} --variable=3Dsdkdi= r mozilla-js)/lib" > + =A0 =A0 =A0 =A0], [ > + =A0 =A0 =A0 =A0 =A0 =A0JS_LIB_DIR=3D"${libdir}" > + =A0 =A0 =A0 =A0]) > + =A0 =A0]) > +]) > + > + > +AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=3DPATH], > + =A0 =A0[set PATH to the SpiderMonkey include directory])], [ > + =A0 =A0JS_INCLUDE=3D"$withval" > + =A0 =A0JS_CFLAGS=3D"-I$JS_INCLUDE" > =A0], [ > =A0 =A0 PKG_CHECK_MODULES([JS], [mozilla-js >=3D 1.7], [ > - =A0 =A0 =A0 =A0JS_LIB_DIR=3D"$(${PKG_CONFIG} --variable=3Dsdkdir mozill= a-js)/lib" > + =A0 =A0 =A0 =A0JS_CFLAGS=3D"$(${PKG_CONFIG} --variable=3Dincludedir moz= illa-js)/lib" > =A0 =A0 ], [ > - =A0 =A0 =A0 =A0JS_LIB_DIR=3D"${libdir}" > =A0 =A0 =A0 =A0 JS_CFLAGS=3D"-I/usr/include" > =A0 =A0 =A0 =A0 JS_CFLAGS=3D"$JS_CFLAGS -I/usr/include/js" > =A0 =A0 =A0 =A0 JS_CFLAGS=3D"$JS_CFLAGS -I/usr/include/mozjs" > @@ -152,19 +172,6 @@ PKG_CHECK_MODULES([JS], [mozjs185], [ > =A0 =A0 ]) > =A0]) > > -AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=3DPATH], > - =A0 =A0[set PATH to the SpiderMonkey include directory])], [ > - =A0 =A0JS_INCLUDE=3D"$withval" > - =A0 =A0JS_CFLAGS=3D"-I$JS_INCLUDE" > -], []) > - > -AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=3DPATH], > - =A0 =A0[set PATH to the SpiderMonkey library directory])], > - =A0 =A0[ > - =A0 =A0JS_LIB_DIR=3D$withval > - =A0 =A0JS_LIBS=3D"-L$withval" > -], []) > - > =A0use_js_trunk=3Dno > =A0AC_ARG_ENABLE([js-trunk], [AC_HELP_STRING([--enable-js-trunk], > =A0 =A0 [allow use of SpiderMonkey versions newer than js185-1.0.0])], [ > @@ -177,11 +184,8 @@ AS_CASE([$(uname -s)], > =A0 =A0 [CYGWIN*], [] , > =A0 =A0 [*], [ > =A0 =A0 CPPFLAGS=3D"$CPPFLAGS -I/opt/local/include" > - =A0 =A0CPPFLAGS=3D"$CPPFLAGS -I/opt/local/include/js" > =A0 =A0 CPPFLAGS=3D"$CPPFLAGS -I/usr/local/include" > - =A0 =A0CPPFLAGS=3D"$CPPFLAGS -I/usr/local/include/js" > =A0 =A0 CPPFLAGS=3D"$CPPFLAGS -I/usr/include" > - =A0 =A0CPPFLAGS=3D"$CPPFLAGS -I/usr/include/js" > =A0 =A0 LDFLAGS=3D"$LDFLAGS -L/opt/local/lib" > =A0 =A0 LDFLAGS=3D"$LDFLAGS -L/usr/local/lib" > =A0]) > @@ -211,6 +215,8 @@ LIBS=3D"$JS_LIBS $LIBS" > =A0OLD_CPPFLAGS=3D"$CPPFLAGS" > =A0CPPFLAGS=3D"$JS_CFLAGS $CPPFLAGS" > > +AC_MSG_RESULT(js flags $CPPFLAGS) > + > =A0AC_CHECK_HEADER([jsapi.h], [], [ > =A0 =A0 AC_CHECK_HEADER([js/jsapi.h], > =A0 =A0 =A0 =A0 [ > @@ -222,39 +228,65 @@ AC_CHECK_HEADER([jsapi.h], [], [ > =A0Are the Mozilla SpiderMonkey headers installed?]) > =A0 =A0 =A0 =A0 ])]) > > -AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=3Dmozjs185], [ > - =A0 =A0AC_CHECK_LIB([mozjs185-1.0], [JS_NewContext], [JS_LIB_BASE=3Dmoz= js185-1.0], [ > - =A0 =A0 =A0 =A0AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_BASE=3Dmo= zjs], [ > - =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js], [JS_NewContext], [JS_LIB_BASE= =3Djs], [ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js3250], [JS_NewContext], = [JS_LIB_BASE=3Djs3250], [ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js32], [JS_NewCont= ext], [JS_LIB_BASE=3Djs32], [ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_MSG_ERROR([Could not = find the js library. > - > -Is the Mozilla SpiderMonkey library installed?])])])])])])]) > - > -# Figure out what version of SpiderMonkey to use > - > -AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject], > - =A0 =A0# Prevent people from accidentally using SpiderMonkey's that are= too new > +use_js170=3Dno > +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 #include > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ]], > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [[ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#if JS_VERSION =3D=3D 170 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// Use spidermonkey 1.7.0 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Not Spidermonkey 1.7.0 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#endif > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0]])], > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[use_js170=3Dyes], > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[]) > + > +if test "$use_js170" =3D "no"; then > + =A0 =A0AC_CHECK_LIB([mozjs185], [JS_NewContext], [JS_LIB_BASE=3Dmozjs18= 5], [ > + =A0 =A0 =A0 =A0AC_CHECK_LIB([mozjs185-1.0], [JS_NewContext], [JS_LIB_BA= SE=3Dmozjs185-1.0], [ > + =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_B= ASE=3Dmozjs], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js], [JS_NewContext], [JS_= LIB_BASE=3Djs], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js3250], [JS_NewCo= ntext], [JS_LIB_BASE=3Djs3250], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js32], [JS= _NewContext], [JS_LIB_BASE=3Djs32], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_MSG_ERROR([Co= uld not find the js library. > + > + =A0 =A0Is the Mozilla SpiderMonkey library installed?])])])])])])]) > + > + =A0 =A0# Figure out what version of SpiderMonkey to use > + > + =A0 =A0AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject], > + =A0 =A0 =A0 =A0# Prevent people from accidentally using SpiderMonkey's = that are too new > + > + =A0 =A0 =A0 =A0if test "$use_js_trunk" =3D "no"; then > + =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_DECL([JSOPTION_ANONFUNFIX], [], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_MSG_ERROR([Your SpiderMonkey library = is too new. > + > + =A0 =A0Versions of SpiderMonkey after the js185-1.0.0 release remove th= e optional > + =A0 =A0enforcement of preventing anonymous functions in a statement con= text. This > + =A0 =A0will most likely break your existing JavaScript code as well as = render all > + =A0 =A0example code invalid. > + > + =A0 =A0If you wish to ignore this error pass --enable-js-trunk to ./con= figure.])], > + =A0 =A0 =A0 =A0 =A0 =A0[[#include ]]) > + =A0 =A0 =A0 =A0fi > + =A0 =A0 =A0 =A0AC_DEFINE([SM185], [1], > + =A0 =A0 =A0 =A0 =A0 =A0[Use SpiderMonkey 1.8.5])) > > - =A0 =A0if test "$use_js_trunk" =3D "no"; then > - =A0 =A0 =A0 =A0AC_CHECK_DECL([JSOPTION_ANONFUNFIX], [], [ > - =A0 =A0 =A0 =A0 =A0 =A0AC_MSG_ERROR([Your SpiderMonkey library is too n= ew. > + =A0 =A0AC_CHECK_LIB([$JS_LIB_BASE], [JS_ThrowStopIteration], > + =A0 =A0 =A0 =A0AC_DEFINE([SM180], [1], > + =A0 =A0 =A0 =A0 =A0 =A0[Use SpiderMonkey 1.8.0])) > > -Versions of SpiderMonkey after the js185-1.0.0 release remove the option= al > -enforcement of preventing anonymous functions in a statement context. Th= is > -will most likely break your existing JavaScript code as well as render a= ll > -example code invalid. > +else > > -If you wish to ignore this error pass --enable-js-trunk to ./configure.]= )], > - =A0 =A0 =A0 =A0[[#include ]]) > - =A0 =A0fi > - =A0 =A0AC_DEFINE([SM185], [1], > - =A0 =A0 =A0 =A0[Use SpiderMonkey 1.8.5])) > + =A0 =A0AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_BASE=3Dmozjs], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js], [JS_NewContext], [JS_= LIB_BASE=3Djs], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js3250], [JS_NewCo= ntext], [JS_LIB_BASE=3Djs3250], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_CHECK_LIB([js32], [JS= _NewContext], [JS_LIB_BASE=3Djs32], [ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC_MSG_ERROR([Co= uld not find the js library. > > -AC_CHECK_LIB([$JS_LIB_BASE], [JS_ThrowStopIteration], > - =A0 =A0AC_DEFINE([SM180], [1], > - =A0 =A0 =A0 =A0[Use SpiderMonkey 1.8.0])) > + =A0 =A0Is the Mozilla SpiderMonkey library installed?])])])])]) > +fi > > =A0AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength], > =A0 =A0 AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1], >