[beports] Re: missing -lm?

  • From: "scott mc" <scottmc2@xxxxxxxxx>
  • To: beports@xxxxxxxxxxxxx
  • Date: Mon, 28 Apr 2008 16:07:05 -0700

Here's a good tip on -lm in case you run into that on any port
attempts.  One of the ones I am working on had this and I was able to
just remove it, but then an unrelated problem.



---------- Forwarded message ----------
From: François Revol <revol@xxxxxxx>
Date: Mon, Apr 28, 2008 at 2:57 PM
Subject: [haiku-development] Re: missing -lm?
To: haiku-development@xxxxxxxxxxxxx



> One of the things I've seen come up more than once now in attempting
 > ports is that they bomb out for a missing -lm.
 > It's my understanding the this refers to libm which is a math
 > library.
 >  Is this included in one of Haiku's libraries?
 > And is the workaround to include a Haiku library rather than -lm, and
 > if so which one is it?

 In Haiku (and BeOS), glibc and libm are both included in libroot and
 linked to by default.
 It is really wrong to assume library existence, be it libm.
 But since we are the only Unixish OS around that doesn't have it, linux
 freeks often think they can hardcode it.
 The correct fix is to check for it at configure or compile time.
 Remove the -lm from the makefiles, and you can usually add something
 like:
 AC_CHECK_LIB(m,sqrtf)
 to the configure.ac or .in.
 Sometimes you must add it to a custom FOOLIBS variable instead of LIBS,
 but most of the time it should just work this way.

 There is no reason we should add a hack to work around buggy software.
 AFAIK libm is not mandated by any standard.

 François.

--
BePorts homepage - http://tools.assembla.com/BePorts
List archives: //www.freelists.org/archives/beports
Administrative contact: brecht@xxxxxxxxxxx

Other related posts: