diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-07-25 16:57:14 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-15 13:36:33 (GMT) |
commit | 9622b544ad4186ff0d69a0424ed027a0d960b00f (patch) | |
tree | 935a2bc7a1ae870ae040e8342307a477841b3db0 /tools/configure | |
parent | 374c5f5c5ac72f1d564cc780e083b6c30eefb74b (diff) | |
download | Qt-9622b544ad4186ff0d69a0424ed027a0d960b00f.zip Qt-9622b544ad4186ff0d69a0424ed027a0d960b00f.tar.gz Qt-9622b544ad4186ff0d69a0424ed027a0d960b00f.tar.bz2 |
add configure options for debug/release OpenSSL
msvc cannot use the same library for debug and release builds
if openssl libraries are linked statically into the network library.
Backported from 952788d64bc30c7aac5f9572533241ab8f48fb63
Change-Id: I8332b8293a27b6f9bd87ca1e6ebc63327589ab78
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 41 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 2 |
2 files changed, 33 insertions, 10 deletions
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; |