Archive

Archive for July, 2010

How to install libjs (SpiderMonkey)

July 31st, 2010 8 comments

In Ubuntu 10.04 (Lucid) there’s no deb package for libjs. I needed to use version 1.8 of libjs with MediaTomb. Normally this would mean you download the source code for libjs and “./configure; make; make install” but the source code for libjs 1.8 doesn’t come with a configure script, or with an install target in the Makefile.ref file.

The SpiderMonkey Build Documentation is helpful in getting a build done, but points to some SpiderMonkey manual installation instructions that are no longer available. If you create a file called Makefile in the js/src directory with the contents shown below, you can issue the normal “make install” to install libjs. Better yet, you should install the “checkinstall” package and use:

checkinstall -D make install

This will create a debian package (-D) that does the same thing as “make install”.

Make sure you use a hard tab to indent the lines below “install:” target or else the Makefile won’t work. Since the build result is placed in a subdirectory named based on the system, you might have to adjust the BLD (look for the location of the libjs.so file). The PREFIX should probably be /usr when used with checkinstall, and /usr/local otherwise.

BLD := Linux_All_OPT.OBJ
#PREFIX := /usr/local
PREFIX := /usr
 
install:
        cp ${BLD}/libjs.so ${PREFIX}/lib
        cp ${BLD}/js ${PREFIX}/bin
        cp ${BLD}/jscpucfg ${PREFIX}/bin
        cp ${BLD}/jskwgen ${PREFIX}/bin
        mkdir -p ${PREFIX}/include/js
        cp *.h ${PREFIX}/include/js
        cp *.tbl ${PREFIX}/include/js
        cp ${BLD}/*.h ${PREFIX}/include/js
Categories: Uncategorized Tags: