Hi everybody,
I am currently writing ebuilds (Gentoo Linux) for the live version of CrystalSpace (aka 1.9 from SVN), CEL and CrystalCore as the current stable version of CS does not work on my dev laptop. (I have described the problem
here in the forums, but no solution could be found.)
Everything is working so far. After patching plugins/cscript/csjava/Jamfile even Java-Support compiles fine.
But when Jam reaches the target "xwin.so", it fails, or better the linker fails, because "-l/usr/local/lib" can not be found. I have found out how it comes to this stage, but I am no Jam-expert and simply can't fix this on my own.
When I build the target with -d9, the log shows the following: (Only a small snippet from a 743M log! I have commented the log output as I understand it. And I had to remove some lines and replace the long argument line with <FLAGS LIKE ABOVE> or the message would be too long for the forums.)
>>>>|>>>>|>> LFlags xwin : `CFLAGS="-march=core2 -O2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -O2 -pipe -mtune=core2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -I/usr/local/include -DNVALGRIND -O3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -lc -lm -ldl -lnsl -L/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0` : noexternal
expand 'target'
list > xwin <
>>>>|>>>>|>>>> local target = xwin
list > xwin <
set target = xwin
expand 'flags'
expand 'InferFlagTuples'
expand '$(2)'
list > `<FLAGS LIKE ABOVE>` <
Now these are normal flags that show up on most targets
>>>>|>>>>|>>>> InferFlagTuples `<FLAGS LIKE ABOVE>`
This function from mk/jam/flags.jam is called on all CFLAGS and LFLAGS. And normally everything is well.
expand 'tuples'
>>>>|>>>>|>>>>|> local tuples =
set tuples =
expand 'accum'
>>>>|>>>>|>>>>|> local accum =
set accum =
expand 'flag'
>>>>|>>>>|>>>>|> local flag =
set flag =
expand '$(1)'
list > `<FLAGS LIKE ABOVE>`
<list > `<FLAGS LIKE ABOVE>`
<set flag = `<FLAGS LIKE ABOVE>`
expand 'Match'
expand 'Match'
expand '^([-/`][A-Za-z0-9])'
expand '$(flag)'
expand 'flag'
get flag = `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
expanded to `<FLAGS LIKE ABOVE>`
>>>>|>>>>|>>>>|> Match ^([-/`][A-Za-z0-9]) : `<FLAGS LIKE ABOVE>`
>>>>|>>>>|>>>>|> if `C (1)
expand '$(accum)'
expand 'accum'
get accum =
expanded to
>>>>|>>>>|>>>>|> if (0)
expand 'accum'
expand '$(flag)'
expand 'flag'
get flag = `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
expanded to `<FLAGS LIKE ABOVE>`
>>>>|>>>>|>>>>|> set accum += `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
set accum = `<FLAGS LIKE ABOVE>`
expand '$(accum)'
expand 'accum'
list > accum <
get accum = `<FLAGS LIKE ABOVE>`
list > `<FLAGS LIKE ABOVE>` <
expanded to `<FLAGS LIKE ABOVE>`
The Match works, appearantly, because accum is set to the argument. (It is no tuple)
>>>>|>>>>|>>>>|> if `<FLAGS LIKE ABOVE>` (1)
expand 'tuples'
list > tuples <
expand '$(accum:J= )'
expand 'accum^AJ= '
list > accum^AJ= <
Now it gets weird. While "get" shows the flags from above, "list" is already lowercase:
get accum = `CFLAGS="-march=core2 -O2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -O2 -pipe -mtune=core2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -I/usr/local/include -DNVALGRIND -O3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -lc -lm -ldl -lnsl -L/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`
list > `cflags="-march=core2 -o2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -o2 -pipe -mtune=core2 -wall -wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -i/usr/local/include -dnvalgrind -o3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -lc -lm -ldl -lnsl -l/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0` <
newstr: allocating 1124 bytes
expanded to `cflags="-march=core2 -o2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -o2 -pipe -mtune=core2 -wall -wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -i/usr/local/include -dnvalgrind -o3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -lc -lm -ldl -lnsl -l/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`
>>>>|>>>>|>>>>|> set tuples += `<LOWERCASE FLAGS>`
list > `<LOWERCASE FLAGS>` <
set tuples = `<LOWERCASE FLAGS>`
Now this is the result from the line
tuples += $(accum:J=" ") ;
and I do not understand why everything is lowercase now. But the next log entry after the function returned confirms, that everything is transformed to lowercase:
>>>>|>>>>|>>>> local flags = `cflags="-march=core2 -o2 -pipe -mtune=core2 -pipe -ffunction-sections -fdata-sections -march=core2 -o2 -pipe -mtune=core2 -wall -wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -i/usr/local/include -dnvalgrind -o3 -fomit-frame-pointer -ffast-math -g2" /bin/sh ./bin/relaytool --out-dir ./out/linux/optimize/plugins/video/canvas/xwindow --minimal-list " ./out/linux/optimize/plugins/video/canvas/xwindow/xwindow.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_xaw/makeform.o ./out/linux/optimize/plugins/video/canvas/xwindow/xalert_gtk/gtk_alert.o ./out/linux/optimize/plugins/video/canvas/xwindow/plugin_impl.o" --relay gtk-x11-2.0 --relay gobject-2.0 -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -wl,-o1 -wl,--as-needed -wl,--sort-common -wl,--hash-style=gnu -lc -lm -ldl -lnsl -l/usr/local/lib -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0`
This, of course, can not work. All those options are case-sensitive. The options are, the log shows it, built correctly. And then they get transformed to lowercase. Why? And how can this be fixed?
Thanks in advance, and don't hesitate if you want to know anything else. I am using ftjam-2.5.3_rc2 with bison-2.4.2
Yama
P.S.:
The mentioned patch:
--- plugins/cscript/csjava/Jamfile.old 2011-01-25 11:03:51.000000000 +0100
+++ plugins/cscript/csjava/Jamfile 2011-01-25 11:04:12.000000000 +0100
@@ -70,7 +70,7 @@
Swig $(common) :
[ DoSourceGrist cspace.i ] :
java :
- -c++ -java -package org.crystalspace3d :
+ -c++ -package org.crystalspace3d :
[ ConcatDirs $(TOP) include ]
[ ConcatDirs $(BUILDTOP) include ] :
[ ConcatDirs $(TOP) include bindings ] :
"-java" is already added automatically by the target, and adding a second "-java" to the options makes swig fail. (see
Gentoo Bug 335921, Comments 13 and 14 for details.)