Subj : Re: SpiderMonkey on Mac/Codewarrior To : netscape.public.mozilla.jseng From : Bruce Wheaton Date : Mon Aug 16 2004 08:02 pm That didn't see to give me any trouble. But I have run into problems with linking in NSPR. After quite a fun time discovering the limitations of dynamic libs on OS X, I'm making a Spidermonkey static lib to use. I've added nspr4.a, the OS X static version of the NSPR lib to that project. It compiles fine, but when I try to use the library, I get link errors. The missing pieces seem to be: Restfp and savefp, referenced from balloc _umoddi3 and _udivdi3 from 'fill2' I can't find these in the nspr source code. Does this ring a bell? Thanks, Bruce On 8/14/04 9:52 AM, in article cflg0e$ml31@ripley.netscape.com, "Shanti Rao" wrote: > The other thing you may want to do is set the byte alignment to 4. I think CW > uses 8 by default. Don't use 1 or 2, though, because SM uses the 'shadow' > bytes between memory blocks to do garbage collection. > >> On 8/11/04 9:08 AM, in article cfdga5$t662@ripley.netscape.com, "Shanti Rao" >> wrote: >> >> >>> See http://bugzilla.mozilla.org/show_bug.cgi?id=59195 >> >> >> I did, that's quite a pageful, thanks. It looks as though your changes were >> incorporated. I have 1.5 rc6a, so they're probably there. I had some >> fiddling to do to get a compilation, but didn't have to include the files >> you mention. Possibly the MSL prefix I'm using covers that. Although this >> may be leading me into trouble with NSPR, which I'm trying to integrate >> piece by piece since it has no CW build. >> >> Thanks, >> >> Bruce >> >> >>> I haven't used codewarrior in a long time, but, looking through my code, the >>> other things you may need to do is >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> Depending on what their math library implements, you may have to add to >>> jsmath.c: >>> >>> #define fd_atan2 atan2 >>> #define fd_pow pow >>> >>> double fd_copysign (double a, double b) >>> { >>> if ((a>0 && b<0) || (a<0 && b>0)) return -a; >>> return a; >>> } >>> >>> Good luck, >>> >>> Shanti >>> >>> >>>> I just came across SpiderMonkey and it looks like it would fill some >>>> feature >>>> requests I've had. I do have a couple of questions. >>>> >>>> Are there instructions on building a project from scratch? I'd like to make >>>> a Codewarrior cross-platform project (OS X and Win32) and nothing seems >>>> available. I have the source code from rc6a, but will I need to make a >>>> header with definitions to make it compile the way I want? >>>> >>>> Also, is this embedding SpiderMonkey 'trivial'? The docs may it seem quite >>>> reasonable, although a lot of work publishing C++ classes I want available >>>> to Javascript. >>>> >>>> Thanks, >>>> >>>> Bruce Wheaton >>>> >> >> .