aboutsummaryrefslogtreecommitdiffstats
path: root/tools/zlib
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2018-04-15 19:24:02 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-04-28 15:28:59 +0200
commit8dcd941d8b934891676a8d4bbef1ee78e89a4bf7 (patch)
tree8889465aa25467269f09f9b39ef9e5fe5a519fa0 /tools/zlib
parentafdca53acee25f452bd2c405cb3943db34492585 (diff)
downloadupstream-8dcd941d8b934891676a8d4bbef1ee78e89a4bf7.tar.gz
upstream-8dcd941d8b934891676a8d4bbef1ee78e89a4bf7.tar.bz2
upstream-8dcd941d8b934891676a8d4bbef1ee78e89a4bf7.zip
tools/zlib: move zlib build to tools
This allows us to link the other tools against our libz and we do not need the system zlib any more. Only the static linked library is copied to the staging directory so we have a statically linked library on all systems and not only on Linux. This also adds the new dependencies of the packages which are depending on zlib. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'tools/zlib')
-rw-r--r--tools/zlib/Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/zlib/Makefile b/tools/zlib/Makefile
new file mode 100644
index 0000000000..279851f758
--- /dev/null
+++ b/tools/zlib/Makefile
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zlib
+PKG_VERSION:=1.2.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
+PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
+
+PKG_LICENSE:=Zlib
+PKG_LICENSE_FILES:=README
+PKG_CPE_ID:=cpe:/a:gnu:zlib
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+HOST_CFLAGS +=-fPIC
+
+define Host/Install
+ $(CP) $(HOST_BUILD_DIR)/libz.a $(STAGING_DIR_HOST)/lib/
+ $(CP) $(HOST_BUILD_DIR)/zconf.h $(STAGING_DIR_HOST)/include/
+ $(CP) $(HOST_BUILD_DIR)/zlib.h $(STAGING_DIR_HOST)/include/
+ $(CP) $(HOST_BUILD_DIR)/zlib.pc $(STAGING_DIR_HOST)/lib/pkgconfig/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/lib/libz.a
+ rm -f $(STAGING_DIR_HOST)/include/zconf.h
+ rm -f $(STAGING_DIR_HOST)/include/zlib.h
+ rm -f $(STAGING_DIR_HOST)/lib/pkgconfig//zlib.pc
+endef
+
+$(eval $(call HostBuild))