From 3d5d159ac8ef506e6b1f33822547df0af54bbeb3 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Wed, 17 Feb 2010 16:51:38 +0100 Subject: remove -lz from QT_LFLAGS_PSQL so as to respect qt-zlib QT_LFLAGS_PSQL can introduce -lz. To respect qt-zlib, this must be be removed so that zlib will come from -lQtCore4. Otherwise, linking can fail due to there being two different libraries providing zlib. This affects building shared Qt. This patch fixes the problem for win32-g++ and also unix. Assumed that QT_LFLAGS_PSQL is set in configure step if -lpq is not enough. Not sure why parallel logic is in src/sql/drivers/drivers.pri but I fixed that too. Merge-request: 405 Reviewed-by: Thiago Macieira --- src/plugins/sqldrivers/psql/psql.pro | 11 ++++------- src/sql/drivers/drivers.pri | 13 +++++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro index 29fbada..0a38ee4 100644 --- a/src/plugins/sqldrivers/psql/psql.pro +++ b/src/plugins/sqldrivers/psql/psql.pro @@ -4,18 +4,15 @@ HEADERS = ../../../sql/drivers/psql/qsql_psql.h SOURCES = main.cpp \ ../../../sql/drivers/psql/qsql_psql.cpp -unix: { +unix|win32-g++: { !isEmpty(QT_LFLAGS_PSQL) { - LIBS *= $$QT_LFLAGS_PSQL + !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz + !static:LIBS *= $$QT_LFLAGS_PSQL QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL } !contains(LIBS, .*pq.*):LIBS *= -lpq } -win32:!contains(LIBS, .*pq.* ) { - !win32-g++:LIBS *= -llibpq - win32-g++:LIBS *= -lpq - LIBS *= -lws2_32 -ladvapi32 -} +win32:!win32-g++:!contains(LIBS, .*pq.* ) LIBS *= -llibpq -lws2_32 -ladvapi32 include(../qsqldriverbase.pri) diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri index 184eca9..aac0267 100644 --- a/src/sql/drivers/drivers.pri +++ b/src/sql/drivers/drivers.pri @@ -6,19 +6,16 @@ contains(sql-drivers, psql) { HEADERS += drivers/psql/qsql_psql.h SOURCES += drivers/psql/qsql_psql.cpp - unix { - !isEmpty(QT_LFLAGS_PSQL) { - LIBS *= $$QT_LFLAGS_PSQL + unix|win32-g++ { + !static:!isEmpty(QT_LFLAGS_PSQL) { + !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz + !static:LIBS *= $$QT_LFLAGS_PSQL QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL } !contains(LIBS, .*pq.*):LIBS *= -lpq } - win32 { - !win32-g++:!contains( LIBS, .*pq.* ):LIBS *= -llibpq - win32-g++:!contains( LIBS, .*pq.* ):LIBS *= -lpq - LIBS *= -lws2_32 -ladvapi32 - } + win32:!win32-g++:!contains(LIBS, .*pq.* ) LIBS *= -llibpq -lws2_32 -ladvapi32 } contains(sql-drivers, mysql) { -- cgit v0.12