package/netsniff-ng: allow to build with uclibc but w/o mausezahn
authorVadim Kochan <vadim4j@gmail.com>
Mon, 4 Mar 2019 08:57:41 +0000 (10:57 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 28 Mar 2019 17:46:56 +0000 (18:46 +0100)
mausezahn can't be build with uclibc because uclibc does not provide
ceill() function, so it does not allow to build all netsniff-ng's
tools with uclibc.

Fix it by moving mausezahn under separate config option, which has own
dependencies and packages selection (libnet & libcli).

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
[Thomas:
 - use the allbutmausezahn and install_allbutmausezahn targets inside
   of enumerating all the tools in the .mk file
 - stick to a "config" instead of introducing a "menuconfig"]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/netsniff-ng/Config.in
package/netsniff-ng/netsniff-ng.mk

index c4803b2fa26fd8fb1a9633ff1adac4f91db224f6..5d1407baacd4894d8dac7098926800d01fb39018 100644 (file)
@@ -1,16 +1,12 @@
 config BR2_PACKAGE_NETSNIFF_NG
        bool "netsniff-ng"
-       # Build with uClibc fails due to missing ceill()
-       depends on !BR2_TOOLCHAIN_USES_UCLIBC
        depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
        depends on BR2_TOOLCHAIN_HAS_THREADS
        depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
        select BR2_PACKAGE_LIBNL
        select BR2_PACKAGE_LIBPCAP
-       select BR2_PACKAGE_LIBCLI
        select BR2_PACKAGE_LIBNETFILTER_CONNTRACK
        select BR2_PACKAGE_LIBURCU
-       select BR2_PACKAGE_LIBNET
        help
          netsniff-ng is a free, performant Linux network analyzer and
          networking toolkit. If you will, the Swiss army knife for
@@ -18,7 +14,22 @@ config BR2_PACKAGE_NETSNIFF_NG
 
          http://netsniff-ng.org
 
-comment "netsniff-ng needs a glibc or musl toolchain w/ threads, headers >= 3.0"
+if BR2_PACKAGE_NETSNIFF_NG
+
+config BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN
+       bool "mausezahn"
+       default y
+       # Build with uClibc fails due to missing ceill()
+       depends on !BR2_TOOLCHAIN_USES_UCLIBC
+       select BR2_PACKAGE_LIBCLI
+       select BR2_PACKAGE_LIBNET
+
+comment "mausezahn needs glibc or musl toolchain"
+       depends on BR2_TOOLCHAIN_USES_UCLIBC
+
+endif
+
+comment "netsniff-ng needs a toolchain w/ threads, headers >= 3.0"
        depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
-       depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_UCLIBC \
-               || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+       depends on !BR2_TOOLCHAIN_HAS_THREADS  || \
+                       !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
index 77d89214257df1ef2968a4f9753cc0059e8ea5b6..8dd06b6fb720ec4eb623d8fd81f247522b42b940 100644 (file)
@@ -13,9 +13,16 @@ NETSNIFF_NG_LICENSE_FILES = README COPYING
 NETSNIFF_NG_CONF_ENV = \
        NACL_INC_DIR=/dev/null \
        NACL_LIB_DIR=/dev/null
-NETSNIFF_NG_DEPENDENCIES = \
-       libnl libpcap libcli libnetfilter_conntrack \
-       liburcu libnet
+NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+
+ifeq ($(BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN),y)
+NETSNIFF_NG_DEPENDENCIES += libcli libnet
+NETSNIFF_NG_BUILD_MAKE_TARGET = all
+NETSNIFF_NG_INSTALL_MAKE_TARGET = install
+else
+NETSNIFF_NG_BUILD_MAKE_TARGET = allbutmausezahn
+NETSNIFF_NG_INSTALL_MAKE_TARGET = install_allbutmausezahn
+endif
 
 ifeq ($(BR2_PACKAGE_GEOIP),y)
 NETSNIFF_NG_DEPENDENCIES += geoip
@@ -41,12 +48,14 @@ define NETSNIFF_NG_CONFIGURE_CMDS
 endef
 
 define NETSNIFF_NG_BUILD_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+       $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+               $(NETSNIFF_NG_BUILD_MAKE_TARGET)
 endef
 
 define NETSNIFF_NG_INSTALL_TARGET_CMDS
        $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
-               PREFIX=$(TARGET_DIR)/usr ETCDIR=$(TARGET_DIR)/etc install -C $(@D)
+               PREFIX=$(TARGET_DIR)/usr ETCDIR=$(TARGET_DIR)/etc install \
+                       -C $(@D) $(NETSNIFF_NG_INSTALL_MAKE_TARGET)
 endef
 
 $(eval $(generic-package))