summaryrefslogtreecommitdiff
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
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>
-rw-r--r--core/mk/pkg-macros/vars.mk2
-rw-r--r--packages/net/libpcap/libpcap.kconfig11
-rw-r--r--packages/net/libpcap/libpcap.mk18
3 files changed, 28 insertions, 3 deletions
diff --git a/core/mk/pkg-macros/vars.mk b/core/mk/pkg-macros/vars.mk
index 16731ac..871258e 100644
--- a/core/mk/pkg-macros/vars.mk
+++ b/core/mk/pkg-macros/vars.mk
@@ -139,7 +139,7 @@ __embtk_pkg_sysrootsuffix = $(strip $($(PKGV)_SYSROOT_SUFFIX))
__embtk_pkg_prefix = $(strip $($(PKGV)_PREFIX))
__embtk_pkg_destdir = $(strip $($(PKGV)_DESTDIR))
__embtk_pkg_nodestdir = $(strip $($(PKGV)_NODESTDIR))
-__embtk_pkg_deps = $(strip $($(PKGV)_DEPS))
+__embtk_pkg_deps = $(strip $($(PKGV)_DEPS) $($(PKGV)_DEPS-y))
__embtk_pkg_depspkgv = $(sort $(patsubst %_install,%,$(__embtk_pkg_deps)))
__embtk_pkg_kconfigsname = $(patsubst %_HOST,%,$(PKGV))
__embtk_pkg_kconfigs = $(sort $(filter CONFIG_EMBTK_$(__embtk_pkg_kconfigsname)_%,$(.VARIABLES)))
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