This fixes a real bug with autotools , where our tests in
libnm/tests would dynamically link against libnm.so, but also statically link with
libnm-core.la. That is wrong, because it will for example invoke the construct function
Note that the libnm tests need access to internal functionality of libnm, hence they need to statically link against libnm-core. The correct solution is that they only statically link, and don't also dynamically link
The rest of the branch tries to cleanup building our static libraries.
We build a lot of intermediate (static) libraries, that we later combine.
With meson, this all works nicely.
With autotools, when you link
- (libA -> libB) && ((libA + libB) -> libC)
- (libA -> libB) && (libA -> libC) && ((libB + libC) -> libD)
you get duplicate symbols from libA.
As we have a large number of static libraries, it's not obvious how they are combined, to avoid duplicate.
As a rule, avoid linking static libraries with other static libraries. That means, we will only combine static libraries in the last step, and it becomes quite clear where the symbol must come from. For convenience, there are still exceptions to this rule:
libnm/liblibnm.la are internal static libraries, that act as a combination of other static libraries.