diff --git a/3party/3party.pro b/3party/3party.pro index 687903d946..05a49fd5d9 100644 --- a/3party/3party.pro +++ b/3party/3party.pro @@ -2,7 +2,7 @@ TEMPLATE = subdirs -SUBDIRS = freetype fribidi zlib jansson tomcrypt protobuf osrm expat \ +SUBDIRS = freetype fribidi minizip jansson tomcrypt protobuf osrm expat \ succinct \ !linux* { diff --git a/android/jni/Android.mk b/android/jni/Android.mk index d42bdd0d1e..111b16258d 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -101,7 +101,7 @@ LOCAL_SRC_FILES := \ nv_event/nv_event.cpp \ nv_time/nv_time.cpp \ -LOCAL_LDLIBS := -llog -lGLESv2 -latomic +LOCAL_LDLIBS := -llog -lGLESv2 -latomic -lz LOCAL_LDLIBS += -Wl,--gc-sections diff --git a/coding/coding.pro b/coding/coding.pro index d96d71eee1..d36cd54b6d 100644 --- a/coding/coding.pro +++ b/coding/coding.pro @@ -7,7 +7,7 @@ ROOT_DIR = .. include($$ROOT_DIR/common.pri) -INCLUDEPATH *= $$ROOT_DIR/3party/tomcrypt/src/headers $$ROOT_DIR/3party/zlib $$ROOT_DIR/3party/expat/lib +INCLUDEPATH *= $$ROOT_DIR/3party/tomcrypt/src/headers $$ROOT_DIR/3party/expat/lib SOURCES += \ arithmetic_codec.cpp \ @@ -20,7 +20,6 @@ SOURCES += \ file_name_utils.cpp \ file_reader.cpp \ file_writer.cpp \ - gzip_compressor.cpp \ hex.cpp \ huffman.cpp \ internal/file_data.cpp \ @@ -62,7 +61,6 @@ HEADERS += \ file_sort.hpp \ file_writer.hpp \ file_writer_stream.hpp \ - gzip_compressor.hpp \ hex.hpp \ huffman.hpp \ internal/expat_impl.h \ diff --git a/coding/coding_tests/coding_tests.pro b/coding/coding_tests/coding_tests.pro index 6ef69ca27f..c6aee3614e 100644 --- a/coding/coding_tests/coding_tests.pro +++ b/coding/coding_tests/coding_tests.pro @@ -5,7 +5,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = coding base zlib tomcrypt +DEPENDENCIES = coding base minizip tomcrypt include($$ROOT_DIR/common.pri) @@ -27,7 +27,6 @@ SOURCES += ../../testing/testingmain.cpp \ file_data_test.cpp \ file_sort_test.cpp \ file_utils_test.cpp \ - gzip_test.cpp \ hex_test.cpp \ huffman_test.cpp \ mem_file_reader_test.cpp \ diff --git a/coding/coding_tests/gzip_test.cpp b/coding/coding_tests/gzip_test.cpp deleted file mode 100644 index 143dd0965f..0000000000 --- a/coding/coding_tests/gzip_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "base/SRC_FIRST.hpp" -#include "testing/testing.hpp" - -#include "coding/coding_tests/coder_test.hpp" -#include "coding/gzip_compressor.hpp" - -namespace -{ - void CompressGZipLevel1(char const * pSrc, size_t srcSize, string & dst) - { - return CompressGZip(1, pSrc, srcSize, dst); - } - void CompressGZipLevel9(char const * pSrc, size_t srcSize, string & dst) - { - return CompressGZip(1, pSrc, srcSize, dst); - } -} - -UNIT_TEST(AaaaGZipCompressionLevel1) -{ - CoderAaaaTest(&CompressGZipLevel1, &DecompressGZip); -} - -UNIT_TEST(AaaaGZipCompressionLevel9) -{ - CoderAaaaTest(&CompressGZipLevel9, &DecompressGZip); -} diff --git a/coding/gzip_compressor.cpp b/coding/gzip_compressor.cpp deleted file mode 100644 index 34ed54d682..0000000000 --- a/coding/gzip_compressor.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "coding/gzip_compressor.hpp" -#include "coding/coder_util.hpp" -#include "base/assert.hpp" -#include "3party/zlib/zlib.h" - -size_t DecompressGZipIntoFixedSize(char const * pSrc, size_t srcSize, char * pDst, size_t dstSize) -{ - unsigned long dstUsed = dstSize; - int error = uncompress(reinterpret_cast(pDst), &dstUsed, - reinterpret_cast(pSrc), srcSize); - switch (error) - { - case Z_OK: - return dstUsed; - case Z_BUF_ERROR: - return size_t(-1); - default: - MYTHROW(DecompressGZipException, (error, srcSize, dstSize, dstUsed)); - } -} - -void DecompressGZip(char const * pSrc, size_t srcSize, string & dst) -{ - FixedDstSizeCodeToString(&DecompressGZipIntoFixedSize, pSrc, srcSize, dst); -} - -void CompressGZip(int level, char const * pSrc, size_t srcSize, string & dst) -{ - ASSERT(level >= 1 && level <= 9, (level)); - dst.resize(compressBound(srcSize)); - unsigned long dstUsed = dst.size(); - int error = compress2(reinterpret_cast(&dst[0]), &dstUsed, - reinterpret_cast(pSrc), srcSize, level); - if (error == Z_OK) - dst.resize(dstUsed); - else - MYTHROW(CompressGZipException, (error, srcSize, dst.size(), dstUsed)); -} - diff --git a/coding/gzip_compressor.hpp b/coding/gzip_compressor.hpp deleted file mode 100644 index 93f63d1ec6..0000000000 --- a/coding/gzip_compressor.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include "coding/coder.hpp" -#include "base/base.hpp" -#include "base/exception.hpp" - -DECLARE_EXCEPTION(CompressGZipException, StringCodingException); -DECLARE_EXCEPTION(DecompressGZipException, StringCodingException); - -// Throws CompressGZipException on error. -void CompressGZip(int level, char const * pSrc, size_t srcSize, string & dst); - -// Throws DecompressGZipException on error. -void DecompressGZip(char const * pSrc, size_t srcSize, string & dst); - -// Returns -1 if dstSize is too small, otherwise the size of pDst used. -// Throws DecompressGZipException on error. -size_t DecompressGZipIntoFixedSize(char const * pSrc, size_t srcSize, char * pDst, size_t dstSize); diff --git a/coding/zip_creator.cpp b/coding/zip_creator.cpp index e3443f0f96..2831100f3c 100644 --- a/coding/zip_creator.cpp +++ b/coding/zip_creator.cpp @@ -15,7 +15,7 @@ #include "std/algorithm.hpp" #include "std/unique_ptr.hpp" -#include "3party/zlib/contrib/minizip/zip.h" +#include "3party/minizip/zip.h" namespace diff --git a/coding/zip_reader.cpp b/coding/zip_reader.cpp index ed7d6b3f09..773096eb28 100644 --- a/coding/zip_reader.cpp +++ b/coding/zip_reader.cpp @@ -8,7 +8,7 @@ #include "std/bind.hpp" -#include "3party/zlib/contrib/minizip/unzip.h" +#include "3party/minizip/unzip.h" ZipFileReader::ZipFileReader(string const & container, string const & file, diff --git a/common.pri b/common.pri index 56a3ed0280..f9c4338816 100644 --- a/common.pri +++ b/common.pri @@ -82,6 +82,8 @@ for(project, DEPENDENCIES) { LIBS += -l$$project } +unix : LIBS *= -lz + #INCLUDEPATH += $$ROOT_DIR/3party/protobuf/src/ # Windows-specific options for all projects diff --git a/drape_head/drape_head.pro b/drape_head/drape_head.pro index f66cb883ff..6bd2d2f050 100644 --- a/drape_head/drape_head.pro +++ b/drape_head/drape_head.pro @@ -1,7 +1,7 @@ # Head project for drape develop and debuging ROOT_DIR = .. DEPENDENCIES = map render drape_frontend anim drape indexer platform geometry coding base \ - freetype expat protobuf jansson zlib fribidi tomcrypt + freetype expat protobuf jansson fribidi tomcrypt include($$ROOT_DIR/common.pri) diff --git a/integration_tests/integration_tests.pro b/integration_tests/integration_tests.pro index fa41b46f7f..1c157e4c70 100644 --- a/integration_tests/integration_tests.pro +++ b/integration_tests/integration_tests.pro @@ -11,7 +11,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = .. -DEPENDENCIES = map routing search storage indexer platform geometry coding base osrm jansson protobuf tomcrypt succinct stats_client zlib +DEPENDENCIES = map routing search storage indexer platform geometry coding base osrm jansson protobuf tomcrypt succinct stats_client macx-*: LIBS *= "-framework Foundation" "-framework IOKit" "-framework SystemConfiguration" diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 0cc55b53fd..04772e86f7 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -112,6 +112,7 @@ 4A7D89C81B2EBF3B00AC843E /* resources-xxhdpi_dark in Resources */ = {isa = PBXBuildFile; fileRef = 4A7D89C41B2EBF3B00AC843E /* resources-xxhdpi_dark */; }; 5605022F1B6211E100169CAD /* sound-strings in Resources */ = {isa = PBXBuildFile; fileRef = 5605022E1B6211E100169CAD /* sound-strings */; }; 560634F21B78806100F3D670 /* MWMTextToSpeech.mm in Sources */ = {isa = PBXBuildFile; fileRef = 560634F11B78806100F3D670 /* MWMTextToSpeech.mm */; }; + 6B53A1B21B83C25400E4CDAD /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 34570A3A1B13222600E6D4FD /* libz.dylib */; }; 6B8A738A1B2616E90085EFE6 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA87151A12B1518F00592DAF /* SystemConfiguration.framework */; }; 6BA0BCD11B74DDBA00CC9969 /* MWMCustomFacebookEvents.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6BA0BCD01B74DDBA00CC9969 /* MWMCustomFacebookEvents.mm */; }; 6C24A3AD1AD7CA1000A47B99 /* MWMNoMapInterfaceController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6C47C8C81AD6C825000C52C1 /* MWMNoMapInterfaceController.mm */; }; @@ -812,6 +813,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6B53A1B21B83C25400E4CDAD /* libz.dylib in Frameworks */, 6B8A738A1B2616E90085EFE6 /* SystemConfiguration.framework in Frameworks */, 348E578E1B0F3752000FA02A /* CoreLocation.framework in Frameworks */, 454040761AD2DD73007A9B12 /* UIKit.framework in Frameworks */, @@ -2477,7 +2479,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -2589,7 +2591,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -3095,7 +3097,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -3203,7 +3205,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -3314,7 +3316,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -3426,7 +3428,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -3537,7 +3539,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", @@ -3646,7 +3648,7 @@ "-lbase", "-lfreetype", "-lfribidi", - "-lzlib", + "-lminizip", "-ljansson", "-ltomcrypt", "-lexpat", diff --git a/map/map_tests/map_tests.pro b/map/map_tests/map_tests.pro index 973c626a7c..5734c6f787 100644 --- a/map/map_tests/map_tests.pro +++ b/map/map_tests/map_tests.pro @@ -7,7 +7,7 @@ TEMPLATE = app ROOT_DIR = ../.. DEPENDENCIES = map render gui routing search storage graphics indexer platform anim geometry coding base \ - freetype fribidi expat protobuf tomcrypt jansson osrm stats_client zlib succinct + freetype fribidi expat protobuf tomcrypt jansson osrm stats_client minizip succinct !linux* { DEPENDENCIES *= opening_hours diff --git a/map/mwm_tests/mwm_tests.pro b/map/mwm_tests/mwm_tests.pro index 38731c7fc0..7cd8449081 100644 --- a/map/mwm_tests/mwm_tests.pro +++ b/map/mwm_tests/mwm_tests.pro @@ -7,7 +7,7 @@ TEMPLATE = app ROOT_DIR = ../.. DEPENDENCIES = map gui search storage graphics indexer platform anim geometry coding base \ - freetype fribidi expat protobuf tomcrypt jansson zlib + freetype fribidi expat protobuf tomcrypt jansson include($$ROOT_DIR/common.pri) diff --git a/platform/platform_tests/platform_tests.pro b/platform/platform_tests/platform_tests.pro index 6f0f4fac13..36b7c057b6 100644 --- a/platform/platform_tests/platform_tests.pro +++ b/platform/platform_tests/platform_tests.pro @@ -4,7 +4,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = platform_tests_support platform coding base zlib tomcrypt jansson +DEPENDENCIES = platform_tests_support platform coding base minizip tomcrypt jansson include($$ROOT_DIR/common.pri) diff --git a/qt/qt.pro b/qt/qt.pro index ab27b82eef..9ddbb06dfc 100644 --- a/qt/qt.pro +++ b/qt/qt.pro @@ -1,7 +1,7 @@ # Main application in qt. ROOT_DIR = .. DEPENDENCIES = map render gui routing search storage indexer graphics platform anim geometry coding base \ - freetype expat fribidi tomcrypt jansson protobuf osrm stats_client zlib succinct + freetype expat fribidi tomcrypt jansson protobuf osrm stats_client minizip succinct drape { DEPENDENCIES *= drape_frontend drape diff --git a/search/integration_tests/integration_tests.pro b/search/integration_tests/integration_tests.pro index c41d9c4a2b..e62812a1af 100644 --- a/search/integration_tests/integration_tests.pro +++ b/search/integration_tests/integration_tests.pro @@ -6,7 +6,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = generator routing search storage stats_client jansson zlib indexer platform geometry coding sgitess base protobuf tomcrypt +DEPENDENCIES = generator routing search storage stats_client jansson indexer platform geometry coding sgitess base protobuf tomcrypt include($$ROOT_DIR/common.pri) diff --git a/storage/storage_tests/storage_tests.pro b/storage/storage_tests/storage_tests.pro index 65dbb75102..ae0119af67 100644 --- a/storage/storage_tests/storage_tests.pro +++ b/storage/storage_tests/storage_tests.pro @@ -6,7 +6,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = storage indexer platform_tests_support platform geometry coding base jansson tomcrypt stats_client zlib +DEPENDENCIES = storage indexer platform_tests_support platform geometry coding base jansson tomcrypt stats_client include($$ROOT_DIR/common.pri)