Here's the best solution we've found, for posterity:
It seems there's no very neat way to get this to work. The nicest I've found is to avoid -L
and -l
flags when "internally" linking like this, and instead to directly put $(builddir)/extralib/libmy-secret-lib.a
in the LDFLAGS/LIBADD variable for the final shared lib.
This unfortunately produces a libtool warning about non-portability and the need to build the "hand-made convenience lib" with -fPIC
-- even it has been built that way and is fully portable. ...LIBTOOLFLAGS = --silent
isn't enough to hide that cry-wolf warning, sadly, but the result is good: required symbols copied into the final library, dependency_libs
unsullied, and no hacks (like this: https://gitorious.org/libguestfs/libguestfs/source/c46bedf925cd9c6c9a9cbaee115358fd1dffcbfe:libtool-kill-dependency_libs.sh) required.