Makefile tweak for -lm?

Rob Landley rob at landley.net
Fri Dec 2 15:57:39 UTC 2005


On Friday 02 December 2005 02:19, Bernhard Fischer wrote:
> On Fri, Dec 02, 2005 at 12:58:21AM +0100, Aurelien Jacobs wrote:
> >On Thu, 1 Dec 2005 15:32:13 -0600
> >
> >Rob Landley <rob at landley.net> wrote:
> >> CONFIG_FEATURE_SORT_BIG needs libm, and right now it's not always
> >> automatically including it.  (I managed to get a build break from this.)
> >>
> >> I came up with the following makefile patch via cut and paste.  Would
> >> someone who knows makefiles tell me what I _should_ have done?
> >
> >Maybe this should go into Rules.mak and this should be :
>
> I'd set need-libm=y and look at $(need-libm) in Rules.mak.

Ok.  I suspect I should port the existing ones, then...

> >+ifeq ($(strip $(CONFIG_FEATURE_SORT_BIG)),y)
> >+  LIBRARIES += -lm
> >+endif
>
> This would lead to a fairly big block when it's done for all applets
> which need e.g. libm.

So far there are two makefiles that do this: miscutils (CONFIG_DC) and editors 
(CONFIG_FEATURE_AWK_MATH).

For me it's not the size, it's the locality.  I added a libm dependency 
without realizing I needed to tweak the makefile, and I'd like it so future 
such things are easier to spot.

We also have a similar situation with libcrypt.  In networking we have 
CONFIG_FEATURE_HTTPD_AUTH_MD5 (although the MD5 applet itself doesn't need 
this, and I haven't looked into what it's actually doing), and in loginutils 
we have CONFIG_LOGIN, CONFIG_PASSWD, CONFIG_SU, CONFIG_SULOGIN, and 
CONFIG_VLOCK.  (Possibly all that should be bouncing off some libbb library 
function.)

Hmmm...

Rob
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.



More information about the busybox mailing list