[Mesa-dev] osmesa: static linking of talloc

Tormod Volden lists.tormod at gmail.com
Sun Oct 24 04:23:28 PDT 2010

Commit 5a3ac74 added $(TALLOC_LIBS) to the mklib call in
src/mesa/drivers/osmesa/Makefile and this breaks static builds on
Linux since ar barfs on "-ltalloc". I have been looking at different
ways of dealing with this without finding any elegant solution. We can
change configure.ac to set TALLOC_LIBS to libtalloc.a for static
builds, but ar needs the full path and something like this does not
look pretty in there:
TALLOC_LIBS="`$PKG_CONFIG --variable=libdir talloc`/libtalloc.a"

Alternatively, I have a mklib hack to translate -lfoo into libfoo.a
(searched for in different paths, also ugly) for static builds. I
wonder if libtool can do this in a clever way instead, but I don't
know libtool well enough.

Finally, maybe reverting 5a3ac74 is better. For shared libs,
TALLOC_LIBS is already added to OSLIB_MESA_DEPS in configure.ac. For
static builds, configure.ac explicitly says to not link libraries
"only link libraries with osmesa if shared". So this is in
contradiction to 5a3ac74 AFAICS. But I am probably missing something,
especially outside my own use case.


More information about the mesa-dev mailing list