Heh, yes, that’s about it. libtool manages to defy intuition at about every turn, but at least the outcome here is reasonable (I hope!).
By default for every lib it wants to build a shared and static version, and because of the differing export semantics it wants to compile one set of objects to go into the shared library, and another set for the static library.
Adding -static
in LDFLAGS tells it to disable any linking, but it’ll still build the “shared” objects as well.
Adding -static
in CXXFLAGS tells it that there will be nothing to link in the end, so there’s no point in building the “shared” objects.
As for argument parsing, yes, it’s really nasty. libtool gobbles up parameters passed to the compiler/linker and attempts to substitute the correct actions. It gets hairy when there’s ambiguity with keywords (like “-static”).
It’s a dinosaur :(