Hi Cyril.
I do not understand the code in deep but still feel this patch is questionable. It works but I'd expect a wrapper around XKeysymToString so no direct "-lX11" is needed in tests and demos utilities. Let this be a question for the maintainer :-)
This should be covered by the configure script. If you run configure, it looks for X11 devel headers and if found it enables build againts X11 libraries (and generally any libraries it should link with).
Now if there are no X11 libs detected the X11 backend should be compiled with stubs functions that only prints "X11 not compiled in" and aborts.
So generally whole library could be compiled without X11 (or any other library) but some demos may not run (these that opens a window and draws into it).
Check output from 'gfxprim-config --libs-backends' which should print linker flags for drawing backends (i.e. X11, SDL, Framebuffer) and is used to fill the LDLIBS_LOADERS make variable.
mvancura@prisera:~/gfxprim$ gfxprim-config --libs-backends -lGP_backends -lX11 -lXext
Moreover something seems fishy here as test for loaders are not linked agains backends at all. So this rather seems to be bug in the build system or something similar.
Could you send a log from verbose build, i.e. output from:
VERBOSE=1 make
BTW: This kind of questions would be better discussed on GFXprim mailing list (although I would be most likely the only one answering them there).
Moved to the mailing list. Both the patch in question and requested log are attached.
Details:
git commit 5381c2dcc328739b9d82e462da5e2135a8d23c2a (current HEAD of master)
machine is debian squeeze, libx11-6, libx11-data and libx11-dev installed
With the attached patch, I can build gfxprim succesfully and spiv also works then.
Milan Vancura
Hi!
gcc -pthread -W -Wall -Wextra -fPIC -O2 -ggdb -D_FORTIFY_SOURCE=2 -I../../include/ -L../../build/ -L. -Wl,--start-group test.o libtst.a -ltst_preload -lm -ldl -ltst -lrt -lGP -lrt -lm -lfreetype -lz -ldl -pthread -Wl,--end-group -o test ../../build//libGP.so: undefined reference to `XKeysymToString' ../../build//libGP.so: undefined reference to `XKeysymToKeycode' collect2: ld returned 1 exit status make[2]: *** [test] Error 1 make[2]: Leaving directory `/home/mvancura/gfxprim/tests/framework' make[1]: *** [framework] Error 2 make[1]: Leaving directory `/home/mvancura/gfxprim/tests' make: *** [tests] Error 2
This looks like leftover from build before commit:
backends,input: Move Input drivers to backends.
f7b1bfa7d24c44f3e03e6d3e8f20fe5d839964bd
Where X11 input parsing was part of the input library (which is compiled in libGP.so).
Look into the libs/input/ directory for GP_InputDriverX11.o and if its there remove it.
Here comes some background:
The build system only removes files it knows about in the 'make clean' so if some of the source files were moved or removed the object file may end up orphaned there and in case of libGP will end up in the .so library as well.
It's generally a good idea to look for orphaned files after 'make clean' with 'git clean'.
I will look at the build system and try to figure out how to make this case less confusing meanwhile.
This looks like leftover from build before commit: f7b1bfa7d24c44f3e03e6d3e8f20fe5d839964bd
Tested successfully. Good catch! So this issue transforms to a bug 'make distclean does not clean enough' :-)
Milan
Hi!
Tested successfully. Good catch! So this issue transforms to a bug 'make distclean does not clean enough' :-)
Fixed in 0de5472415c0c4e5031b1dfbd0bc3bdb995fb334.
Thanks for the report.