[source] zlib: add host build

LEDE Commits lede-commits at lists.infradead.org
Wed May 24 06:38:27 PDT 2017


stintel pushed a commit to source.git, branch kodi:
https://git.lede-project.org/d2c7842d805ac848cee6d05fb17347a18e7b0216

commit d2c7842d805ac848cee6d05fb17347a18e7b0216
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sat Mar 11 09:35:34 2017 +0100

    zlib: add host build
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/libs/zlib/Makefile | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile
index 7e3bd83..ddf4a7e 100644
--- a/package/libs/zlib/Makefile
+++ b/package/libs/zlib/Makefile
@@ -18,6 +18,7 @@ PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
 PKG_LICENSE:=Zlib
 PKG_LICENSE_FILES:=README
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/zlib
@@ -55,6 +56,11 @@ CONFIGURE_ARGS := \
 	--shared \
 	--uname=Linux \
 
+HOST_CONFIGURE_ARGS := $(CONFIGURE_ARGS)
+HOST_CONFIGURE_VARS := \
+	$(HOST_CONFIGURE_OPTS) \
+	CFLAGS="$(HOST_CFLAGS) $(FPIC)" \
+
 define Build/Compile
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \
@@ -78,6 +84,15 @@ define Build/InstallDev
 		$(1)/usr/lib/pkgconfig/
 endef
 
+define Host/Install
+	$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
+	$(INSTALL_DATA) $(HOST_BUILD_DIR)/z{conf,lib}.h \
+		$(STAGING_DIR_HOSTPKG)/include/
+	$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib
+	$(INSTALL_DATA) $(HOST_BUILD_DIR)/libz.{a,so*} \
+		$(STAGING_DIR_HOSTPKG)/lib/
+endef
+
 # libz.so is needed for openssl (zlib-dynamic)
 define Package/zlib/install
 	$(INSTALL_DIR) $(1)/usr/lib
@@ -98,5 +113,6 @@ define Package/zlib-dev/install
 	  $(1)/usr/lib/pkgconfig/
 endef
 
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,zlib))
 $(eval $(call BuildPackage,zlib-dev))



More information about the lede-commits mailing list