Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for system minizip when available

  • Loading branch information...
commit e52630bab477ce925b98d898c0d1305af5073b74 1 parent 25688f9
@Ri0n Ri0n authored
View
2  conf_windows.pri
@@ -5,7 +5,7 @@ CONFIG += release
#CONFIG += qca-static
# tell iris to use our internal libz
-CONFIG += psi-zip
+CONFIG += psi-winzlib
# OpenSSL
qca-static {
View
77 configure
@@ -973,41 +973,66 @@ public:
{
#ifdef Q_OS_WIN
// HACK: on windows, always use psi's bundled zlib
- conf->addExtra("CONFIG += psi-zip");
+ conf->addExtra("CONFIG += psi-winzlib psi-minizip");
return true;
#else
- QString inc, lib;
+ QStringList incs;
+ QString version, libs, other;
QString s;
- s = conf->getenv("QC_WITH_ZLIB_INC");
- if(!s.isEmpty()) {
- if(!conf->checkHeader(s, "zlib.h"))
- return false;
- inc = s;
- }
- else {
- if(!conf->findHeader("zlib.h", QStringList(), &s))
- return false;
- inc = s;
+ if(!conf->findPkgConfig("zlib", VersionAny, "", &version, &incs, &libs, &other)) {
+
+ s = conf->getenv("QC_WITH_ZLIB_INC");
+ if(!s.isEmpty()) {
+ if(!conf->checkHeader(s, "zlib.h"))
+ return false;
+ }
+ else {
+ if(!conf->findHeader("zlib.h", QStringList(), &s))
+ return false;
+ }
+ incs.append(s);
+
+ s = conf->getenv("QC_WITH_ZLIB_LIB");
+ if(!s.isEmpty()) {
+ if(!conf->checkLibrary(s, "z"))
+ return false;
+ }
+ else {
+ if(!conf->findLibrary("z", &s))
+ return false;
+ }
+ libs = QString("-L%1 -lz").arg(s);
}
- s = conf->getenv("QC_WITH_ZLIB_LIB");
- if(!s.isEmpty()) {
- if(!conf->checkLibrary(s, "z"))
- return false;
- lib = s;
+ foreach(const QString &inc, incs) {
+ conf->addIncludePath(inc);
}
- else {
- if(!conf->findLibrary("z", &s))
- return false;
- lib = s;
+ conf->addLib(libs);
+
+ if(!conf->findPkgConfig("minizip", VersionAny, "", &version, &incs, &libs, &other)) {
+
+ s = conf->getenv("QC_WITH_MINIZIP_INC");
+ if ((!s.isEmpty() && conf->checkHeader(s, "unzip.h")) ||
+ (s.isEmpty() && conf->findHeader("unzip.h", QStringList(), &s))) {
+ incs.append(s);
+ }
+
+ s = conf->getenv("QC_WITH_MINIZIP_LIB");
+ if((!s.isEmpty() && conf->checkLibrary(s, "minizip")) ||
+ (s.isEmpty() && conf->findLibrary("minizip", &s))) {
+ libs = QString("-L%1 -lminizip").arg(s);
+ }
}
- if(!inc.isEmpty())
- conf->addIncludePath(inc);
- if(!lib.isEmpty())
- conf->addLib(QString("-L") + s);
- conf->addLib("-lz");
+ if (!incs.isEmpty() && !libs.isEmpty()) {
+ foreach(const QString &inc, incs) {
+ conf->addIncludePath(inc);
+ }
+ conf->addLib(libs);
+ } else {
+ conf->addExtra("CONFIG += psi-minizip");
+ }
return true;
#endif
View
BIN  configure.exe
Binary file not shown
View
77 qcm/zlib.qcm
@@ -26,41 +26,66 @@ public:
{
#ifdef Q_OS_WIN
// HACK: on windows, always use psi's bundled zlib
- conf->addExtra("CONFIG += psi-zip");
+ conf->addExtra("CONFIG += psi-winzlib psi-minizip");
return true;
#else
- QString inc, lib;
+ QStringList incs;
+ QString version, libs, other;
QString s;
- s = conf->getenv("QC_WITH_ZLIB_INC");
- if(!s.isEmpty()) {
- if(!conf->checkHeader(s, "zlib.h"))
- return false;
- inc = s;
- }
- else {
- if(!conf->findHeader("zlib.h", QStringList(), &s))
- return false;
- inc = s;
+ if(!conf->findPkgConfig("zlib", VersionAny, "", &version, &incs, &libs, &other)) {
+
+ s = conf->getenv("QC_WITH_ZLIB_INC");
+ if(!s.isEmpty()) {
+ if(!conf->checkHeader(s, "zlib.h"))
+ return false;
+ }
+ else {
+ if(!conf->findHeader("zlib.h", QStringList(), &s))
+ return false;
+ }
+ incs.append(s);
+
+ s = conf->getenv("QC_WITH_ZLIB_LIB");
+ if(!s.isEmpty()) {
+ if(!conf->checkLibrary(s, "z"))
+ return false;
+ }
+ else {
+ if(!conf->findLibrary("z", &s))
+ return false;
+ }
+ libs = QString("-L%1 -lz").arg(s);
}
- s = conf->getenv("QC_WITH_ZLIB_LIB");
- if(!s.isEmpty()) {
- if(!conf->checkLibrary(s, "z"))
- return false;
- lib = s;
+ foreach(const QString &inc, incs) {
+ conf->addIncludePath(inc);
}
- else {
- if(!conf->findLibrary("z", &s))
- return false;
- lib = s;
+ conf->addLib(libs);
+
+ if(!conf->findPkgConfig("minizip", VersionAny, "", &version, &incs, &libs, &other)) {
+
+ s = conf->getenv("QC_WITH_MINIZIP_INC");
+ if ((!s.isEmpty() && conf->checkHeader(s, "unzip.h")) ||
+ (s.isEmpty() && conf->findHeader("unzip.h", QStringList(), &s))) {
+ incs.append(s);
+ }
+
+ s = conf->getenv("QC_WITH_MINIZIP_LIB");
+ if((!s.isEmpty() && conf->checkLibrary(s, "minizip")) ||
+ (s.isEmpty() && conf->findLibrary("minizip", &s))) {
+ libs = QString("-L%1 -lminizip").arg(s);
+ }
}
- if(!inc.isEmpty())
- conf->addIncludePath(inc);
- if(!lib.isEmpty())
- conf->addLib(QString("-L") + s);
- conf->addLib("-lz");
+ if (!incs.isEmpty() && !libs.isEmpty()) {
+ foreach(const QString &inc, incs) {
+ conf->addIncludePath(inc);
+ }
+ conf->addLib(libs);
+ } else {
+ conf->addExtra("CONFIG += psi-minizip");
+ }
return true;
#endif
View
5 src/conf_iris.pri
@@ -13,11 +13,6 @@ else {
CONFIG += crypto
}
-# use zlib from psi if necessary
-psi-zip {
- INCLUDEPATH += $$PWD/libpsi/tools/zip/minizip/win32
-}
-
mac {
# Universal binaries
qc_universal:contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {
2  src/libpsi
@@ -1 +1 @@
-Subproject commit 4d2238ffe20241a84b68bfaee6de60c534f2d6ce
+Subproject commit 41f0aef15397720000e944a44bbdd8e14da0f2d7
Please sign in to comment.
Something went wrong with that request. Please try again.