From patchwork Thu Sep 17 13:05:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 518829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B1175140FEE for ; Thu, 17 Sep 2015 23:06:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=TV3fQFGF; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C26332807DB; Thu, 17 Sep 2015 15:04:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 5BE412801A0 for ; Thu, 17 Sep 2015 15:04:54 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 17 Sep 2015 15:04:53 +0200 (CEST) Received: by wiclk2 with SMTP id lk2so23031244wic.0 for ; Thu, 17 Sep 2015 06:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=NXQOqvAV9FD5myx/iUc1+IRNrNfVZ7tKYRsCtxKN7qw=; b=TV3fQFGF1hetXMhvGjqWUGJWSWdee7/UFmHygu2yUj65J87n/i9cgm5XDNHBqV+XCj JWRxVoqEg4Zg0KJlDuE8vDFgKWwdcPkBcoDjfI789wrmUeQB7U2tv/PKXB19yyRD7K2H S2y/KMCoWJrVvGcGjoXv27oGBxRT3EL27XCFUSV3cvsLfpqfp/WLhsrKqyrY2CTVtj5A Q/X0TFxzgXyBbGH/JMNx0qVmjA9YIcqpMy9bAGZU56AAmPy1Yz0Z/WhIa6z983cxdzI7 kd/BSs4HPtmaBSJva2Ll+2CWGg6PGgmYNEUSUBg63GHFetQfM0pBjPyTkGQQUvsUr8if wBTw== X-Received: by 10.194.86.71 with SMTP id n7mr28024516wjz.27.1442495162325; Thu, 17 Sep 2015 06:06:02 -0700 (PDT) Received: from orion.ocedo.cluj.local ([5.2.198.78]) by smtp.gmail.com with ESMTPSA id lu5sm3373493wjb.9.2015.09.17.06.06.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Sep 2015 06:06:01 -0700 (PDT) From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Thu, 17 Sep 2015 16:05:52 +0300 Message-Id: <1442495152-2876-1-git-send-email-ardeleanalex@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: Alexandru Ardelean Subject: [OpenWrt-Devel] [PATCH] libnl: split into smaller libraries X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Alexandru Ardelean The idea is that we may only need the libnl core, or libnl-route or libnl-nf libs, but maybe not all of them. This way we can select which ones we need without bloating the firmware image too much. Signed-off-by: Alexandru Ardelean --- package/libs/libnl/Makefile | 62 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 995fda2..4cdcfba 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -18,16 +18,51 @@ PKG_LICENSE:=LGPL-2.1 include $(INCLUDE_DIR)/package.mk -define Package/libnl +define Package/libnl/default SECTION:=libs CATEGORY:=Libraries - TITLE:=netlink socket library - DEPENDS:=+libpthread URL:=http://people.suug.ch/~tgr/libnl/ endef +define Package/libnl +$(call Package/libnl/default) + TITLE:=Core Netlink Library + DEPENDS:=+libpthread +endef + +define Package/libnl-genl +$(call Package/libnl/default) + TITLE:=Generic Netlink Library + DEPENDS:=+libnl +endef + +define Package/libnl-nf +$(call Package/libnl/default) + TITLE:=Netfilter Netlink Library + DEPENDS:=+libnl +endef + +define Package/libnl-route +$(call Package/libnl/default) + TITLE:=Routing Netlink Library + DEPENDS:=+libnl +endef + define Package/libnl/description - This package contains a library for applications dealing with netlink sockets + Socket handling, connection management, sending and receiving of data, + message construction and parsing, object caching system, etc. +endef + +define Package/libnl-genl/description + Generic Netlink Library Functions +endef + +define Package/libnl-nf/description + Netfilter Netlink Library Functions +endef + +define Package/libnl-route/description + Routing Netlink Library Functions endef TARGET_CFLAGS += -ffunction-sections $(FPIC) @@ -48,10 +83,25 @@ endef define Package/libnl/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so.* $(1)/usr/lib/ +endef + +define Package/libnl-genl/install + $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so.* $(1)/usr/lib/ +endef + +define Package/libnl-nf/install + $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so.* $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so.* $(1)/usr/lib/ +endef + +define Package/libnl-route/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libnl)) +$(eval $(call BuildPackage,libnl-genl)) +$(eval $(call BuildPackage,libnl-nf)) +$(eval $(call BuildPackage,libnl-route))