diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-07-26 17:16:29 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-31 11:47:39 +0200 |
commit | 952788d64bc30c7aac5f9572533241ab8f48fb63 (patch) | |
tree | f5a36211886621404f9dc5ad82936522b0751f92 /tools | |
parent | 9a8d74de0abdc87b099e1885f2865e16f104d6d8 (diff) |
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.
Change-Id: Ic27ede2d9531b94aff4c50c1699947ce72caf286
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 35 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 2 |
2 files changed, 30 insertions, 7 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 17864046c9..b2e484d2a8 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -965,6 +965,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=")) { @@ -2608,8 +2612,18 @@ void Configure::generateOutputVars() qmakeVars += QString("INCLUDEPATH += ") + formatPaths(qmakeIncludes); if (!opensslLibs.isEmpty()) qmakeVars += opensslLibs; - else if (dictionary[ "OPENSSL" ] == "linked") - 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()) { + qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); + } + } if (!psqlLibs.isEmpty()) qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1); @@ -3402,11 +3416,18 @@ void Configure::displayConfig() sout << "WARNING: Using static linking will disable the use of plugins." << endl; sout << " Make sure you compile ALL needed modules into the library." << endl; } - if (dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty()) { - sout << "NOTE: When linking against OpenSSL, you can override the default" << endl; - sout << "library names through OPENSSL_LIBS." << endl; - sout << "For example:" << endl; - sout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl; + if (dictionary[ "OPENSSL" ] == "linked") { + if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) { + sout << "Using OpenSSL libraries:" << endl; + sout << " debug : " << opensslLibsDebug << endl; + sout << " release: " << opensslLibsRelease << endl; + sout << " both : " << opensslLibs << endl; + } else if (opensslLibs.isEmpty()) { + sout << "NOTE: When linking against OpenSSL, you can override the default" << endl; + sout << "library names through OPENSSL_LIBS and optionally OPENSSL_LIBS_DEBUG/OPENSSL_LIBS_RELEASE" << endl; + sout << "For example:" << endl; + sout << " 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 ff5050ad8d..7f4cbdb983 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -141,6 +141,8 @@ private: QStringList qmakeIncludes; QStringList qmakeLibs; QString opensslLibs; + QString opensslLibsDebug; + QString opensslLibsRelease; QString psqlLibs; QString sybase; QString sybaseLibs; |