[OpenWrt-Devel] [PATCH] libnl: split into smaller libraries
Alexandru Ardelean
ardeleanalex at gmail.com
Thu Sep 17 09:05:52 EDT 2015
From: Alexandru Ardelean <aa at ocedo.com>
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 <ardeleanalex at gmail.com>
---
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))
--
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list