Description of problem: XP_UNIX AND JS_THREADSAFE need to be defined when including headers from js-devel, also /usr/include/nspr4 needs to be in the include search path. These things should be handled by libjs.pc
Created attachment 351535 [details] Patch that fixes the reported problem. Patch tested against my own application only.
Hello, Thomas Sondergaard. Thank you for the report. (In reply to comment #0) > Description of problem: > XP_UNIX AND JS_THREADSAFE need to be defined when including headers from > js-devel Why?? >, also /usr/include/nspr4 needs to be in the include search path. This is not part of js. $ repoquery --whatprovides /usr/include/nspr4 nspr-devel-0:4.8-1.fc11.i586 nspr-devel-0:4.7.3-5.fc11.i586 You are shure what build js requires nspr-devel?? > These > things should be handled by libjs.pc In you patch only release bump and additional defines... According to libjs.pc only log... What exact trouble you have with js?
(In reply to comment #2) > What exact trouble you have with js? [ts@roadrunner ~]$ cat minimal.c #include <jsapi.h> #include <jsdate.h> #include <jsscript.h> int main() { return 0; } [ts@roadrunner ~]$ gcc -Wall -g $(pkg-config --libs --cflags libjs) -o minimal minimal.c In file included from /usr/include/jspubtd.h:45, from /usr/include/jsapi.h:47, from minimal.c:1: /usr/include/jstypes.h:248:6: error: #error "Must define one of XP_BEOS, XP_OS2, XP_WIN or XP_UNIX" /usr/include/jstypes.h:264:2: error: #error No suitable type for JSInt8/JSUint8 <snip> "gcc -Wall -g $(pkg-config --libs --cflags libjs) -DXP_UNIX -o minimal minimal.c" compiles without errors, but since js is built with thread-safety a real example wouldn't work. We need to compile with -DJS_THREADSAFE=1, but when we do that we see that we need nspr-devel: [ts@roadrunner ~]$ gcc -Wall -g $(PKG_CONFIG_PATH=. pkg-config --libs --cflags play) -DXP_UNIX=1 -DJS_THREADSAFE=1 -o minimal minimal.c In file included from /usr/include/jsatom.h:53, from /usr/include/jsscript.h:46, from minimal.c:3: /usr/include/jslock.h:45:20: error: pratom.h: No such file or directory /usr/include/jslock.h:46:20: error: prlock.h: No such file or directory /usr/include/jslock.h:47:20: error: prcvar.h: No such file or directory /usr/include/jslock.h:48:22: error: prthread.h: No such file or directory <snip> - pratom.h, prlock.h etc are all from nspr-devel. In addition to the patch I provided js-devel should also be changed to depend on nspr-devel
(In reply to comment #3) > (In reply to comment #2) > > What exact trouble you have with js? > > [ts@roadrunner ~]$ cat minimal.c > #include <jsapi.h> > #include <jsdate.h> > #include <jsscript.h> > > int main() { > return 0; > } > > [ts@roadrunner ~]$ gcc -Wall -g $(pkg-config --libs --cflags libjs) -o minimal > minimal.c > In file included from /usr/include/jspubtd.h:45, > from /usr/include/jsapi.h:47, > from minimal.c:1: > /usr/include/jstypes.h:248:6: error: #error "Must define one of XP_BEOS, > XP_OS2, XP_WIN or XP_UNIX" > /usr/include/jstypes.h:264:2: error: #error No suitable type for JSInt8/JSUint8 Ok, this error about your program must define one of XP_BEOS, > XP_OS2, XP_WIN or XP_UNIX, not js self. > "gcc -Wall -g $(pkg-config --libs --cflags libjs) -DXP_UNIX -o minimal > minimal.c" compiles without errors, but since js is built with thread-safety a > real example wouldn't work. We need to compile with -DJS_THREADSAFE=1, but when > we do that we see that we need nspr-devel: > > [ts@roadrunner ~]$ gcc -Wall -g $(PKG_CONFIG_PATH=. pkg-config --libs --cflags > play) -DXP_UNIX=1 -DJS_THREADSAFE=1 -o minimal minimal.c > In file included from /usr/include/jsatom.h:53, > from /usr/include/jsscript.h:46, > from minimal.c:3: > /usr/include/jslock.h:45:20: error: pratom.h: No such file or directory > /usr/include/jslock.h:46:20: error: prlock.h: No such file or directory > /usr/include/jslock.h:47:20: error: prcvar.h: No such file or directory > /usr/include/jslock.h:48:22: error: prthread.h: No such file or directory > <snip> > - pratom.h, prlock.h etc are all from nspr-devel. I don't known about what program you are speak, but again I think in this situation you programm must have nspr-devel dependency. Why you search it in js?
(In reply to comment #4) > Ok, this error about your program must define one of XP_BEOS, > XP_OS2, XP_WIN or XP_UNIX, not js self. Only XP_UNIX makes sense for this rpm, so it would be very nice if libjs.pc would be nice enough to define it. According to http://pkg-config.freedesktop.org/wiki/ pkg-config is all about getting the necessary compiler options, so you don't have to hardcode them. > I don't known about what program you are speak, but again I think in this > situation you programm must have nspr-devel dependency. Why you search it in > js? What? Look in jsatom.h - it includes pratom.h. Obviously js-devel depends on nspr-devel! To recap. 1) libjs.pc should define XP_UNIX because that is the only option that makes sense in a fedora rpm and we want such necessary defines specified for us via pkg-config, so library users don't have to hardcode them. 2) When js is compile with JS_THREADSAFE=1, which it is, then it depends on nspr - this dependency is already present in the rpm, *and* js-devel depends on nspr-devel for pratom.h etc.
(In reply to comment #5) > Only XP_UNIX makes sense for this rpm, so it would be very nice if libjs.pc > would be nice enough to define it. Ok, you are right, in particular Fedora package we can define it. > 2) When js is compile with JS_THREADSAFE=1, which it is, As I can understand you are suggest compile js with it, now it is compiled without. And I don't understand why we need recompile it with this define. Please, can you more describe that? BTW, did you speaking with upstream about this two things???
(In reply to comment #6) > > 2) When js is compile with JS_THREADSAFE=1, which it is, > As I can understand you are suggest compile js with it, now it is compiled > without. js-1.70-5.fc11 already *is* compiled with JS_THREADSAFE=1. Look in the .spec for JS_THREADSAFE. > BTW, did you speaking with upstream about this two things??? This has nothing to do with upstream. If JS_THREADSAFE was defined when libjs.so was built it needs to be defined when applications include headers from js-devel.
Ok, I think I understand you. Thank you for the patience and descriptions (I'm new maintainer of js, and it will first my update). Updates follow.
js-1.70-8.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/js-1.70-8.fc10
js-1.70-8.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/js-1.70-8.fc11
js-1.70-8.el5 has been submitted as an update for Fedora EPEL 5. http://admin.fedoraproject.org/updates/js-1.70-8.el5
js-1.70-8.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
js-1.70-8.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
js-1.70-8.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.