- It’s highly configurable. Each individual warning can be turned on or off, and warnings can be overridden for individual lines of code. This is essential for cases where potentially dangerous behavior is being deliberately used (carefully, of course).
- Since Sun Studio is no longer available, you’ll want to build with gcc.
- Remove the file spidermonkey/src/lock_SunOS.s. According to the comments, this file is only needed with Sun Studio, and it won’t build with the GNU assembler. If you don’t remove the file, it will be picked up by a Makefile wildcard (not the line in Makefile.ref that appears to refer to it!).
- Copy the file below into spidermonkey/src/config/SunOS5.11_i86pc.mk.
- In the root, run “python setup.py build”.
- This should work except for the very last step in the build. The build system runs something like this:
On my system, this produces hundreds of linker errors because gcc is trying to use the GNU linker instead of the OS linker. If you replace the “gcc” in that line with “ld” and run it by hand, it should work.
Here’s the contents of SunOS5.11_i86pc.mk:
# # Config stuff for SunOS5.11 # AS = as CC = gcc CCC = g++ CFLAGS += -Wall -Wno-format RANLIB = echo OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -DSOLARIS -DHAVE_LOCALTIME_R OS_LIBS = -lsocket -lnsl -ldl HAVE_PURIFY = 1 MKSHLIB = $(LD) -G # Use the editline library to provide line-editing support. JS_EDITLINE = 1
Of course, these instructions are very specific to the build environment, so YMMV. It took me a while to figure out the right settings in SunOS5.11_i86pc.mk, so I wanted to make that available in case anyone else is trying to build JSL on SmartOS, Illumos or other Solaris-based systems. That said, if you don’t care about remaining close to the original source, you may as well just use my fork on github. Even if it doesn’t build out of the box in your environment, the Makefiles should be far easier to understand and modify.