From patchwork Wed Sep 23 08:17:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 521622 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 4D8221400A0 for ; Wed, 23 Sep 2015 18:17:32 +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=QgwNhrIe; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1D48D284125; Wed, 23 Sep 2015 10:16:04 +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 47035280777 for ; Wed, 23 Sep 2015 10:16:00 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 23 Sep 2015 10:15:59 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so226378331wic.1 for ; Wed, 23 Sep 2015 01:17:15 -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:in-reply-to:references; bh=Ul9ujISEcVyjPy4xuqs50GPiMobxbA4xGzigIXomTho=; b=QgwNhrIeaPO6goQfsVCkEk/FJUJWDFAsIxouNw8eXsZ3kAGREqNx9Z7nHeA1FqucWg BEzae2ueXDmQMWCtQtsSvQa3v6rzEeJ8mS8KbGhCFm9oP1pxSxsFmvNkvu0c+nGHKTcL H1wFIyN3s0ppBXI0WEU7uOcXa7P0X9xjFTFxm87Rkjki2zZ7o2bgh5lLtbvq7Dnqj/bb y9nJUKYW8eMDfwBzPklAqGnfIFL3RWnwwRlErr0vyfwotd7q04ZFalx+ew0CbyGhgMVx b/WxHDr2C62dNvER9UEO+De+m2btPirfeNivXhSZmSYLduNEZIBTdUQ3cSTnxIMB91+b XwiA== X-Received: by 10.180.184.138 with SMTP id eu10mr2647646wic.25.1442996235552; Wed, 23 Sep 2015 01:17:15 -0700 (PDT) Received: from orion.ocedo.cluj.local ([5.2.198.78]) by smtp.gmail.com with ESMTPSA id iw8sm285013wjb.5.2015.09.23.01.17.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Sep 2015 01:17:14 -0700 (PDT) From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Wed, 23 Sep 2015 11:17:08 +0300 Message-Id: <1442996228-29877-1-git-send-email-ardeleanalex@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442495152-2876-1-git-send-email-ardeleanalex@gmail.com> References: <1442495152-2876-1-git-send-email-ardeleanalex@gmail.com> Cc: Alexandru Ardelean Subject: [OpenWrt-Devel] [PATCH][RESEND] libnl: split libnl 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 Some modules may require only libnl-genl, some libnl-route and fewer would require libnl-nf. This patch splits the entire libnl package into smaller more granular libs that can be installed individually as required. Also added libnl*.so symlinks for convenience. Signed-off-by: Alexandru Ardelean --- package/libs/libnl/Makefile | 101 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 13 deletions(-) diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 995fda2..857bbe2 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -18,16 +18,61 @@ 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-core +$(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-core +endef + +define Package/libnl-route +$(call Package/libnl/default) + TITLE:=Routing Netlink Library + DEPENDS:=+libnl-core +endef + +define Package/libnl-nf +$(call Package/libnl/default) + TITLE:=Netfilter Netlink Library + DEPENDS:=+libnl-route +endef + +define Package/libnl +$(call Package/libnl/default) + TITLE:=Full Netlink Library + DEPENDS:=+libnl-genl +libnl-route +libnl-nf +endef + +define Package/libnl-core/description + Common code for all netlink libraries +endef + +define Package/libnl-genl/description + Generic Netlink Library Functions +endef + +define Package/libnl-route/description + Routing Netlink Library Functions +endef + +define Package/libnl-nf/description + Netfilter Netlink Library Functions +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 TARGET_CFLAGS += -ffunction-sections $(FPIC) @@ -40,18 +85,48 @@ define Build/Compile endef define Build/InstallDev - $(INSTALL_DIR) $(1) - $(CP) $(PKG_INSTALL_DIR)/* $(1)/ - mkdir -p $(1)/usr/include/libnl - $(CP) $(PKG_BUILD_DIR)/include/linux $(1)/usr/include/libnl/ + $(INSTALL_DIR) $(1)/usr/include/libnl $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig + + # Copy symlinks + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so $(1)/usr/lib/libnl.so + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so endef -define Package/libnl/install +define Package/libnl-core/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so $(1)/usr/lib/libnl.so +endef + +define Package/libnl-genl/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-genl-3.so.* $(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/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so +endef + +define Package/libnl-route/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-route-3.so $(1)/usr/lib/libnl-route.so +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-nf-3.so $(1)/usr/lib/libnl-nf.so +endef + +define Package/libnl/install + : endef +$(eval $(call BuildPackage,libnl-core)) +$(eval $(call BuildPackage,libnl-genl)) +$(eval $(call BuildPackage,libnl-route)) +$(eval $(call BuildPackage,libnl-nf)) $(eval $(call BuildPackage,libnl))