[RFC] Libraries usage in configure.in and Makefiles

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 11 Nov 2009 18:38:48 +1300

Over that last few months the configure alterations I've been doing has
introduced a slightly altered way of system library linkage.

Henriks recent commit to remove one of these on grounds of being "old"
has highlighted a need to document this and perhapse bring you all in on
making the changes.

Why?
A: The squid binary is topping 3.5MB in footprint with many of the small
tool stopping 500KB each. A small but substantial amount of it is
libraries inked but unused. Particularly in the helpers.
As I've pointed out before the main vector for this is @XTRA_LIBS@.
Though component BLAH_LIBS lists are also doing it to a lesser degree.

To get around that the new style has been to do:
configure.in:
   AC_CHECK_LIB(xx, foo, [XXLIB="-lxx"])
   ...
   AC_SUBST(XXLIB)

*/Makefile.am:
   foo_LDADD= @XXLIB@

With some of the libraries being bunched up when there is a strong link
between, ie "-lresolv -lnsl" in @RESOLVLIB@

Does anyone disagree?

Does anyone have other examples of libraries which _need_ to include
other libraries like -lresolv/-lnsl do for Solaris?

I'm not terribly fussed with Henriks change because the DISK IO stuff is
heavily interlinked. It's "only" an extra build dependency for every
test run. But it grates against my ideologies to see the AIO specific
API testers needing to link against the pthreads libraries and vice-versa.

Amos
Received on Wed Nov 11 2009 - 05:39:17 MST

This archive was generated by hypermail 2.2.0 : Wed Nov 11 2009 - 12:00:05 MST