Installing js (Mozilla's Spidermonkey) and jsl (Matthias Miller's Javascript-Lint)

2007-Aug29:  Twice in rapid succession I have encountered free downloadable software that came as a large tar.gz archive containing absolutely nothing about how to install the thing.  The first was Spidermonkey from Mozilla.org.  The second was jsl by Matthias Miller, which being based on Spidermonkey has seemingly inherited that same contemptuous attitude toward anyone wanting to use it.  In fairness, I should point out that Mozilla.org does provide a separate webpage containing some bare-bones instructions about installing js; it's just that they're seriously misleading due to a missing directory-name, and that together with my not knowing the first thing about OS-X led me to mis-read the instructions and gave me the impression that their Makefile.ref actually installed the executables into an appropriate place, which it does not do.

To install jsl:  once you've done the untgz on the downloaded jsl, and are in the resulting directory, do the following:
cd src
make -f Makefile.ref
cd *.OBJ*
sudo cp jsl jscpucfg /usr/bin/
sudo cp jsautocfg.h /usr/include/
sudo cp libjs.so /usr/lib/
jsl -help:conf >/tmp/jsl.conf
sudo cp /tmp/jsl.conf /etc   ## now edit /etc/jsl.conf with your texteditor to configure the options for jsl

Note that you may already have copies of jscpucfg, jsautocfg.h and libjs.so in appropriate places from having installed other Mozilla software, in which case you may choose to skip those copying steps.

To install js:  I had gotten around Spidermonkey's lack of info by using yum to install it.  However, when yum was not an option for jsl, I googled and pieced together the instructions reproduced above.  I now realize that much the same method will also work for Spidermonkey.  The key insight is the location of the resulting executables.  They will be under src/Linux_All_DBG.OBJ if you run Linux;  in general it looks to be safe to say they'll be under src/*.OBJ* (and there'll be exactly one such subdirectory, for straightforward uses of Makefile.ref).  Here are the steps for js:
cd src
make -f Makefile.ref
cd *.OBJ*
sudo cp js jscpucfg /usr/bin/
sudo cp jsautocfg.h /usr/include/
sudo cp libjs.so /usr/lib/

The same remarks (as for jsl above) apply regarding the copying of jscpucfg, jsautocfg.h and libjs.so.  Should you wish to use Spidermonkey from C programs, then you'll also need to copy src/jsapi.h to an appropriate place.  I'm hoping to simply use it from the commandline with js, but don't yet know whether that'll allow me to do the sorts of things I want to do...

PS:  You can find js at ftp.mozilla.org/pub/mozilla.org/js/js-1.60.tar.gz
and jsl at www.javascriptlint.com/download/jsl-0.3.0-src.tar.gz
(depending on when you're reading this, you may want to check for newer versions).