summaryrefslogtreecommitdiff
blob: 12859d30a9a5d31b631df3073cad141a1e89c77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff -aruN a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
--- a/storage/connect/CMakeLists.txt	2017-01-11 20:45:20.000000000 -0500
+++ b/storage/connect/CMakeLists.txt	2017-01-22 21:11:15.000000000 -0500
@@ -286,8 +286,13 @@
 OPTION(CONNECT_WITH_ZIP "Compile CONNECT storage engine with ZIP support" ON)
 
 IF(CONNECT_WITH_ZIP)
-  SET(CONNECT_SOURCES ${CONNECT_SOURCES} filamzip.cpp tabzip.cpp unzip.c ioapi.c zip.c
-    filamzip.h tabzip.h ioapi.h unzip.h zip.h)
+  SET(CONNECT_SOURCES ${CONNECT_SOURCES} filamzip.cpp tabzip.cpp filamzip.h tabzip.h)
+  pkg_check_modules(MINIZIP minizip)
+  if(MINIZIP_FOUND) # Use system version
+    add_definitions(-DMINIZIP_FOUND)
+  else()
+    SET(CONNECT_SOURCES ${CONNECT_SOURCES} unzip.c ioapi.c zip.c ioapi.h unzip.h zip.h)
+  endif(MINIZIP_FOUND)
   add_definitions(-DZIP_SUPPORT -DNOCRYPT)
 ENDIF(CONNECT_WITH_ZIP)
 
@@ -311,5 +316,6 @@
   COMPONENT connect-engine
   RECOMPILE_FOR_EMBEDDED
   LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
-                 ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY})
+                 ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY}
+                 ${MINIZIP_LIBRARIES})
 
diff -aruN a/storage/connect/filamzip.h b/storage/connect/filamzip.h
--- a/storage/connect/filamzip.h	2017-01-11 20:45:20.000000000 -0500
+++ b/storage/connect/filamzip.h	2017-01-17 22:12:54.000000000 -0500
@@ -10,7 +10,11 @@
 
 #include "block.h"
 #include "filamap.h"
+#ifdef MINIZIP_FOUND
+#include "minizip/unzip.h"
+#else
 #include "unzip.h"
+#endif
 
 #define DLLEXPORT extern "C"
 
diff -aruN a/storage/connect/tabzip.h b/storage/connect/tabzip.h
--- a/storage/connect/tabzip.h	2017-01-11 20:45:21.000000000 -0500
+++ b/storage/connect/tabzip.h	2017-01-17 22:13:18.000000000 -0500
@@ -9,7 +9,11 @@
 #include "block.h"
 #include "colblk.h"
 #include "xtable.h"
+#ifdef MINIZIP_FOUND
+#include "minizip/unzip.h"
+#else
 #include "unzip.h"
+#endif
 
 typedef class ZIPDEF *PZIPDEF;
 typedef class TDBZIP *PTDBZIP;