Search code examples
javascriptcouchdbmozillaspidermonkey

Compile CouchDB from source on Ubuntu Lucid, automatically


Mozilla SpiderMonkey is not provided anymore in Ubuntu Lucid as a standalone package. According to this link, you have to use the library provided with xulrunner, and say so to the CouchDB configure script:

./configure --with-js-lib=/usr/lib/xulrunner-devel-1.9.2.3/lib --with-js-include=/usr/lib/xulrunner-devel-1.9.2.3/include

This is fine, but I need to do this automatically. In my case this is not 1.9.2.3, but 1.9.2.23, and anyway this will change without notice in the future. I have an unattended script which installs CouchDB, and I would like to tweak it support lucid.

I can look for the library:

$ locate libmozjs.so
/usr/lib/xulrunner-1.9.2.23/libmozjs.so

And derive the lib and include directories from there. But this looks quite error prone (what it there are other libmozjs.so in the system, ...)

The ideal thing would be to ask xulrunner itself. Is it possible to query where its lib and include directories are? (which xulrunner gives me a chain of 5 (!) symbolic links which anyway do not lead to the lib and include directories)

Or better yet, is there a way to install the SpiderMonkey library in a standalone way in Lucid? (apart from compiling from source)


Solution

  • i386 https://launchpad.net/ubuntu/lucid/i386/libmozjs-dev/1.8.1.16+nobinonly-0ubuntu1

    https://launchpad.net/ubuntu/intrepid/i386/libmozjs0d/1.8.1.18+nobinonly.b308.cvs20090331t155113-0ubuntu0.8.10.1

    amd64 https://launchpad.net/ubuntu/lucid/amd64/libmozjs-dev/1.8.1.16+nobinonly-0ubuntu1

    https://launchpad.net/ubuntu/intrepid/amd64/libmozjs0d/1.8.1.18+nobinonly.b308.cvs20090331t155113-0ubuntu0.8.10.1

    Here you are. You will also need libnspr4-dev.