public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] alfred-gpsd: add -lm to linker flags for libgps
@ 2013-10-22 23:27 Simon Wunderlich
  2013-10-22 23:53 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Wunderlich @ 2013-10-22 23:27 UTC (permalink / raw)
  To: b.a.t.m.a.n

Appearently applications using libgps must link -lm themselves. A patch
was submitted [1] to change this unusual behaviour upstream, but was
never applied. Therefore link to -lm to alfred-gpsd too as this should
not hurt anyway.

[1] https://lists.berlios.de/pipermail/gpsd-dev/2011-August/009451.html

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 gpsd/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gpsd/Makefile b/gpsd/Makefile
index 9b21652..92e690f 100644
--- a/gpsd/Makefile
+++ b/gpsd/Makefile
@@ -49,7 +49,7 @@ ifeq ($(origin LIBGPS_CFLAGS) $(origin LIBGPS_LDLIBS), undefined undefined)
     $(error No $(LIBGPS_NAME) development libraries found!)
   endif
   LIBGPS_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBGPS_NAME))
-  LIBGPS_LDLIBS +=  $(shell $(PKG_CONFIG) --libs $(LIBGPS_NAME))
+  LIBGPS_LDLIBS +=  $(shell $(PKG_CONFIG) --libs $(LIBGPS_NAME)) -lm
 endif
 CFLAGS += $(LIBGPS_CFLAGS)
 LDLIBS += $(LIBGPS_LDLIBS)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] alfred-gpsd: add -lm to linker flags for libgps
  2013-10-22 23:27 [B.A.T.M.A.N.] [PATCH] alfred-gpsd: add -lm to linker flags for libgps Simon Wunderlich
@ 2013-10-22 23:53 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2013-10-22 23:53 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Wed, Oct 23, 2013 at 01:27:43AM +0200, Simon Wunderlich wrote:
> Appearently applications using libgps must link -lm themselves. A patch
> was submitted [1] to change this unusual behaviour upstream, but was
> never applied. Therefore link to -lm to alfred-gpsd too as this should
> not hurt anyway.

Hi Simon

What the gpsd sources i have says is:

     On some systems (those which do not support implicit linking in
     libraries) you may need to add -lm to your link line when you
     link libgps.  It is always safe to do this.

So i guess my Debian system does have implicit linking, and ldd on the
library does include libm. Hence it worked for me.

However, as you said, it does not harm, so:

Acked-by: Andrew Lunn <andrew@lunn.ch>

	  Andrew

> 
> [1] https://lists.berlios.de/pipermail/gpsd-dev/2011-August/009451.html
> 
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>  gpsd/Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gpsd/Makefile b/gpsd/Makefile
> index 9b21652..92e690f 100644
> --- a/gpsd/Makefile
> +++ b/gpsd/Makefile
> @@ -49,7 +49,7 @@ ifeq ($(origin LIBGPS_CFLAGS) $(origin LIBGPS_LDLIBS), undefined undefined)
>      $(error No $(LIBGPS_NAME) development libraries found!)
>    endif
>    LIBGPS_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBGPS_NAME))
> -  LIBGPS_LDLIBS +=  $(shell $(PKG_CONFIG) --libs $(LIBGPS_NAME))
> +  LIBGPS_LDLIBS +=  $(shell $(PKG_CONFIG) --libs $(LIBGPS_NAME)) -lm
>  endif
>  CFLAGS += $(LIBGPS_CFLAGS)
>  LDLIBS += $(LIBGPS_LDLIBS)
> -- 
> 1.7.10.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-22 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-22 23:27 [B.A.T.M.A.N.] [PATCH] alfred-gpsd: add -lm to linker flags for libgps Simon Wunderlich
2013-10-22 23:53 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox