Re: git commit: Fix SpiderMonkey version detection

2012-01-22 Thread Filipe David Manana
Paul, after this change I'm no longer able to build master (haven't
tried other branches however).

configure can't find js/jsapi.h, this is because my jsapi.h doesn't
live inside a js directory.

Ubuntu 10.10
jsapi.h full path: /usr/include/xulrunner-1.9.2.24/jsapi.h

flags passed to configure:

configure --with-js-include=/usr/include/xulrunner-1.9.2.24
--with-js-lib=/usr/lib/xulrunner-1.9.2.24

It's the only spidermonkey version I have installed.

Without this commit, configure doesn't complain and everything works fine.
Is this a local issue or something missing in the autotools config?

On Sat, Jan 21, 2012 at 10:10 PM,  dav...@apache.org wrote:
 Updated Branches:
  refs/heads/master da33e3447 - 10047e759


 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/master
 Commit: 10047e75935818e0421bdd9ac96dc21334f90e95
 Parents: da33e34
 Author: Paul Joseph Davis dav...@apache.org
 Authored: Sat Jan 21 16:08:58 2012 -0600
 Committer: Paul Joseph Davis dav...@apache.org
 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 jsapi.h]]
 +)
 +
  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 jsapi.h]]
 -)
 -
  LIBS=$OLD_LIBS
  CPPFLAGS=$OLD_CPPFLAGS





-- 
Filipe David Manana,

Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men.


Re: git commit: Fix SpiderMonkey version detection

2012-01-22 Thread Bob Dionne
same issue here, jsapi.h isn't in a js directory. MBA running Lion

On Jan 22, 2012, at 1:15 PM, Filipe David Manana wrote:

 Paul, after this change I'm no longer able to build master (haven't
 tried other branches however).
 
 configure can't find js/jsapi.h, this is because my jsapi.h doesn't
 live inside a js directory.
 
 Ubuntu 10.10
 jsapi.h full path: /usr/include/xulrunner-1.9.2.24/jsapi.h
 
 flags passed to configure:
 
 configure --with-js-include=/usr/include/xulrunner-1.9.2.24
 --with-js-lib=/usr/lib/xulrunner-1.9.2.24
 
 It's the only spidermonkey version I have installed.
 
 Without this commit, configure doesn't complain and everything works fine.
 Is this a local issue or something missing in the autotools config?
 
 On Sat, Jan 21, 2012 at 10:10 PM,  dav...@apache.org wrote:
 Updated Branches:
  refs/heads/master da33e3447 - 10047e759
 
 
 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/master
 Commit: 10047e75935818e0421bdd9ac96dc21334f90e95
 Parents: da33e34
 Author: Paul Joseph Davis dav...@apache.org
 Authored: Sat Jan 21 16:08:58 2012 -0600
 Committer: Paul Joseph Davis dav...@apache.org
 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 jsapi.h]]
 +)
 +
  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 jsapi.h]]
 -)
 -
  LIBS=$OLD_LIBS
  CPPFLAGS=$OLD_CPPFLAGS
 
 
 
 
 
 -- 
 Filipe David Manana,
 
 Reasonable men adapt themselves to the world.
  Unreasonable men adapt the world to themselves.
  That's why all progress depends on unreasonable men.



Re: git commit: Fix SpiderMonkey version detection

2012-01-22 Thread Dave Cottlehuber
On 22 January 2012 19:15, Filipe David Manana fdman...@apache.org wrote:
 Paul, after this change I'm no longer able to build master (haven't
 tried other branches however).

Ditto.

 configure can't find js/jsapi.h, this is because my jsapi.h doesn't
 live inside a js directory.

 Ubuntu 10.10
 jsapi.h full path: /usr/include/xulrunner-1.9.2.24/jsapi.h

 flags passed to configure:

 configure --with-js-include=/usr/include/xulrunner-1.9.2.24
 --with-js-lib=/usr/lib/xulrunner-1.9.2.24

Windows::
/relax/js-1.8.5/js/src/dist/include/jsapi.h

maas@sendai /relax/couchdb
$ more /relax/bin/couchdb_config_js185.sh
#!/bin/sh
COUCH_TOP=`pwd`
export COUCH_TOP

./configure \
--with-js-lib=/relax/js-1.8.5/js/src/dist/lib \
--with-js-include=/relax/js-1.8.5/js/src/dist/include \
...

A+
Dave


Re: git commit: Fix SpiderMonkey version detection

2012-01-22 Thread Paul Davis
Dave pasted me part of his. I realized that I moved the header check
above the spot where we assign the JS_CPPFLAGS which was dumb of me.
Pushed a fix in 572b561adbf852e08c7397519070f299d0b401e4 to master.
Soon as I have confirmation it's correct I'll backport to 1.2.x and
1.1.x

On Sun, Jan 22, 2012 at 2:38 PM, Paul Davis paul.joseph.da...@gmail.com wrote:
 Most odd since I only added three directories to search for.

 Can you all post me a config.log so I can see the compiler options being used?

 On Sun, Jan 22, 2012 at 1:56 PM, Dave Cottlehuber d...@muse.net.nz wrote:
 On 22 January 2012 19:15, Filipe David Manana fdman...@apache.org wrote:
 Paul, after this change I'm no longer able to build master (haven't
 tried other branches however).

 Ditto.

 configure can't find js/jsapi.h, this is because my jsapi.h doesn't
 live inside a js directory.

 Ubuntu 10.10
 jsapi.h full path: /usr/include/xulrunner-1.9.2.24/jsapi.h

 flags passed to configure:

 configure --with-js-include=/usr/include/xulrunner-1.9.2.24
 --with-js-lib=/usr/lib/xulrunner-1.9.2.24

 Windows::
 /relax/js-1.8.5/js/src/dist/include/jsapi.h

 maas@sendai /relax/couchdb
 $ more /relax/bin/couchdb_config_js185.sh
 #!/bin/sh
 COUCH_TOP=`pwd`
 export COUCH_TOP

 ./configure \
 --with-js-lib=/relax/js-1.8.5/js/src/dist/lib \
 --with-js-include=/relax/js-1.8.5/js/src/dist/include \
 ...

 A+
 Dave


Re: git commit: Fix SpiderMonkey version detection

2012-01-22 Thread Paul Davis
Dave confirmed. Backported to 1.1.x and 1.2.x. Sorry for the dumb
mistake on that one.

On Sun, Jan 22, 2012 at 2:47 PM, Paul Davis paul.joseph.da...@gmail.com wrote:
 Dave pasted me part of his. I realized that I moved the header check
 above the spot where we assign the JS_CPPFLAGS which was dumb of me.
 Pushed a fix in 572b561adbf852e08c7397519070f299d0b401e4 to master.
 Soon as I have confirmation it's correct I'll backport to 1.2.x and
 1.1.x

 On Sun, Jan 22, 2012 at 2:38 PM, Paul Davis paul.joseph.da...@gmail.com 
 wrote:
 Most odd since I only added three directories to search for.

 Can you all post me a config.log so I can see the compiler options being 
 used?

 On Sun, Jan 22, 2012 at 1:56 PM, Dave Cottlehuber d...@muse.net.nz wrote:
 On 22 January 2012 19:15, Filipe David Manana fdman...@apache.org wrote:
 Paul, after this change I'm no longer able to build master (haven't
 tried other branches however).

 Ditto.

 configure can't find js/jsapi.h, this is because my jsapi.h doesn't
 live inside a js directory.

 Ubuntu 10.10
 jsapi.h full path: /usr/include/xulrunner-1.9.2.24/jsapi.h

 flags passed to configure:

 configure --with-js-include=/usr/include/xulrunner-1.9.2.24
 --with-js-lib=/usr/lib/xulrunner-1.9.2.24

 Windows::
 /relax/js-1.8.5/js/src/dist/include/jsapi.h

 maas@sendai /relax/couchdb
 $ more /relax/bin/couchdb_config_js185.sh
 #!/bin/sh
 COUCH_TOP=`pwd`
 export COUCH_TOP

 ./configure \
 --with-js-lib=/relax/js-1.8.5/js/src/dist/lib \
 --with-js-include=/relax/js-1.8.5/js/src/dist/include \
 ...

 A+
 Dave