From patchwork Sat Dec 23 19:06:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Mukhin X-Patchwork-Id: 852685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MF/dYv+8"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z3vxr0Jwtz9sBZ for ; Sun, 24 Dec 2017 06:06:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A19FC814A3; Sat, 23 Dec 2017 19:06:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xckU1KK44zPo; Sat, 23 Dec 2017 19:06:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7AED581153; Sat, 23 Dec 2017 19:06:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 51EBE1C098D for ; Sat, 23 Dec 2017 19:06:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4C730893E1 for ; Sat, 23 Dec 2017 19:06:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ikQhNHYlULmx for ; Sat, 23 Dec 2017 19:06:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id E990D893CC for ; Sat, 23 Dec 2017 19:06:44 +0000 (UTC) Received: by mail-lf0-f65.google.com with SMTP id f13so34632108lff.12 for ; Sat, 23 Dec 2017 11:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pWAQsHGIpSz1Kb3OVvogUeuEz5hTKfgSlT44PYb2FQU=; b=MF/dYv+8GAE6n1I6iXIIB8g2k1M7XtnblQG3sBhpONUFsy9An7Y2HHPltFZEAqoHqm 7lyAFaTx+wq2lRVaVHqmt2E8raEKhYrD8ZWMK1uazotxnv3HZQgMqX/gzWnLTRPa0Uv2 yHtgPNtciWNXhnWQ6Gfv/aWxwnd5Y/pXqKUt0BvUmaWv1Lw3TLQ5f7AFrmwpfmdr2QP2 A3XfNHHA82PqDxDUTj1BZijI8pooLFP0XaEj7OKUdTUBX/8syTPYG9LkSijbHj+osG4m Z3PvzVpO05LcSNngkpL/yw0+pXBcrjKp7nTEY/MhEZjzNliCaugyIUG+hiXJePeddACf rLRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pWAQsHGIpSz1Kb3OVvogUeuEz5hTKfgSlT44PYb2FQU=; b=Q6LKle/8+3rDJ/bKX7IbnbHteL5PgMWl3oU3r77ulz6gQF3xfdhwbMgELg5YurePvO Yhg+L+BkXHOwtlZW7iLomDTnIv6R8GvqNCkTW6+Lr/EkFSDXs9udkFQ0RBV5QVmc3CcT 3tlcnBCNI2P4XLhI5KLdWV3uoAbcTh0gHWsDTWhR/Qv21ImVYerkopSBd/GPt2qZofG/ 73WXduTz8swmOX8hTNjyN+ri/eI+Wot9qhwCupuX3QzyX5P7o0pt21fIy0qyAfSzUs2J OpfFFyuZCmn2U4zC4uIsCsP7TghTcaq+7jGvd91kUVclRqLlByoWS4vUemE+UnX2f2at 34tw== X-Gm-Message-State: AKGB3mLbZol6yPgRU7Qmu93TtekPSP7sbjG/TNF2O9XrcSTpzTLM3c8f 7iJOEs+RVj5GBTJiSpPlfjzj2A== X-Google-Smtp-Source: ACJfBouTiE0/wdc7MGn1vf9UOONNQW39wKeJeafDZ+7HgUuusQHsrLn119gA+QA0soKDENPl0s88yA== X-Received: by 10.46.92.135 with SMTP id q129mr2322393ljb.88.1514056003050; Sat, 23 Dec 2017 11:06:43 -0800 (PST) Received: from localhost.localdomain ([2a00:1838:30:a00:626d:c7ff:fecc:a711]) by smtp.gmail.com with ESMTPSA id g12sm229038lfd.32.2017.12.23.11.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2017 11:06:42 -0800 (PST) From: Alexander Mukhin To: buildroot@busybox.net Date: Sat, 23 Dec 2017 22:06:17 +0300 Message-Id: <20171223190617.3981-5-alexander.i.mukhin@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171223190617.3981-1-alexander.i.mukhin@gmail.com> References: <20171223190617.3981-1-alexander.i.mukhin@gmail.com> Subject: [Buildroot] [PATCH 4/4] hostapd: drop default netlink dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Mukhin MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Get rid of netlink and threads dependency if the options selected allow so. Signed-off-by: Alexander Mukhin --- package/hostapd/Config.in | 16 ++++++++++------ package/hostapd/hostapd.mk | 29 +++++++++++++++++++---------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in index 57cec469c6..115563f564 100644 --- a/package/hostapd/Config.in +++ b/package/hostapd/Config.in @@ -1,8 +1,6 @@ config BR2_PACKAGE_HOSTAPD bool "hostapd" - depends on BR2_TOOLCHAIN_HAS_THREADS # libnl depends on BR2_USE_MMU # fork() - select BR2_PACKAGE_LIBNL help User space daemon for wireless access points. @@ -23,9 +21,14 @@ config BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP config BR2_PACKAGE_HOSTAPD_DRIVER_NL80211 bool "Enable nl80211 driver" default y + depends on BR2_TOOLCHAIN_HAS_THREADS # libnl + select BR2_PACKAGE_LIBNL help Enable support for drivers using the nl80211 kernel interface. +comment "nl80211 driver needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS + config BR2_PACKAGE_HOSTAPD_DRIVER_RTW bool "Enable rtl871xdrv driver" help @@ -83,12 +86,13 @@ config BR2_PACKAGE_HOSTAPD_VLAN_NETLINK bool "Use netlink-based API for VLAN operations" default y depends on BR2_PACKAGE_HOSTAPD_VLAN + depends on BR2_TOOLCHAIN_HAS_THREADS # libnl + select BR2_PACKAGE_LIBNL help Use netlink-based kernel API for VLAN operations instead of ioctl(). -endif - -comment "hostapd needs a toolchain w/ threads" +comment "netlink-based VLAN support needs a toolchain w/ threads" depends on !BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_USE_MMU + +endif diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk index 143efe9627..9b73c596f8 100644 --- a/package/hostapd/hostapd.mk +++ b/package/hostapd/hostapd.mk @@ -11,8 +11,8 @@ HOSTAPD_PATCH = \ http://w1.fi/security/2017-1/rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch HOSTAPD_SUBDIR = hostapd HOSTAPD_CONFIG = $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/.config -HOSTAPD_DEPENDENCIES = host-pkgconf libnl -HOSTAPD_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/ +HOSTAPD_DEPENDENCIES = host-pkgconf +HOSTAPD_CFLAGS = $(TARGET_CFLAGS) HOSTAPD_LICENSE = BSD-3-Clause HOSTAPD_LICENSE_FILES = README HOSTAPD_CONFIG_SET = @@ -23,17 +23,11 @@ HOSTAPD_CONFIG_ENABLE = \ CONFIG_IEEE80211N \ CONFIG_IEEE80211R \ CONFIG_INTERNAL_LIBTOMMATH \ - CONFIG_INTERWORKING \ - CONFIG_LIBNL32 + CONFIG_INTERWORKING HOSTAPD_CONFIG_DISABLE = -# libnl-3 needs -lm (for rint) and -lpthread if linking statically -# And library order matters hence stick -lnl-3 first since it's appended -# in the hostapd Makefiles as in LIBS+=-lnl-3 ... thus failing -ifeq ($(BR2_STATIC_LIBS),y) -HOSTAPD_LIBS += -lnl-3 -lm -lpthread -endif +HOSTAPD_USE_NL = # Try to use openssl if it's already available ifeq ($(BR2_PACKAGE_LIBOPENSSL),y) @@ -51,6 +45,8 @@ endif ifneq ($(BR2_PACKAGE_HOSTAPD_DRIVER_NL80211),y) HOSTAPD_CONFIG_DISABLE += CONFIG_DRIVER_NL80211 +else +HOSTAPD_USE_NL = y endif ifeq ($(BR2_PACKAGE_HOSTAPD_DRIVER_RTW),y) @@ -89,9 +85,22 @@ HOSTAPD_CONFIG_ENABLE += CONFIG_FULL_DYNAMIC_VLAN endif ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y) +HOSTAPD_USE_NL = y HOSTAPD_CONFIG_ENABLE += CONFIG_VLAN_NETLINK endif +ifeq ($(HOSTAPD_USE_NL),y) +HOSTAPD_DEPENDENCIES += libnl +HOSTAPD_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl3/ +HOSTAPD_CONFIG_ENABLE += CONFIG_LIBNL32 +# libnl-3 needs -lm (for rint) and -lpthread if linking statically +# And library order matters hence stick -lnl-3 first since it's appended +# in the hostapd Makefiles as in LIBS+=-lnl-3 ... thus failing +ifeq ($(BR2_STATIC_LIBS),y) +HOSTAPD_LIBS += -lnl-3 -lm -lpthread +endif +endif + define HOSTAPD_CONFIGURE_CMDS cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG) sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(HOSTAPD_CONFIG_ENABLE)) \