Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/knock: fix static build with libusb
@ 2014-06-22 17:04 Yann E. MORIN
  2014-06-22 17:08 ` Thomas Petazzoni
  2014-06-22 17:26 ` Baruch Siach
  0 siblings, 2 replies; 4+ messages in thread
From: Yann E. MORIN @ 2014-06-22 17:04 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

knock depends on libpcap, that has an optional dependency on libusb.
Alas, libpcap does not install a .pc file, so knock does not know
that it should link with -lusb-1.0.

When linking dynamically, this is not an issue, since the linker does
follow the DT_NEEDED tags of libpcap, and thus pulls libusb-1.0 in at
the same time. And since linusb uses threads, libpthread is pulled in
as well.

However, when linking statically, all of this fails.

Fix that by telling knock's ./configure what libraries to link with
when doing a static build and libusb is enabled.

Fixes:
    http://autobuild.buildroot.net/results/1eb/1eb877ebd9469c9261bf114fc7733819ae3fd562/

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/knock/knock.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/knock/knock.mk b/package/knock/knock.mk
index 8d2b41e..ace23fa 100644
--- a/package/knock/knock.mk
+++ b/package/knock/knock.mk
@@ -10,4 +10,8 @@ KNOCK_LICENSE = GPLv2+
 KNOCK_LICENSE_FILES = COPYING
 KNOCK_DEPENDENCIES = libpcap
 
+ifeq ($(BR2_PREFER_STATIC_LIB)$(BR2_PACKAGE_LIBUSB),yy)
+KNOCK_CONF_OPT = LIBS="-lusb-1.0 -pthread"
+endif
+
 $(eval $(autotools-package))
-- 
1.8.3.2

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

end of thread, other threads:[~2014-06-22 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-22 17:04 [Buildroot] [PATCH] package/knock: fix static build with libusb Yann E. MORIN
2014-06-22 17:08 ` Thomas Petazzoni
2014-06-22 17:29   ` Yann E. MORIN
2014-06-22 17:26 ` Baruch Siach

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