I'm trying to do a trunk (and 1.75.2 from berlios) build on FreeBSD 8.2 amd64. I'm using the current ports of GNUstep and I'm getting some pretty confusing build errors.
svn co http://svn.berlios.de/svnroot/repos/oolite-linux/trunk/
U trunk
Checked out revision 4577.
cd trunk
gmake -f Makefile debug
<insert the output of a successful js library fetch and build>
gmake -f GNUmakefile debug=yes
This is gnustep-make 2.6.1. Type 'gmake print-gnustep-make-help' for help.
gmake[1]: Entering directory `/root/oolite-build/trunk'
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
Making all for objc_program oolite...
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
Compiling file src/Core/legacy_random.c ...
Compiling file src/BSDCompat/strlcpy.c ...
Compiling file src/Core/Debug/OOTCPStreamDecoder.c ...
Compiling file src/Core/OOPlanetData.c ...
Compiling file src/Core/Debug/OODebugMonitor.m ...
src/Core/Debug/OODebugMonitor.m: In function '-[OODebugMonitor performJSConsoleCommand:]':
src/Core/Debug/OODebugMonitor.m:202: error: 'JSID_VOID' undeclared (first use in this function)
src/Core/Debug/OODebugMonitor.m:202: error: (Each undeclared identifier is reported only once
src/Core/Debug/OODebugMonitor.m:202: error: for each function it appears in.)
src/Core/Debug/OODebugMonitor.m: In function '-[OODebugMonitor dumpMemoryStatistics]':
src/Core/Debug/OODebugMonitor.m:608: warning: implicit declaration of function 'JS_GetGCParameter'
src/Core/Debug/OODebugMonitor.m:608: error: 'JSGC_BYTES' undeclared (first use in this function)
src/Core/Debug/OODebugMonitor.m:610: error: 'JSGC_NUMBER' undeclared (first use in this function)
src/Core/Debug/OODebugMonitor.m: In function '-[OODebugMonitor(Private) oo:jsValueInContext:]':
src/Core/Debug/OODebugMonitor.m:912: warning: implicit declaration of function 'JS_AddNamedObjectRoot'
gmake[4]: *** [obj.spk.dbg/oolite.obj/OODebugMonitor.m.o] Error 1
gmake[3]: *** [internal-objc_program-all_] Error 2
gmake[2]: *** [oolite.all.objc-program.variables] Error 2
gmake[1]: *** [internal-all] Error 2
gmake[1]: Leaving directory `/root/oolite-build/trunk'
gmake: *** [debug] Error 2
If I use tool.make as suggested then the build does nothing.
I've checked the mozilla JS build and the static libarary exists, as does the header files and they are being generated in the correct locations.
I've also tried a clean install from scratch on another machine with the same errors.
Which version of Spidermonkey are you using? It looks like it may not the one from Firefox 4.
Also, I would recommend ditching GNUstep 1.19.3. It is known to contain bugs that affect plist parsing in Oolite. Both Windows and Linux versions are currently powered by GNUstep 1.20.1. In addition, you will need to build making sure that gnustep-make is configured with --enable-native-objc-exceptions. Native Obj-C exceptions are now a requirement for building the Oolite source.
Oh, and just to be sure, can you please post the output if you build Oolite using gmake -f GNUmakefile debug=yes messages=yes? It would be useful to see the exact command line that make is trying to execute when attempting to build OODebugMonitor.m, instead of "Compiling file...".
Another possibility is that your Spidermonkey is the correct version but not the right build type. If you are building Oolite with debug=yes, I think that you also need to have a debug version of the JavaScript shared object available, otherwise the build is confused. The easiest way to find this out would be to try building using gmake -f GNUmakefile debug=no.
Which version of Spidermonkey are you using? It looks like it may not the one from Firefox 4.
Another possibility is that your Spidermonkey is the correct version but not the right build type. If you are building Oolite with debug=yes
I am using the bundled static JS library which is grabbed and built as part of the Makefile, which ends up here - deps/Cross-platform-deps/mozilla/js/src/build-debug/dist/lib and /include respectively.
Also, I would recommend ditching GNUstep 1.19.3.
I can do, although this is the newest version in the FreeBSD ports tree (I've been trying to stick to a ports/package build). However I've built previous 1.7X (including 1.75) versions with this exact install of gnustep without issue. I'll uninstall this and manually build from source, I'll probably wont be able to try this until tomorrow morning.
Oh, and just to be sure, can you please post the output if you build Oolite using gmake -f GNUmakefile debug=yes messages=yes
pyro# gmake -f GNUmakefile debug=yes messages=yes
This is gnustep-make 2.6.1. Type 'gmake print-gnustep-make-help' for help.
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
Making all for objc_program oolite...
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
/usr/local/GNUstep/System/Library/Makefiles/objc.make:30: objc.make is deprecated. Please use tool.make instead
cc src/Core/Debug/OODebugMonitor.m -c \
-MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -fPIC -g -DDEBUG -fno-omit-frame-pointer -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -pipe -fno-strict-aliasing -fgnu-runtime -Wall -std=c99 -DLOADSAVEGUI -DLINUX -DXP_UNIX -Wno-import `sdl-config --cflags` `nspr-config --cflags` -DHAVE_LIBESPEAK=1 -DMOZ_TRACE_JSCALLS=1 -g -O0 -DDEBUG -DOO_DEBUG -DOO_OXP_VERIFIER_ENABLED=1 -DOO_LOCALIZATION_TOOLS=1 -DDEBUG_GRAPHVIZ=1 -fconstant-string-class=NSConstantString -Ideps/Cross-platform-deps/mozilla/js/src/build-debug/dist/include -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables -I. -I/usr/local/include -I/root/GNUstep/Library/Headers -I/usr/local/GNUstep/Local/Library/Headers -I/usr/local/GNUstep/System/Library/Headers \
-o obj.spk.dbg/oolite.obj/OODebugMonitor.m.o
src/Core/Debug/OODebugMonitor.m: In function '-[OODebugMonitor performJSConsoleCommand:]':
src/Core/Debug/OODebugMonitor.m:202: error: 'JSID_VOID' undeclared (first use in this function)
src/Core/Debug/OODebugMonitor.m:202: error: (Each undeclared identifier is reported only once
src/Core/Debug/OODebugMonitor.m:202: error: for each function it appears in.)
src/Core/Debug/OODebugMonitor.m: In function '-[OODebugMonitor dumpMemoryStatistics]':
src/Core/Debug/OODebugMonitor.m:608: warning: implicit declaration of function 'JS_GetGCParameter'
src/Core/Debug/OODebugMonitor.m:608: error: 'JSGC_BYTES' undeclared (first use in this function)
src/Core/Debug/OODebugMonitor.m:610: error: 'JSGC_NUMBER' undeclared (first use in this function)
src/Core/Debug/OODebugMonitor.m: In function '-[OODebugMonitor(Private) oo:jsValueInContext:]':
src/Core/Debug/OODebugMonitor.m:912: warning: implicit declaration of function 'JS_AddNamedObjectRoot'
gmake[3]: *** [obj.spk.dbg/oolite.obj/OODebugMonitor.m.o] Error 1
gmake[2]: *** [internal-objc_program-all_] Error 2
gmake[1]: *** [oolite.all.objc-program.variables] Error 2
gmake: *** [internal-all] Error 2
However using this command it doesn't seem to include the javascript path. Which is different to gmake -f Makefile debug=yes messages=yes
It looks like your build settings are correct: Native Obj-C exceptions are set, JS call tracing is on, JS paths seem to be included correctly. So, I think that what happens is that you have already built a Spidermonkey library with non-debug settings and are trying to build Oolite in debug. JSID_VOID in debug builds is defined in a completely different way compared to the same in release builds of JS. I would recommend attempting a make of Oolite with debug=no. I remember when I built the new JS for Windows the first time I had a similar problem, but in reverse: I was building Oolite with debug=no, but I had a debug version of the JS library and I was getting similar issues. I think make debug=no is worth a try.
I would recommend attempting a make of Oolite with debug=no
I have tried this both ways, on both machines. I have also tried it with release as well as checking out the whole trunk again from scratch. I'm pretty sure this is not the problem.
Does deps/Cross-platform-deps/mozilla/js/src/build-debug/dist/include/jsapi.h contain the following (at or about line 464)?
Yes! We have success. Splendid work chaps, thanks for your help. Despite not being in my environment gcc is using the the system spiermonkey headers instead of the bundled static ones.
It’s quite likely that a SpiderMonkey package was brought in as a dependency of FireFox (or some other Mozilla app) at some point. Historically, SpiderMonkey/libmozjs has been a relatively stable package. This is no longer the case; the API is changing rapidly and Mozilla’s started a new high version churn release policy, so having an unversioned libmozjs as a system package is no longer appropriate, but it’ll probably take a while for distros to catch up to the new reality.
Indeed and I don't disagree, however in this instance the problem looks like it's being caused by Oolite's GNUmakefile. Particularly the order in which GCC is parsing the compiler environment flags, it seems that the specified LIBJS flags are being overwritten by nspr.
I have tweaked the following lines in the GNUmakefile and it's sorts the issue.