Subj : Re: Compiling and using SpiderMonkey with Mac OS X To : Brendan Eich From : ggadwa@voyager.net (Brian Barnes) Date : Wed Jul 30 2003 01:47 pm On Wednesday, July 30, 2003, at 12:34 AM, Brendan Eich wrote: > You shouldn't have to change any sources. You need to define both > XP_MAC and XP_UNIX for OS X, I believe. Brian can speak with > authority. Authority != Brian ! But I'll try. Here's how I do it. To compile, d/l whatever (from the tars or cvs), and: cd ~/opensource/mozilla/js/src make -f Makefile.ref BUILD_OPT=1 OPTIMIZER="-O3 -fstrict-aliasing -ffast-math -funroll-loops -mcpu=7400 -force_cpusubtype_ALL" (My download is in an opensource directory in my home directory. Where ever you put it, you want to run the make in the js/src directory.) This, as far as I've experimented, is the best way to compile it for speed on OS X. Watch out with the -ffast-math flag, it's a little dangerous but I don't care that much for numerical precision. Now, here's the part that's tricky, and could use some documentation. In js/src/darwin_opt.obj will be libjs.a. All the .h files you will need are in js/src. Include in your project: libjs.a (the library) jsapi.h jsautocfg.h jscompat.h jslong.h jsosdep.h jsotypes.h jspubtd.h jstypes.h (That's the tricky part) And in your main header file, include: #define XP_UNIX #define JSFILE #include "jsapi.h" There ya go. [>] Brian .