[openadk] [PATCH 10/15] package/zlib: Enable host-package

Phil Sutter phil at nwl.cc
Wed Mar 8 05:33:28 CET 2017


Signed-off-by: Phil Sutter <phil at nwl.cc>
---
 package/zlib/Makefile | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/package/zlib/Makefile b/package/zlib/Makefile
index 2da7e98bfb4d9..7f0c0ce1e4a79 100644
--- a/package/zlib/Makefile
+++ b/package/zlib/Makefile
@@ -13,10 +13,33 @@ PKG_URL:=		http://www.zlib.net/
 PKG_SITES:=		http://zlib.net/
 PKG_OPTS:=		dev
 
+include $(ADK_TOPDIR)/mk/host.mk
 include $(ADK_TOPDIR)/mk/package.mk
 
+$(eval $(call HOST_template,ZLIB,zlib,$(PKG_VERSION)-$(PKG_RELEASE)))
 $(eval $(call PKG_template,ZLIB,zlib,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS)))
 
+HOST_STYLE:=		auto
+HOST_CONFIG_STYLE:=	manual
+HOST_CONFIGURE_ENV+=	uname=Linux
+HOST_ALL_TARGET:=	libz.so.$(PKG_VERSION)
+
+host-configure:
+	(cd $(WRKBUILD); \
+		uname="Linux" \
+		$(HOST_CONFIGURE_OPTS) \
+		CFLAGS="$(HOST_CFLAGS) -fPIC" \
+		CPPFLAGS="-I$(STAGING_HOST_DIR)/usr/include" \
+		LDFLAGS="-L$(STAGING_HOST_DIR)/usr/lib" \
+		./configure \
+		--prefix=/usr \
+		--shared \
+	);
+
+#zlib-hostinstall:
+#	$(INSTALL_DIR) $(STAGING_HOST_DIR)/usr/lib
+#	$(CP) $(WRKBUILD)/libz.so* $(STAGING_HOST_DIR)/usr/lib
+
 CONFIG_STYLE:=		manual
 CONFIGURE_ENV+=		uname=Linux
 
@@ -47,4 +70,5 @@ zlib-install:
 	$(INSTALL_DIR) $(IDIR_ZLIB)/usr/lib
 	$(CP) $(WRKINST)/usr/lib/libz.so* $(IDIR_ZLIB)/usr/lib
 
+include ${ADK_TOPDIR}/mk/host-bottom.mk
 include $(ADK_TOPDIR)/mk/pkg-bottom.mk
-- 
2.9.3



More information about the dev mailing list