summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorAbdoulaye Walsimou GAYE <awg@embtoolkit.org>2017-08-13 15:05:58 +0200
committerAbdoulaye Walsimou GAYE <awg@embtoolkit.org>2017-08-13 15:05:58 +0200
commit2538c4a9d120785ae2b44bc1938e490f257e589b (patch)
tree061c3494323a5ea69e80c5a92406aa94242c6be7 /packages
parent07d033070e24a61bfdb2b145f5af6d4d66ea7c08 (diff)
downloadembtoolkit-2538c4a9d120785ae2b44bc1938e490f257e589b.tar.gz
embtoolkit-2538c4a9d120785ae2b44bc1938e490f257e589b.tar.bz2
embtoolkit-2538c4a9d120785ae2b44bc1938e490f257e589b.tar.xz
Packages: libpcap: give ability to explicitly enable libnl
Signed-off-by: Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/net/libpcap/libpcap.kconfig11
-rw-r--r--packages/net/libpcap/libpcap.mk18
2 files changed, 27 insertions, 2 deletions
diff --git a/packages/net/libpcap/libpcap.kconfig b/packages/net/libpcap/libpcap.kconfig
index 2f0eb48..2c5c9eb 100644
--- a/packages/net/libpcap/libpcap.kconfig
+++ b/packages/net/libpcap/libpcap.kconfig
@@ -1,6 +1,6 @@
################################################################################
# Embtoolkit
-# Copyright(C) 2012 Abdoulaye Walsimou GAYE.
+# Copyright(C) 2012-2017 Abdoulaye Walsimou GAYE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,9 +41,16 @@ choice
bool "libpcap-1.8.1"
endchoice
+config EMBTK_LIBPCAP_HAVE_LIBNL
+ bool "Use libnl"
+ depends on EMBTK_HAVE_LIBPCAP
+ select EMBTK_HAVE_LIBNL
+ help
+ Say yes here if you want libpcap to use libnl as netlink API.
+
config EMBTK_LIBPCAP_VERSION_STRING
string
- default "1.8.1" if EMBTK_LIBPCAP_VERSION_1_8_1
+ default "1.8.1" if EMBTK_LIBPCAP_VERSION_1_8_1
config EMBTK_LIBPCAP_NEED_PATCH
bool
diff --git a/packages/net/libpcap/libpcap.mk b/packages/net/libpcap/libpcap.mk
index 3405447..0ef6bd0 100644
--- a/packages/net/libpcap/libpcap.mk
+++ b/packages/net/libpcap/libpcap.mk
@@ -36,3 +36,21 @@ LIBPCAP_SHARES := $(foreach m,1 3 5 7,man/man${m}/pcap*)
LIBPCAP_INCLUDES := pcap*
LIBPCAP_CONFIGURE_OPTS := --with-pcap=linux
+LIBPCAP_CONFIGURE_OPTS += $(if $(CONFIG_EMBTK_LIBPCAP_HAVE_LIBNL),--with-libnl,--without-libnl)
+
+LIBPCAP_DEPS-y :=
+LIBPCAP_DEPS-$(CONFIG_EMBTK_LIBPCAP_HAVE_LIBNL) += libnl_install
+
+#
+# Fixup wrong libnl headers in configure script
+#
+pembtk_libpcap_configure := $(call embtk_pkg_srcdir,libpcap)/configure
+pembtk_libpcap_incdir_nl := incdir=-I/usr/include/libnl3
+pembtk_libpcap_xincdir_nl := incdir=-I$(embtk_sysroot)/usr/include/libnl3
+define embtk_beforeinstall_libpcap
+ sed -e 's;$(pembtk_libpcap_incdir_nl);$(pembtk_libpcap_xincdir_nl);' \
+ -e 's;incdir=-I$${withval}/include;$(pembtk_libpcap_xincdir_nl);' \
+ < $(pembtk_libpcap_configure) > $(pembtk_libpcap_configure).tmp
+ cp $(pembtk_libpcap_configure).tmp $(pembtk_libpcap_configure)
+ chmod +x $(pembtk_libpcap_configure)
+endef