This article deals with installing JavaScript on Unix,
specifically FreeBSD. Although FreeBSD comes with a port of
SpiderMonkey, in /usr/ports/lang/spidermonkey, it doesn't
seem to work with the Perl JavaScript module. Following the advice
given in the JavaScript module, I reinstalled the spidermonkey library
myself and built against that.
wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
js/src.
gmake -f Makefile.ref
config.mk:150: config/FreeBSD7.2-RELEASE.mk: No such file or directory cat: ../../dist/FreeBSD7.2-RELEASE_DBG.OBJ/nspr/Version: No such file or directory gmake: *** No rule to make target `config/FreeBSD7.2-RELEASE.mk'. Stop.
config/Linux_All.mk
to config/FreeBSD7.2-RELEASE.mk, or whatever it said in
the equivalent message.
gmake again.
FreeBSD7.2-RELEASE_DBG.OBJ/.
*.h) and tables
(*.tbl) from the src directory to the
FreeBSD7.2-RELEASE_DBG.OBJ.
[ben@mikan] src 575 $ cp *.tbl *.h FreeBSD7.2-RELEASE_DBG.OBJ/Note that the header file
jsautocfg.h is only in the FreeBSD7.2-RELEASE_DBG.OBJ directory, so if you compile against the header files in src, you will get a huge number of errors from the C compiler, starting off with the line
/home/ben/software/js/js/src/jstypes.h:245:71: error: jsautocfg.h: No such file or directory
export JS_LIB=/home/ben/software/js/js/src/FreeBSD7.2-RELEASE_DBG.OBJ/ export JS_INC=/home/ben/software/js/js/src/FreeBSD7.2-RELEASE_DBG.OBJ/
cpan to install JavaScript:
cpan JavaScriptIn my case this required installing one prerequisite, Test::Exception. Remember that if
cpan fails, you can always download the distribution from CPAN and install it with
perl Makefile.PL make make test make install