aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/zlib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/depends/target/zlib')
-rw-r--r--tools/depends/target/zlib/Makefile41
-rw-r--r--tools/depends/target/zlib/visibility.patch15
2 files changed, 56 insertions, 0 deletions
diff --git a/tools/depends/target/zlib/Makefile b/tools/depends/target/zlib/Makefile
new file mode 100644
index 0000000000..e40f21582d
--- /dev/null
+++ b/tools/depends/target/zlib/Makefile
@@ -0,0 +1,41 @@
+include ../../Makefile.include
+DEPS= ../../Makefile.include Makefile
+
+# lib name, version
+LIBNAME=zlib
+VERSION=1.2.7
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+BASE_URL=http://zlib.net/
+# configuration settings
+CONFIGURE= CC="$(CC)" CFLAGS="$(CFLAGS)" ./configure --prefix=$(PREFIX) --static
+
+LIBDYLIB=$(PLATFORM)/$(LIBNAME).a
+
+CLEAN_FILES=$(ARCHIVE) $(PLATFORM)
+
+all: .installed-$(PLATFORM)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
+ rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ cd $(PLATFORM); patch -p0 < ../visibility.patch
+ cd $(PLATFORM); $(CONFIGURE)
+
+$(LIBDYLIB): $(PLATFORM)
+ $(MAKE) -C $(PLATFORM)
+
+.installed-$(PLATFORM): $(LIBDYLIB)
+ $(MAKE) -C $(PLATFORM) install
+ touch $(LIBDYLIB)
+ touch $@
+
+clean:
+ $(MAKE) -C $(PLATFORM) clean
+ rm -f .installed-$(PLATFORM)
+
+distclean::
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
diff --git a/tools/depends/target/zlib/visibility.patch b/tools/depends/target/zlib/visibility.patch
new file mode 100644
index 0000000000..af49fbffd7
--- /dev/null
+++ b/tools/depends/target/zlib/visibility.patch
@@ -0,0 +1,15 @@
+--- zconf.h.in 2013-01-23 21:22:22.512584179 -0500
++++ zconf.h.in 2013-01-23 21:21:56.312584196 -0500
+@@ -348,7 +348,11 @@
+ #endif
+
+ #ifndef ZEXTERN
+-# define ZEXTERN extern
++# ifdef HAVE_HIDDEN
++# define ZEXTERN extern __attribute__((visibility ("default")))
++# else
++# define ZEXTERN extern
++# endif
+ #endif
+ #ifndef ZEXPORT
+ # define ZEXPORT