summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/network/ssl/ssl.pri13
-rw-r--r--tools/configure/configureapp.cpp41
-rw-r--r--tools/configure/configureapp.h2
3 files changed, 46 insertions, 10 deletions
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 8b2e2c1..0f4fb67 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -32,5 +32,18 @@ symbian {
ssl/qsslsocket_openssl_symbols.cpp
# Add optional SSL libs
+ # Static linking of OpenSSL with msvc:
+ # - Binaries http://slproweb.com/products/Win32OpenSSL.html
+ # - also needs -lUser32 -lAdvapi32 -lGdi32 -lCrypt32
+ # - libs in <OPENSSL_DIR>\lib\VC\static
+ # - configure: -openssl -openssl-linked -I <OPENSSL_DIR>\include -L <OPENSSL_DIR>\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32 -lCrypt32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD"
+
+ CONFIG(debug, debug|release) {
+ LIBS_PRIVATE += $$OPENSSL_LIBS_DEBUG
+ } else {
+ LIBS_PRIVATE += $$OPENSSL_LIBS_RELEASE
+ }
+
LIBS_PRIVATE += $$OPENSSL_LIBS
+
}
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 55049d3..1a559e9 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1082,6 +1082,10 @@ void Configure::parseCmdLine()
qmakeLibs += QString("-l" + configCmdLine.at(i));
} else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
opensslLibs = configCmdLine.at(i);
+ } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_DEBUG=")) {
+ opensslLibsDebug = configCmdLine.at(i);
+ } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_RELEASE=")) {
+ opensslLibsRelease = configCmdLine.at(i);
} else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) {
psqlLibs = configCmdLine.at(i);
} else if (configCmdLine.at(i).startsWith("SYBASE=")) {
@@ -3032,12 +3036,22 @@ void Configure::generateOutputVars()
qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join(" "));
if (!opensslLibs.isEmpty())
qmakeVars += opensslLibs;
- else if (dictionary[ "OPENSSL" ] == "linked") {
- if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian"))
- qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto");
- else
- qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
+ if (dictionary[ "OPENSSL" ] == "linked") {
+ if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) {
+ if (opensslLibsDebug.isEmpty() || opensslLibsRelease.isEmpty()) {
+ cout << "Error: either both or none of OPENSSL_LIBS_DEBUG/_RELEASE must be defined." << endl;
+ exit(1);
+ }
+ qmakeVars += opensslLibsDebug;
+ qmakeVars += opensslLibsRelease;
+ } else if (opensslLibs.isEmpty()) {
+ if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
+ qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto");
+ } else {
+ qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
+ }
}
+ }
if (!psqlLibs.isEmpty())
qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1);
@@ -3806,11 +3820,18 @@ void Configure::displayConfig()
cout << "WARNING: Using static linking will disable the use of plugins." << endl;
cout << " Make sure you compile ALL needed modules into the library." << endl;
}
- if (dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty()) {
- cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
- cout << "library names through OPENSSL_LIBS." << endl;
- cout << "For example:" << endl;
- cout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
+ if (dictionary[ "OPENSSL" ] == "linked") {
+ if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) {
+ cout << "Using OpenSSL libraries:" << endl;
+ cout << " debug : " << opensslLibsDebug << endl;
+ cout << " release: " << opensslLibsRelease << endl;
+ cout << " both : " << opensslLibs << endl;
+ } else if (opensslLibs.isEmpty()) {
+ cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
+ cout << "library names through OPENSSL_LIBS and optionally OPENSSL_LIBS_DEBUG/OPENSSL_LIBS_RELEASE" << endl;
+ cout << "For example:" << endl;
+ cout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
+ }
}
if (dictionary[ "ZLIB_FORCED" ] == "yes") {
QString which_zlib = "supplied";
diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h
index c3838fb..84c4547 100644
--- a/tools/configure/configureapp.h
+++ b/tools/configure/configureapp.h
@@ -131,6 +131,8 @@ private:
QStringList qmakeIncludes;
QStringList qmakeLibs;
QString opensslLibs;
+ QString opensslLibsDebug;
+ QString opensslLibsRelease;
QString psqlLibs;
QString sybase;
QString sybaseLibs;