On Tue, Aug 19, 2008 at 8:02 AM, Nick <tonestone57@xxxxxxxxxxx> wrote: >> I think it's fixed now. Have a look at the patch and perhaps try it >> out on a non-haiku system and see if it correctly detects needing -lm >> on that system. If it does let me know, this might be worth sending >> back upstream. >> http://ports.haiku-files.org/wiki/app-editors/joe/3.5/1 >> It's nice to have joe working on haiku, now i won't have to fight with >> vim to do a check in ;) >> -scottmc > > I looked at the diff. From what I can tell, you remove -lm from the LIBS if > not present. Which I believe is incorrect way to do it but I would like > another dev to say if I am wrong or right. I copied that code from some other program's config/makefile script. Basically it does a test of your build system to see if it needs to have -lm and if it needs it, it then uses it in the makefile, if it doesn't then it leaves it out, thus fixing it for both cases. > > What I was trying to get at was: > IF Haiku ( or BeOS or Zeta ) & program links to libm > change -lm to -lroot // because there is no libm in Haiku/BeOS - part of > libroot > else ( for Linux ) > leave it as -lm > > Actually, the easiest & quickest way is to symlink libm->libroot so no code > changes would be needed at all but some devs do not like hacks :- ) > > I believe devs link to libm in their programs for a reason ( else, why put > in -lm if not needed?? ) and removing the linking to libm is not the right > way to do it. Could cause issues. That we should link to libroot instead > when a program wants libm. > > Can someone clear this up because maybe I am confused? If a POSIX program > is looking for libm should we: > a) just remove -lm ( not link to libm ) or > b) change -lm to -lroot ( to link to libroot instead of libm ) > > From what I can tell, Scott is doing a) and I believe it should be b). If > a), then can someone also explain why a program would use -lm if it is not > needed. > > > Regards, > > ________________________________ There's also places where I've seen configure scripts check for -lsocket, but BeOS needs -lnet, and Haiku needs -lnetwork. Here's one such case: http://ports.haiku-files.org/browser/haikuports/trunk/media-libs/libcddb/libcddb-1.3.0-haiku.diff?rev=124 -scottmc