From patchwork Sat Dec 30 15:57:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Mukhin X-Patchwork-Id: 854128 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="u8qK2fGd"; 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 3z87Qw4Mmyz9sMN for ; Sun, 31 Dec 2017 02:58:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 717F684C03; Sat, 30 Dec 2017 15:58:14 +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 PN2OTnZye0QO; Sat, 30 Dec 2017 15:58:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7303484E8F; Sat, 30 Dec 2017 15:58:12 +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 D7FF81C0EC7 for ; Sat, 30 Dec 2017 15:58:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D3D9284F45 for ; Sat, 30 Dec 2017 15:58:07 +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 K4ApI+JlE1kN for ; Sat, 30 Dec 2017 15:58:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0B5B284930 for ; Sat, 30 Dec 2017 15:58:06 +0000 (UTC) Received: by mail-lf0-f68.google.com with SMTP id w196so32612998lff.5 for ; Sat, 30 Dec 2017 07:58:05 -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=IXxuPXssdxgsi1+pR/vCW93FFxpxnXZeTQ+wCDtphTs=; b=u8qK2fGdyMnF0UniAnGDs6VFvEDKBzCKf35kZJji1+ZVu5qg2dspby4TFixMGUfF/t 0E98amZ6ynzWC2FwzyhHSInysAqDuCNk3VXsHA2ymGx3xiiLWchno9MNp3Y727d7B6ZL fSraO/vqS8ESVMM8lWx43Gi0X7j1rjTNEA3WbRYdotKzANQaoBTprTv2b7PzTUk77Z9N u/Le24oaVAOzMCUhXliBI5HEOkQd5NzCiC2b7tZLrO/CTEVt/rCNfR1IUWWaAjlQPNiB B0c12ClBgFOPaNL9Bth46pY/eF09QH4qFsbslqV7lepbz6WknnjmFwjiI7jgeZ/B1dvm HemQ== 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=IXxuPXssdxgsi1+pR/vCW93FFxpxnXZeTQ+wCDtphTs=; b=icqp+TdzibiBBciH7u2sp+aGNucfP9v7EmKVV5e2t4Hr10VwmDiljJD1PlgeQjpZ6s JQhsgM355CVAtDAL4dDmzmZq7jfed6MO7lnI7tIEMorR1Jcwf5NqymPbiTASDOtukjUK 2PekRWxrXHnt4Ar88PtQvCJ0kTduW4XaVwL/jU2hizkpyntvDSqyd5jFzdBwWAzUqeaq Aoh5TYmbqm0euEhqKWycXbeP3Yd8h2C44U26KiZ8EMIAMCplj3jiK/1XGFpL3ZUQu9SL e7+pDY6fLnXsd+IS0NZE6lxzsgnhKOxu8g+sgT11/PkrYJXQnp5pV/nCQcrJoWrd3QEl KJLQ== X-Gm-Message-State: AKGB3mKOqx+9gP3iK2BWGLfb6/DDUHfMMfOIOSC2rYOdo3byiYzwrRrv 0gqxnH3rLV+xh+Ty2zJ7dpx8wA== X-Google-Smtp-Source: ACJfBouzpp6DQ7UQvJOS4mrNKc22Dmny7tRbsdZeADJ9xKnBVR3Lt6oziuHJiKHDf3z5sZvJJ1h8hg== X-Received: by 10.46.117.23 with SMTP id q23mr22874730ljc.85.1514649484041; Sat, 30 Dec 2017 07:58:04 -0800 (PST) Received: from localhost.localdomain ([2a00:1838:30:a00:626d:c7ff:fecc:a711]) by smtp.gmail.com with ESMTPSA id 79sm7774704ljq.5.2017.12.30.07.58.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Dec 2017 07:58:03 -0800 (PST) From: Alexander Mukhin To: buildroot@busybox.net Date: Sat, 30 Dec 2017 18:57:36 +0300 Message-Id: <20171230155736.1668-4-alexander.i.mukhin@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171230155736.1668-1-alexander.i.mukhin@gmail.com> References: <20171230155736.1668-1-alexander.i.mukhin@gmail.com> Subject: [Buildroot] [PATCH 3/3] hostapd: drop default dependency on netlink 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: thomas.petazzoni@free-electrons.com, Alexander Mukhin MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Get rid of netlink dependency if the options selected allow that. Signed-off-by: Alexander Mukhin Reviewed-by: Sam Voss --- package/hostapd/Config.in | 17 +++++++++++------ package/hostapd/hostapd.mk | 28 ++++++++++++++++------------ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in index d23e5e1dca..d60ed08cd6 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. @@ -24,10 +22,15 @@ 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 select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS 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" select BR2_PACKAGE_HOSTAPD_HAS_WIFI_DRIVERS @@ -97,12 +100,14 @@ 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_PACKAGE_HOSTAPD_VLAN 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 f9072784eb..fa8226805d 100644 --- a/package/hostapd/hostapd.mk +++ b/package/hostapd/hostapd.mk @@ -11,25 +11,16 @@ 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 = -HOSTAPD_CONFIG_ENABLE = \ - CONFIG_INTERNAL_LIBTOMMATH \ - CONFIG_LIBNL32 +HOSTAPD_CONFIG_ENABLE = CONFIG_INTERNAL_LIBTOMMATH 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 - # Try to use openssl if it's already available ifeq ($(BR2_PACKAGE_LIBOPENSSL),y) HOSTAPD_DEPENDENCIES += libopenssl @@ -105,6 +96,19 @@ ifeq ($(BR2_PACKAGE_HOSTAPD_VLAN_NETLINK),y) HOSTAPD_CONFIG_ENABLE += CONFIG_VLAN_NETLINK endif +# Options for building with libnl +ifeq ($(BR2_PACKAGE_LIBNL),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)) \