summaryrefslogtreecommitdiffstats
path: root/third_party/zlib
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 18:48:45 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 18:48:45 +0000
commit97199591735ab2316737205ab9dc1e25c62768f2 (patch)
treeadedcfb6c9549f057cfe68b136b4bff5c89ddf4a /third_party/zlib
parent0bcd33eacb640e709f36abf3f8d3e88ecd34efef (diff)
downloadchromium_src-97199591735ab2316737205ab9dc1e25c62768f2.zip
chromium_src-97199591735ab2316737205ab9dc1e25c62768f2.tar.gz
chromium_src-97199591735ab2316737205ab9dc1e25c62768f2.tar.bz2
Linux: add GYP flag to build with system zlib.
This follows the general style of r21663, which we agreed was the way to do this. Note that, currently, one cannot build with system zlib on a 64-bit system since it's missing a symlink to libz.so in /usr/lib32. http://codereview.chromium.org/164027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/zlib')
-rw-r--r--third_party/zlib/contrib/minizip/ioapi.c9
-rw-r--r--third_party/zlib/contrib/minizip/mztools.c7
-rw-r--r--third_party/zlib/contrib/minizip/mztools.h6
-rw-r--r--third_party/zlib/contrib/minizip/unzip.c6
-rw-r--r--third_party/zlib/contrib/minizip/unzip.h6
-rw-r--r--third_party/zlib/contrib/minizip/zip.c6
-rw-r--r--third_party/zlib/contrib/minizip/zip.h6
-rw-r--r--third_party/zlib/zlib.gyp143
8 files changed, 121 insertions, 68 deletions
diff --git a/third_party/zlib/contrib/minizip/ioapi.c b/third_party/zlib/contrib/minizip/ioapi.c
index 3916d04..3aad38a 100644
--- a/third_party/zlib/contrib/minizip/ioapi.c
+++ b/third_party/zlib/contrib/minizip/ioapi.c
@@ -10,12 +10,13 @@
#include <stdlib.h>
#include <string.h>
-/* NOTE(erikkay): this modification was needed to avoid picking up the system
- version of zlib.h on the Mac */
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
#include "third_party/zlib/zlib.h"
-#include "ioapi.h"
-
+#endif
+#include "ioapi.h"
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
diff --git a/third_party/zlib/contrib/minizip/mztools.c b/third_party/zlib/contrib/minizip/mztools.c
index 8a50ee4..bc19436 100644
--- a/third_party/zlib/contrib/minizip/mztools.c
+++ b/third_party/zlib/contrib/minizip/mztools.c
@@ -8,7 +8,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "zlib.h"
+
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
+#include "third_party/zlib/zlib.h"
+#endif
#include "unzip.h"
#define READ_8(adr) ((unsigned char)*(adr))
diff --git a/third_party/zlib/contrib/minizip/mztools.h b/third_party/zlib/contrib/minizip/mztools.h
index eee78dc..4af7a46 100644
--- a/third_party/zlib/contrib/minizip/mztools.h
+++ b/third_party/zlib/contrib/minizip/mztools.h
@@ -11,8 +11,10 @@
extern "C" {
#endif
-#ifndef _ZLIB_H
-#include "zlib.h"
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
+#include "third_party/zlib/zlib.h"
#endif
#include "unzip.h"
diff --git a/third_party/zlib/contrib/minizip/unzip.c b/third_party/zlib/contrib/minizip/unzip.c
index 72d88f2..6f95973 100644
--- a/third_party/zlib/contrib/minizip/unzip.c
+++ b/third_party/zlib/contrib/minizip/unzip.c
@@ -38,9 +38,11 @@ woven in by Terry Thorsen 1/2003.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-/* NOTE(erikkay): this modification was needed to avoid picking up the system
- version of zlib.h on the Mac */
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
#include "third_party/zlib/zlib.h"
+#endif
#include "unzip.h"
#ifdef STDC
diff --git a/third_party/zlib/contrib/minizip/unzip.h b/third_party/zlib/contrib/minizip/unzip.h
index b247937..4e75c70 100644
--- a/third_party/zlib/contrib/minizip/unzip.h
+++ b/third_party/zlib/contrib/minizip/unzip.h
@@ -49,8 +49,10 @@
extern "C" {
#endif
-#ifndef _ZLIB_H
-#include "zlib.h"
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
+#include "third_party/zlib/zlib.h"
#endif
#ifndef _ZLIBIOAPI_H
diff --git a/third_party/zlib/contrib/minizip/zip.c b/third_party/zlib/contrib/minizip/zip.c
index 7fbe002..87b15b6 100644
--- a/third_party/zlib/contrib/minizip/zip.c
+++ b/third_party/zlib/contrib/minizip/zip.c
@@ -14,7 +14,11 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "zlib.h"
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
+#include "third_party/zlib/zlib.h"
+#endif
#include "zip.h"
#ifdef STDC
diff --git a/third_party/zlib/contrib/minizip/zip.h b/third_party/zlib/contrib/minizip/zip.h
index acacce8..77a2374 100644
--- a/third_party/zlib/contrib/minizip/zip.h
+++ b/third_party/zlib/contrib/minizip/zip.h
@@ -50,8 +50,10 @@
extern "C" {
#endif
-#ifndef _ZLIB_H
-#include "zlib.h"
+#if defined(USE_SYSTEM_ZLIB)
+#include <zlib.h>
+#else
+#include "third_party/zlib/zlib.h"
#endif
#ifndef _ZLIBIOAPI_H
diff --git a/third_party/zlib/zlib.gyp b/third_party/zlib/zlib.gyp
index bcec3a9..922676d 100644
--- a/third_party/zlib/zlib.gyp
+++ b/third_party/zlib/zlib.gyp
@@ -6,62 +6,97 @@
'includes': [
'../../build/common.gypi',
],
- 'targets': [
- {
- 'target_name': 'zlib',
- 'type': '<(library)',
- 'msvs_guid': '8423AF0D-4B88-4EBF-94E1-E4D00D00E21C',
- 'sources': [
- 'contrib/minizip/ioapi.c',
- 'contrib/minizip/ioapi.h',
- 'contrib/minizip/iowin32.c',
- 'contrib/minizip/iowin32.h',
- 'contrib/minizip/unzip.c',
- 'contrib/minizip/unzip.h',
- 'contrib/minizip/zip.c',
- 'contrib/minizip/zip.h',
- 'adler32.c',
- 'compress.c',
- 'crc32.c',
- 'crc32.h',
- 'deflate.c',
- 'deflate.h',
- 'gzio.c',
- 'infback.c',
- 'inffast.c',
- 'inffast.h',
- 'inffixed.h',
- 'inflate.c',
- 'inflate.h',
- 'inftrees.c',
- 'inftrees.h',
- 'mozzconf.h',
- 'trees.c',
- 'trees.h',
- 'uncompr.c',
- 'zconf.h',
- 'zlib.h',
- 'zutil.c',
- 'zutil.h',
- ],
- 'include_dirs': [
- '.',
- # For contrib/minizip
- '../..',
+ 'variables': {
+ 'use_system_zlib%': 0,
+ },
+ 'conditions': [
+ ['use_system_zlib==0', {
+ 'targets': [
+ {
+ 'target_name': 'zlib',
+ 'type': '<(library)',
+ 'msvs_guid': '8423AF0D-4B88-4EBF-94E1-E4D00D00E21C',
+ 'sources': [
+ 'contrib/minizip/ioapi.c',
+ 'contrib/minizip/ioapi.h',
+ 'contrib/minizip/iowin32.c',
+ 'contrib/minizip/iowin32.h',
+ 'contrib/minizip/unzip.c',
+ 'contrib/minizip/unzip.h',
+ 'contrib/minizip/zip.c',
+ 'contrib/minizip/zip.h',
+ 'adler32.c',
+ 'compress.c',
+ 'crc32.c',
+ 'crc32.h',
+ 'deflate.c',
+ 'deflate.h',
+ 'gzio.c',
+ 'infback.c',
+ 'inffast.c',
+ 'inffast.h',
+ 'inffixed.h',
+ 'inflate.c',
+ 'inflate.h',
+ 'inftrees.c',
+ 'inftrees.h',
+ 'mozzconf.h',
+ 'trees.c',
+ 'trees.h',
+ 'uncompr.c',
+ 'zconf.h',
+ 'zlib.h',
+ 'zutil.c',
+ 'zutil.h',
+ ],
+ 'include_dirs': [
+ '.',
+ # For contrib/minizip
+ '../..',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '.',
+ ],
+ },
+ 'conditions': [
+ ['OS!="win"', {
+ 'product_name': 'z',
+ 'sources!': [
+ 'contrib/minizip/iowin32.c'
+ ],
+ }],
+ ],
+ },
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '.',
- ],
- },
- 'conditions': [
- ['OS!="win"', {
- 'product_name': 'z',
- 'sources!': [
- 'contrib/minizip/iowin32.c'
+ }, {
+ 'targets': [
+ {
+ 'target_name': 'zlib',
+ 'type': '<(library)',
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'USE_SYSTEM_ZLIB',
+ ],
+ },
+ 'defines': [
+ 'USE_SYSTEM_ZLIB',
+ ],
+ 'sources': [
+ 'contrib/minizip/ioapi.c',
+ 'contrib/minizip/ioapi.h',
+ 'contrib/minizip/unzip.c',
+ 'contrib/minizip/unzip.h',
+ 'contrib/minizip/zip.c',
+ 'contrib/minizip/zip.h',
],
- }],
+ 'link_settings': {
+ 'libraries': [
+ '-lz',
+ ],
+ },
+ },
],
- },
+ }],
],
}