New library linking in Linux

It seems like Linux is changing its build policies and forcing us to be more explicit in our linkage. This does not seem to have affected any of the current stable releases of the main Linux distros, but apparently, the next versions of the big ones are going to start enforcing this. This includes  Ubuntu 11.04, Debian 7, and the next releases of Fedora. Others too, probably, if I went and looked.

In the end, I think this is probably a good thing since it forces us to be more explicit about what we link against.

I am currently going through and figuring out the various places that require this fix and trying to think if there is an elegent way to handle this in our build structure. But honestly, and this might just be in light of it being late, I think we just need to make sure that when we create a target program to build, we make sure to iinclude the necessary libraries in LDADD.

For instance, in Gruel we build the program test_gruel, so we set it up as:

   noinst_PROGRAMS = test_gruel

   test_gruel_LDADD = pmt/libpmt-qa.lib libgruel.la

Now, the trick was that libgruel already knew their linkage to the necessary libraries, so we didn't pass these on to test_gruel. Under the new way, we have to specify all of the libraries, and so the LDADD line looks like:

    test_gruel_LDADD = $(BOOST_THREAD_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) pmt/libpmt-qa.lib libgruel.la

Which allows it to build against these specific Boost libraries (the variables having been set during the configuration process).

This is an overly simplistic explination of what's really happening, but it's the basics of how it is affectig GNU Radio. Here's some more info on the change: http://wiki.debian.org/ToolChain/DSOLinking