Subj : Re: JS_THREADSAFE required for clients of threadsafe js32.dll? To : netscape.public.mozilla.jseng From : Jens Thiele Date : Tue Nov 16 2004 03:53 pm Brendan Eich schrieb: >> #ifdef JS_THREADSAFE >> #define JS_NewRuntime(maxbytes) JS_Init(maxbytes, 1) >> #else >> #define JS_NewRuntime(maxbytes) JS_Init(maxbytes, 0) >> #endif > > > We can't change any API, including a macro one. > > Without a new API, we can't automate this consistency check. Do we need > a new API here, or just better docs? I bet real money that a new API > will not be used by those who need the better docs. > > /be For me it would be more important to be able to detect wether the installed library was compiled with JS_THREADSAFE at configure/compile time (in configure scripts) and in cross-compilation setups runtime checks don't help with this. For linux/unixish platforms I would souggest using pkg-config (of course this only works as long as the pkg-config file matches the installed library). This could also be done by distributors. But probably all linux distributions will ship the library compiled with JS_THREADSAFE anyway. (debian does - though the package maintainer is willing to add a version compiled without JS_THREADSAFE). ^-- is this correct English? hmm - just thought about this: A solution which would work at compile/link-time would be to add a function only to one version and there are already such functions: JS_BeginRequest for example => a configure check only needs to check wether this function is available to detect if the library was compiled with JS_THREADSAFE and then add -DJS_THREADSAFE to to CFLAGS. using autoconf - something like this should work: AC_CHECK_LIB($SMJS, JS_BeginRequest, CFLAGS="$CFLAGS -DJS_THREADSAFE") btw. is there some consensus for the library name? debian uses libsmjs since another javascript interpreter (ngs) got packaged first and is using libjs.so (hmm and there is another version of spidermonkey - libmozjs.so provided by the mozilla-browser package) Greetings Jens .