comparison src/qt-win32.patch @ 785:1d651946e889

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.
author Mark Brand <mabrand@mabrand.nl>
date Wed, 17 Feb 2010 16:56:48 +0100
parents 1f5b2dfe8966
children d3d9a4a2843d
comparison
equal deleted inserted replaced
784:f73ec86ea1e1 785:1d651946e889
545 - unix:LIBS_PRIVATE += -lz 545 - unix:LIBS_PRIVATE += -lz
546 -# win32:LIBS += libz.lib 546 -# win32:LIBS += libz.lib
547 + unix|win32-g++:LIBS_PRIVATE += -lz 547 + unix|win32-g++:LIBS_PRIVATE += -lz
548 + win32:!win32-g++:LIBS += zdll.lib 548 + win32:!win32-g++:LIBS += zdll.lib
549 } 549 }
550 diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
551 index 72ea80f..899aa30 100644
552 --- a/src/network/ssl/ssl.pri
553 +++ b/src/network/ssl/ssl.pri
554 @@ -35,5 +35,11 @@ symbian {
555 RESOURCES += network.qrc
556
557 # Add optional SSL libs
558 + !contains(QT_CONFIG, system-zlib):contains(OPENSSL_LIBS, -lz) {
559 + # Use the zlib in QtCore
560 + OPENSSL_LIBS -= -lz
561 + OPENSSL_LIBS += -lQtCore4
562 + }
563 LIBS_PRIVATE += $$OPENSSL_LIBS
564 +
565 }
566 diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro 550 diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
567 index ebc79cc..30a19c6 100644 551 index ebc79cc..30a19c6 100644
568 --- a/src/plugins/imageformats/jpeg/jpeg.pro 552 --- a/src/plugins/imageformats/jpeg/jpeg.pro
569 +++ b/src/plugins/imageformats/jpeg/jpeg.pro 553 +++ b/src/plugins/imageformats/jpeg/jpeg.pro
570 @@ -20,8 +20,8 @@ symbian: { 554 @@ -20,8 +20,8 @@ symbian: {