simplified linking to openssl in package qt

We have been building Qt with "-openssl-linked". A patch was needed to adjust
OPENSSL_LIBS to keep a shared Qt build from failing at the point where
QtNetwork4.dll is linked. The patch is not needed if we use "-openssl" instead.

Because libssl and its dependencies are static libraries in mingw-cross-env,
a simple "-openssl" also causes libssl and dependencies to be embedded
(imported) into QNetwork4.dll, but it does so without requiring the patch.

Details:

The patch solved a problem that is a feature of a specific recipe of
Qt build ingredients:

(1) -shared
(2) -openssl-linked
(3) -qt-zlib

in an environment were:

(4) openssl is static
(5) “system” zlib is static

At least 1-3 are needed to see the problem. I suspect that 4 and 5 are needed as
well.

What I think I understand:

“-shared” means that QtNetwork4.dll will be built, which is the locus of the
problem.

“-openssl-linked” means that libssl and its dependencies are to be embedded in
QtNetwork4.dll. OPENSSL_LIBS supplies the list of dependencies.

“-qt-zlib” means that QtCore4 contains a zlib implementation.

Given this recipe for QtNetwork4.dll, the zlib implementation of “-lz” conflicts
with the zlib implementation of “-lQtCore4”.

The patch removed "-lz" from OPENSSL_LIBS and replaced it with "-lQtCore" in the
same position. Adding "-lQtCore" in this way is not a robust solution. For example,
it will break a debug build.
This commit is contained in:
Mark Brand 2010-02-17 16:56:48 +01:00
parent 644262b033
commit 754f8ef7c3
2 changed files with 1 additions and 17 deletions

View File

@ -547,22 +547,6 @@ index aa36890..f009761 100644
+ unix|win32-g++:LIBS_PRIVATE += -lz
+ win32:!win32-g++:LIBS += zdll.lib
}
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 72ea80f..899aa30 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -35,5 +35,11 @@ symbian {
RESOURCES += network.qrc
# Add optional SSL libs
+ !contains(QT_CONFIG, system-zlib):contains(OPENSSL_LIBS, -lz) {
+ # Use the zlib in QtCore
+ OPENSSL_LIBS -= -lz
+ OPENSSL_LIBS += -lQtCore4
+ }
LIBS_PRIVATE += $$OPENSSL_LIBS
+
}
diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
index ebc79cc..30a19c6 100644
--- a/src/plugins/imageformats/jpeg/jpeg.pro

View File

@ -128,7 +128,7 @@ define $(PKG)_BUILD
-system-libmng \
-system-sqlite \
-qt-gif \
-openssl-linked \
-openssl \
-v
$(MAKE) -C '$(1)' -j '$(JOBS)'