Subj : Re: spidermonkey and win32 questions To : Darius From : Brendan Eich Date : Thu Dec 11 2003 10:23 am Darius wrote: > 1) I need to link spidermonkey as a static library, but when i do so, i get some > linking warnings caused by the use of declspec(dllimport) when building jsshell, > declaration obviously not required in that case. So my solution was to patch > jstypes.h to check for a _STATIC preprocessor variable disabling > declspec(dllimport), variable that I define for a static library build config. > Is it ok to do so ? I mean, is static linking officially supported by > spidermonkey on win32 ? Sure, you can staticly link. Maybe we should make your patch official with a JS_STATIC_LINKAGE macro you can define to disable declspec(dllimport) and enable the right stuff. Hmm, isn't there already such support, for Mozilla's static build? Cc'ing bryner and bsmedberg. > And what about multithreading issues ? Can i safely use > the engine with the win32 synchronisation api or do i have to use NSPR (assuming > i'll use 1 context per thread)? You still have to define JS_THREADSAFE and provide PRLock and PRCondVar type primitives. Why not use NSPR, linking staticly even so you pick up only what you need? Otherwise you're reinventing part of it to satisfy the names called from the JS code, or else you're hacking up the JS code unmaintainably to change the names to call the Windows mutex/condvar routines directly. That's never a good idea. > And is the fact of `modifying' it for freeware > use a licencing issue ? Yes (freeware is not well-defined, and not the right word to use if you want to get down to licensing brass tacks). See http://www.mozilla.org/MPL/ -- read the FAQs. > 2) For testing purpose, I compiled js and jsshell using the default release > configuration (on win2k pro sp4, msvc++ 6, js 1.5 rc5a, and the /OPT:NOICF flag) > and i run the tests suite provided separately, omitting all liveconnect tests. > My results are : 1069 test(s) selected, 1064 test(s) completed, 15 failures > reported (1.4% failed), and one of these failing tests made jsshell crash. Is it > a real problem ? (If someone is interested, I can mail the full result file) That's a problem. Sounds like something is built badly. Are you recompiling everything, to cope with lack of header file dependencies? Or do you have good deps thanks to msvc? Anyway, posting the testsuite results would help show where the problem lies. /be .