[libdispatch-dev] [PATCH 2/4] check whether to add -lm for testing to compile

Mario Schwalbe schwalbe at inf.tu-dresden.de
Wed Nov 18 07:50:27 PST 2009


Hi,

Robert Watson schrieb:
> On Wed, 18 Nov 2009, Mario Schwalbe wrote:
>> Robert Watson schrieb:
>>> On Wed, 18 Nov 2009, Mario Schwalbe wrote:
>>>> Linux needs -lm in order to compile the testing directory due to
>>>> fabs().
>>> Could you confirm that this doesn't create an unnecessary libm
>>> dependency for libdispatch itself?
>> No, it does create a superfluous dependency.
> Another possibility, since libm isn't required on FreeBSD or Mac OS X
> for fabs(), would be to use AC_CHECK_FUNC() to see if it's available
> without special linkage.  If it isn't, then as custom action, use
> AC_SEARCH_LIBS(), itself with a custom action that adds -lm only to
> FABS_LIBS, which can be used just with the binary that requires it.

I thought this is what LT_LIB_M does already, as it adds -lm or -lmw to
LIBM on systems that require it. This variable in turn can be used just
with the binary that requires it. What's the difference?

> This avoids picking up libm dependencies on the testing binaries as
> well; 

How? It's still a separate variable that must be used somewhere to have
any effect.

> if we hit any interesting platforms that don't implement fabs() at
> all (are there any?) then we could also use it to trigger conditional
> building of the test.

That's very unlikely, isn't it?




More information about the libdispatch-dev mailing list