Always compile sql drivers as plugins

Compiling the drivers into Qt Sql does not make a lot of sense
anymore, as we handle plugins well enough in the build system
these days.

[ChangeLog][Build system] SQL drivers are now always compiled as plugins.

Change-Id: I364b82a480849399d1fafe4b20e9f08922569260
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This commit is contained in:
Lars Knoll 2016-03-18 13:35:40 +01:00
parent 00ca784be6
commit 0452c25aed
51 changed files with 157 additions and 389 deletions

97
configure vendored
View File

@ -845,11 +845,6 @@ CFG_DEFAULT_ANDROID_NDK_HOST=$ANDROID_NDK_HOST
# check SQL drivers available in this package
#-------------------------------------------------------------------------------
# opensource version removes some drivers, so force them to be off
CFG_SQL_tds=no
CFG_SQL_oci=no
CFG_SQL_db2=no
CFG_SQL_AVAILABLE=
if [ -d "$relpath/src/plugins/sqldrivers" ]; then
for a in "$relpath/src/plugins/sqldrivers/"*; do
@ -2073,11 +2068,10 @@ while [ "$#" -gt 0 ]; do
fi
;;
sql-*)
# if Qt style options were used, $VAL can be "no", "qt", or "plugin"
# if autoconf style options were used, $VAL can be "yes" or "no"
[ "$VAL" = "yes" ] && VAL=qt
# now $VAL should be "no", "qt", or "plugin"... double-check
if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
# if Qt style options were used, $VAL can be "no", "yes", or "plugin", plugin for backwards compatibility
[ "$VAL" = "plugin" ] && VAL=yes
# now $VAL should be "yes" or "no"... double-check
if [ "$VAL" != "no" ] && [ "$VAL" != "yes" ]; then
UNKNOWN_OPT=yes
fi
# now $VAL is "no", "qt", or "plugin"
@ -2399,11 +2393,8 @@ Configure options:
which is unsupported.
+ -accessibility ..... Compile Accessibility support.
-no-sql-<driver> ... Disable SQL <driver> entirely.
-qt-sql-<driver> ... Enable a SQL <driver> in the Qt SQL module, by default
none are turned on.
-plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
at run time.
-no-sql-<driver> ... Disable SQL <driver>.
-sql-<driver> Enable SQL <driver> plugin.
Possible values for <driver>:
[$CFG_SQL_AVAILABLE ]
@ -4747,14 +4738,10 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
else
if compileTest unix/mysql_r "MySQL (thread-safe)" $QT_LFLAGS_MYSQL_R $QT_CFLAGS_MYSQL; then
QMakeVar add CONFIG use_libmysqlclient_r
if [ "$CFG_SQL_mysql" = "auto" ]; then
CFG_SQL_mysql=plugin
fi
CFG_SQL_mysql=yes
QT_LFLAGS_MYSQL="$QT_LFLAGS_MYSQL_R"
elif compileTest unix/mysql "MySQL (thread-unsafe)" $QT_LFLAGS_MYSQL $QT_CFLAGS_MYSQL; then
if [ "$CFG_SQL_mysql" = "auto" ]; then
CFG_SQL_mysql=plugin
fi
CFG_SQL_mysql=yes
else
if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "MySQL support cannot be enabled due to functionality tests!"
@ -4785,9 +4772,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
# But, respect PSQL_LIBS if set
[ -z "$PSQL_LIBS" ] || QT_LFLAGS_PSQL="$PSQL_LIBS"
if compileTest unix/psql "PostgreSQL" $QT_LFLAGS_PSQL $QT_CFLAGS_PSQL; then
if [ "$CFG_SQL_psql" = "auto" ]; then
CFG_SQL_psql=plugin
fi
CFG_SQL_psql=yes
else
if [ "$CFG_SQL_psql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "PostgreSQL support cannot be enabled due to functionality tests!"
@ -4806,15 +4791,11 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
odbc)
if [ "$CFG_SQL_odbc" != "no" ]; then
if [ "$XPLATFORM_MAC" != "yes" ] && compileTest unix/odbc "ODBC"; then
if [ "$CFG_SQL_odbc" = "auto" ]; then
CFG_SQL_odbc=plugin
fi
CFG_SQL_odbc=yes
else
if compileTest unix/iodbc "iODBC"; then
QT_LFLAGS_ODBC="-liodbc"
if [ "$CFG_SQL_odbc" = "auto" ]; then
CFG_SQL_odbc=plugin
fi
CFG_SQL_odbc=yes
else
if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "ODBC support cannot be enabled due to functionality tests!"
@ -4832,9 +4813,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
oci)
if [ "$CFG_SQL_oci" != "no" ]; then
if compileTest unix/oci "OCI"; then
if [ "$CFG_SQL_oci" = "auto" ]; then
CFG_SQL_oci=plugin
fi
CFG_SQL_oci=yes
else
if [ "$CFG_SQL_oci" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "Oracle (OCI) support cannot be enabled due to functionality tests!"
@ -4853,9 +4832,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
[ -z "$SYBASE" ] || QT_LFLAGS_TDS="-L$SYBASE/lib"
[ -z "$SYBASE_LIBS" ] || QT_LFLAGS_TDS="$QT_LFLAGS_TDS $SYBASE_LIBS"
if compileTest unix/tds "TDS" $QT_LFLAGS_TDS; then
if [ "$CFG_SQL_tds" = "auto" ]; then
CFG_SQL_tds=plugin
fi
CFG_SQL_tds=yes
else
if [ "$CFG_SQL_tds" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "TDS support cannot be enabled due to functionality tests!"
@ -4872,9 +4849,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
db2)
if [ "$CFG_SQL_db2" != "no" ]; then
if compileTest unix/db2 "DB2"; then
if [ "$CFG_SQL_db2" = "auto" ]; then
CFG_SQL_db2=plugin
fi
CFG_SQL_db2=yes
else
if [ "$CFG_SQL_db2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "ODBC support cannot be enabled due to functionality tests!"
@ -4891,9 +4866,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
ibase)
if [ "$CFG_SQL_ibase" != "no" ]; then
if compileTest unix/ibase "InterBase"; then
if [ "$CFG_SQL_ibase" = "auto" ]; then
CFG_SQL_ibase=plugin
fi
CFG_SQL_ibase=yes
else
if [ "$CFG_SQL_ibase" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "InterBase support cannot be enabled due to functionality tests!"
@ -4910,9 +4883,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
sqlite2)
if [ "$CFG_SQL_sqlite2" != "no" ]; then
if compileTest unix/sqlite2 "SQLite2"; then
if [ "$CFG_SQL_sqlite2" = "auto" ]; then
CFG_SQL_sqlite2=plugin
fi
CFG_SQL_sqlite2=yes
else
if [ "$CFG_SQL_sqlite2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "SQLite2 support cannot be enabled due to functionality tests!"
@ -4938,18 +4909,14 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
QT_LFLAGS_SQLITE="-lsqlite3 -lz"
fi
if compileTest unix/sqlite "SQLite" $QT_LFLAGS_SQLITE $QT_CFLAGS_SQLITE; then
if [ "$CFG_SQL_sqlite" = "auto" ]; then
CFG_SQL_sqlite=plugin
fi
CFG_SQL_sqlite=yes
QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
else
SQLITE_AUTODETECT_FAILED="yes"
CFG_SQL_sqlite=no
fi
elif [ -f "$relpath/src/3rdparty/sqlite/sqlite3.h" ]; then
if [ "$CFG_SQL_sqlite" = "auto" ]; then
CFG_SQL_sqlite=plugin
fi
CFG_SQL_sqlite=yes
else
SQLITE_AUTODETECT_FAILED="yes"
CFG_SQL_sqlite=no
@ -6636,20 +6603,12 @@ QCONFIG_FLAGS="$QCONFIG_FLAGS"
# Add turned on SQL drivers
for DRIVER in $CFG_SQL_AVAILABLE; do
eval "VAL=\$CFG_SQL_$DRIVER"
case "$VAL" in
qt)
ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
if [ "$VAL" = "yes" ]; then
SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
;;
plugin)
SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
;;
esac
fi
done
QMakeVar set sql-drivers "$SQL_DRIVERS"
QMakeVar set sql-plugins "$SQL_PLUGINS"
# Add other configuration options to the qconfig.h file
[ "$CFG_GIF" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_GIF"
@ -7188,15 +7147,15 @@ if [ "$XPLATFORM_QNX" = "yes" ]; then
report_support " LGMON .................." "$CFG_LGMON"
fi
report_support " SQL drivers:"
report_support " DB2 .................." "$CFG_SQL_db2" plugin "plugin" yes "built into QtSql"
report_support " InterBase ............" "$CFG_SQL_ibase" plugin "plugin" yes "built into QtSql"
report_support " MySQL ................" "$CFG_SQL_mysql" plugin "plugin" yes "built into QtSql"
report_support " OCI .................." "$CFG_SQL_oci" plugin "plugin" yes "built into QtSql"
report_support " ODBC ................." "$CFG_SQL_odbc" plugin "plugin" yes "built into QtSql"
report_support " PostgreSQL ..........." "$CFG_SQL_psql" plugin "plugin" yes "built into QtSql"
report_support " SQLite 2 ............." "$CFG_SQL_sqlite2" plugin "plugin" yes "built into QtSql"
report_support " DB2 .................." "$CFG_SQL_db2"
report_support " InterBase ............" "$CFG_SQL_ibase"
report_support " MySQL ................" "$CFG_SQL_mysql"
report_support " OCI .................." "$CFG_SQL_oci"
report_support " ODBC ................." "$CFG_SQL_odbc"
report_support " PostgreSQL ..........." "$CFG_SQL_psql"
report_support " SQLite 2 ............." "$CFG_SQL_sqlite2"
report_support_plugin " SQLite ..............." "$CFG_SQL_sqlite" "$CFG_SQLITE" QtSql
report_support " TDS .................." "$CFG_SQL_tds" plugin "plugin" yes "built into QtSql"
report_support " TDS .................." "$CFG_SQL_tds"
report_support " tslib .................." "$CFG_TSLIB"
report_support " udev ..................." "$CFG_LIBUDEV"
report_support " xkbcommon-x11..........." "$CFG_XKBCOMMON" system "system library" qt "bundled copy, XKB config root: $CFG_XKB_CONFIG_ROOT"

View File

@ -1,8 +1,15 @@
TARGET = qsqldb2
SOURCES = main.cpp
HEADERS += $$PWD/qsql_db2_p.h
SOURCES += $$PWD/qsql_db2.cpp $$PWD/main.cpp
unix {
!contains(LIBS, .*db2.*):LIBS += -ldb2
} else {
!contains(LIBS, .*db2.*):LIBS += -ldb2cli
}
OTHER_FILES += db2.json
include(../../../sql/drivers/db2/qsql_db2.pri)
PLUGIN_CLASS_NAME = QDB2DriverPlugin
include(../qsqldriverbase.pri)

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/db2/qsql_db2_p.h"
#include "qsql_db2_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,17 @@
TARGET = qsqlibase
SOURCES = main.cpp
HEADERS += $$PWD/qsql_ibase_p.h
SOURCES += $$PWD/qsql_ibase.cpp $$PWD/main.cpp
unix {
!contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
} else {
!contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
LIBS += -lgds32_ms
}
}
OTHER_FILES += ibase.json
include(../../../sql/drivers/ibase/qsql_ibase.pri)
PLUGIN_CLASS_NAME = QIBaseDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/ibase/qsql_ibase_p.h"
#include "qsql_ibase_p.h"
QT_BEGIN_NAMESPACE

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/mysql/qsql_mysql_p.h"
#include "qsql_mysql_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,23 @@
TARGET = qsqlmysql
SOURCES = main.cpp
HEADERS += $$PWD/qsql_mysql_p.h
SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
LIBS += $$QT_LFLAGS_MYSQL
unix {
isEmpty(QT_LFLAGS_MYSQL) {
!contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
use_libmysqlclient_r:LIBS += -lmysqlclient_r
else:LIBS += -lmysqlclient
}
}
} else {
!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS += -llibmysql
}
OTHER_FILES += mysql.json
include(../../../sql/drivers/mysql/qsql_mysql.pri)
PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/oci/qsql_oci_p.h"
#include "qsql_oci_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,16 @@
TARGET = qsqloci
SOURCES = main.cpp
HEADERS += $$PWD/qsql_oci_p.h
SOURCES += $$PWD/qsql_oci.cpp $$PWD/main.cpp
unix {
!contains(LIBS, .*clnts.*):LIBS += -lclntsh
} else {
LIBS *= -loci
}
darwin:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
OTHER_FILES += oci.json
include(../../../sql/drivers/oci/qsql_oci.pri)
PLUGIN_CLASS_NAME = QOCIDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/odbc/qsql_odbc_p.h"
#include "qsql_odbc_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,19 @@
TARGET = qsqlodbc
SOURCES = main.cpp
HEADERS += $$PWD/qsql_odbc_p.h
SOURCES += $$PWD/qsql_odbc.cpp $$PWD/main.cpp
unix {
DEFINES += UNICODE
!contains(LIBS, .*odbc.*) {
osx:LIBS += -liodbc
else:LIBS += $$QT_LFLAGS_ODBC
}
} else {
LIBS *= -lodbc32
}
OTHER_FILES += odbc.json
include(../../../sql/drivers/odbc/qsql_odbc.pri)
PLUGIN_CLASS_NAME = QODBCDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/psql/qsql_psql_p.h"
#include "qsql_psql_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,17 @@
TARGET = qsqlpsql
SOURCES = main.cpp
HEADERS += $$PWD/qsql_psql_p.h
SOURCES += $$PWD/qsql_psql.cpp $$PWD/main.cpp
unix|mingw {
LIBS += $$QT_LFLAGS_PSQL
!contains(LIBS, .*pq.*):LIBS += -lpq
QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
} else {
!contains(LIBS, .*pq.*):LIBS += -llibpq -lws2_32 -ladvapi32
}
OTHER_FILES += psql.json
include(../../../sql/drivers/psql/qsql_psql.pri)
PLUGIN_CLASS_NAME = QPSQLDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -1,11 +1,11 @@
TEMPLATE = subdirs
contains(sql-plugins, psql) : SUBDIRS += psql
contains(sql-plugins, mysql) : SUBDIRS += mysql
contains(sql-plugins, odbc) : SUBDIRS += odbc
contains(sql-plugins, tds) : SUBDIRS += tds
contains(sql-plugins, oci) : SUBDIRS += oci
contains(sql-plugins, db2) : SUBDIRS += db2
contains(sql-plugins, sqlite) : SUBDIRS += sqlite
contains(sql-plugins, sqlite2) : SUBDIRS += sqlite2
contains(sql-plugins, ibase) : SUBDIRS += ibase
contains(sql-drivers, psql) : SUBDIRS += psql
contains(sql-drivers, mysql) : SUBDIRS += mysql
contains(sql-drivers, odbc) : SUBDIRS += odbc
contains(sql-drivers, tds) : SUBDIRS += tds
contains(sql-drivers, oci) : SUBDIRS += oci
contains(sql-drivers, db2) : SUBDIRS += db2
contains(sql-drivers, sqlite) : SUBDIRS += sqlite
contains(sql-drivers, sqlite2) : SUBDIRS += sqlite2
contains(sql-drivers, ibase) : SUBDIRS += ibase

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../../src/sql/drivers/sqlite/qsql_sqlite_p.h"
#include "qsql_sqlite_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,16 @@
TARGET = qsqlite
SOURCES = smain.cpp
HEADERS += $$PWD/qsql_sqlite_p.h
SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
!system-sqlite:!contains(LIBS, .*sqlite3.*) {
include($$PWD/../../../3rdparty/sqlite.pri)
} else {
LIBS += $$QT_LFLAGS_SQLITE
QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
}
OTHER_FILES += sqlite.json
include(../../../sql/drivers/sqlite/qsql_sqlite.pri)
PLUGIN_CLASS_NAME = QSQLiteDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -39,7 +39,7 @@
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../../src/sql/drivers/sqlite2/qsql_sqlite2_p.h"
#include "qsql_sqlite2_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,11 @@
TARGET = qsqlite2
SOURCES = smain.cpp
HEADERS += $$PWD/qsql_sqlite2_p.h
SOURCES += $$PWD/qsql_sqlite2.cpp $$PWD/smain.cpp
!contains(LIBS, .*sqlite.*):LIBS += -lsqlite
OTHER_FILES += sqlite2.json
include(../../../sql/drivers/sqlite2/qsql_sqlite2.pri)
PLUGIN_CLASS_NAME = QSQLite2DriverPlugin
include(../qsqldriverbase.pri)

View File

@ -45,7 +45,7 @@
#define _WINSCARD_H_
#include <windows.h>
#endif
#include "../../../sql/drivers/tds/qsql_tds_p.h"
#include "qsql_tds_p.h"
QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,17 @@
TARGET = qsqltds
SOURCES = main.cpp
HEADERS += $$PWD/qsql_tds_p.h
SOURCES += $$PWD/qsql_tds.cpp $$PWD/main.cpp
unix|mingw: {
LIBS += $$QT_LFLAGS_TDS
!contains(LIBS, .*sybdb.*):LIBS += -lsybdb
QMAKE_CXXFLAGS *= $$QT_CFLAGS_TDS
} else {
LIBS *= -lNTWDBLIB
}
OTHER_FILES += tds.json
include(../../../sql/drivers/tds/qsql_tds.pri)
PLUGIN_CLASS_NAME = QTDSDriverPlugin
include(../qsqldriverbase.pri)

View File

@ -1,8 +0,0 @@
HEADERS += $$PWD/qsql_db2_p.h
SOURCES += $$PWD/qsql_db2.cpp
unix {
!contains(LIBS, .*db2.*):LIBS += -ldb2
} else {
!contains(LIBS, .*db2.*):LIBS += -ldb2cli
}

View File

@ -1,11 +0,0 @@
contains(sql-drivers, all):sql-driver += psql mysql odbc oci tds db2 sqlite ibase
contains(sql-drivers, psql):include($$PWD/psql/qsql_psql.pri)
contains(sql-drivers, mysql):include($$PWD/mysql/qsql_mysql.pri)
contains(sql-drivers, odbc):include($$PWD/odbc/qsql_odbc.pri)
contains(sql-drivers, oci):include($$PWD/oci/qsql_oci.pri)
contains(sql-drivers, tds):include($$PWD/tds/qsql_tds.pri)
contains(sql-drivers, db2):include($$PWD/db2/qsql_db2.pri)
contains(sql-drivers, ibase):include($$PWD/ibase/qsql_ibase.pri)
contains(sql-drivers, sqlite2):include($$PWD/sqlite2/qsql_sqlite2.pri)
contains(sql-drivers, sqlite):include($$PWD/sqlite/qsql_sqlite.pri)

View File

@ -1,10 +0,0 @@
HEADERS += $$PWD/qsql_ibase_p.h
SOURCES += $$PWD/qsql_ibase.cpp
unix {
!contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
} else {
!contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
LIBS += -lgds32_ms
}
}

View File

@ -1,16 +0,0 @@
HEADERS += $$PWD/qsql_mysql_p.h
SOURCES += $$PWD/qsql_mysql.cpp
QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
LIBS += $$QT_LFLAGS_MYSQL
unix {
isEmpty(QT_LFLAGS_MYSQL) {
!contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
use_libmysqlclient_r:LIBS += -lmysqlclient_r
else:LIBS += -lmysqlclient
}
}
} else {
!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS += -llibmysql
}

View File

@ -1,9 +0,0 @@
HEADERS += $$PWD/qsql_oci_p.h
SOURCES += $$PWD/qsql_oci.cpp
unix {
!contains(LIBS, .*clnts.*):LIBS += -lclntsh
} else {
LIBS *= -loci
}
mac:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ

View File

@ -1,12 +0,0 @@
HEADERS += $$PWD/qsql_odbc_p.h
SOURCES += $$PWD/qsql_odbc.cpp
unix {
DEFINES += UNICODE
!contains(LIBS, .*odbc.*) {
macx:LIBS += -liodbc
else:LIBS += $$QT_LFLAGS_ODBC
}
} else {
LIBS *= -lodbc32
}

View File

@ -1,10 +0,0 @@
HEADERS += $$PWD/qsql_psql_p.h
SOURCES += $$PWD/qsql_psql.cpp
unix|mingw {
LIBS += $$QT_LFLAGS_PSQL
!contains(LIBS, .*pq.*):LIBS += -lpq
QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
} else {
!contains(LIBS, .*pq.*):LIBS += -llibpq -lws2_32 -ladvapi32
}

View File

@ -1,9 +0,0 @@
HEADERS += $$PWD/qsql_sqlite_p.h
SOURCES += $$PWD/qsql_sqlite.cpp
!system-sqlite:!contains(LIBS, .*sqlite3.*) {
include($$PWD/../../../3rdparty/sqlite.pri)
} else {
LIBS += $$QT_LFLAGS_SQLITE
QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
}

View File

@ -1,4 +0,0 @@
HEADERS += $$PWD/qsql_sqlite2_p.h
SOURCES += $$PWD/qsql_sqlite2.cpp
!contains(LIBS, .*sqlite.*):LIBS += -lsqlite

View File

@ -1,10 +0,0 @@
HEADERS += $$PWD/qsql_tds_p.h
SOURCES += $$PWD/qsql_tds.cpp
unix|mingw: {
LIBS += $$QT_LFLAGS_TDS
!contains(LIBS, .*sybdb.*):LIBS += -lsybdb
QMAKE_CXXFLAGS *= $$QT_CFLAGS_TDS
} else {
LIBS *= -lNTWDBLIB
}

View File

@ -39,51 +39,6 @@
#include "qsqldatabase.h"
#include "qsqlquery.h"
#ifdef Q_OS_WIN32
// Conflicting declarations of LPCBYTE in sqlfront.h and winscard.h
#define _WINSCARD_H_
#endif
#ifdef QT_SQL_PSQL
#include "../drivers/psql/qsql_psql_p.h"
#endif
#ifdef QT_SQL_MYSQL
#include "../drivers/mysql/qsql_mysql_p.h"
#endif
#ifdef QT_SQL_ODBC
#include "../drivers/odbc/qsql_odbc_p.h"
#endif
#ifdef QT_SQL_OCI
#include "../drivers/oci/qsql_oci_p.h"
#endif
#ifdef QT_SQL_TDS
// conflicting RETCODE typedef between odbc and freetds
#define RETCODE DBRETCODE
#include "../drivers/tds/qsql_tds_p.h"
#undef RETCODE
#endif
#ifdef QT_SQL_DB2
#include "../drivers/db2/qsql_db2_p.h"
#endif
#ifdef QT_SQL_SQLITE
#include "../drivers/sqlite/qsql_sqlite_p.h"
#endif
#ifdef QT_SQL_SQLITE2
#include "../drivers/sqlite2/qsql_sqlite2_p.h"
#endif
#ifdef QT_SQL_IBASE
#undef SQL_FLOAT // avoid clash with ODBC
#undef SQL_DOUBLE
#undef SQL_TIMESTAMP
#undef SQL_TYPE_TIME
#undef SQL_TYPE_DATE
#undef SQL_DATE
#define SCHAR IBASE_SCHAR // avoid clash with ODBC (older versions of ibase.h with Firebird)
#include "../drivers/ibase/qsql_ibase_p.h"
#undef SCHAR
#endif
#include "qdebug.h"
#include "qcoreapplication.h"
#include "qreadwritelock.h"
@ -542,39 +497,6 @@ QStringList QSqlDatabase::drivers()
{
QStringList list;
#ifdef QT_SQL_PSQL
list << QLatin1String("QPSQL7");
list << QLatin1String("QPSQL");
#endif
#ifdef QT_SQL_MYSQL
list << QLatin1String("QMYSQL3");
list << QLatin1String("QMYSQL");
#endif
#ifdef QT_SQL_ODBC
list << QLatin1String("QODBC3");
list << QLatin1String("QODBC");
#endif
#ifdef QT_SQL_OCI
list << QLatin1String("QOCI8");
list << QLatin1String("QOCI");
#endif
#ifdef QT_SQL_TDS
list << QLatin1String("QTDS7");
list << QLatin1String("QTDS");
#endif
#ifdef QT_SQL_DB2
list << QLatin1String("QDB2");
#endif
#ifdef QT_SQL_SQLITE
list << QLatin1String("QSQLITE");
#endif
#ifdef QT_SQL_SQLITE2
list << QLatin1String("QSQLITE2");
#endif
#ifdef QT_SQL_IBASE
list << QLatin1String("QIBASE");
#endif
if (QFactoryLoader *fl = loader()) {
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
@ -725,45 +647,6 @@ void QSqlDatabasePrivate::init(const QString &type)
{
drvName = type;
if (!driver) {
#ifdef QT_SQL_PSQL
if (type == QLatin1String("QPSQL") || type == QLatin1String("QPSQL7"))
driver = new QPSQLDriver();
#endif
#ifdef QT_SQL_MYSQL
if (type == QLatin1String("QMYSQL") || type == QLatin1String("QMYSQL3"))
driver = new QMYSQLDriver();
#endif
#ifdef QT_SQL_ODBC
if (type == QLatin1String("QODBC") || type == QLatin1String("QODBC3"))
driver = new QODBCDriver();
#endif
#ifdef QT_SQL_OCI
if (type == QLatin1String("QOCI") || type == QLatin1String("QOCI8"))
driver = new QOCIDriver();
#endif
#ifdef QT_SQL_TDS
if (type == QLatin1String("QTDS") || type == QLatin1String("QTDS7"))
driver = new QTDSDriver();
#endif
#ifdef QT_SQL_DB2
if (type == QLatin1String("QDB2"))
driver = new QDB2Driver();
#endif
#ifdef QT_SQL_SQLITE
if (type == QLatin1String("QSQLITE"))
driver = new QSQLiteDriver();
#endif
#ifdef QT_SQL_SQLITE2
if (type == QLatin1String("QSQLITE2"))
driver = new QSQLite2Driver();
#endif
#ifdef QT_SQL_IBASE
if (type == QLatin1String("QIBASE"))
driver = new QIBaseDriver();
#endif
}
if (!driver) {
DriverDict dict = QSqlDatabasePrivate::driverDict();
for (DriverDict::const_iterator it = dict.constBegin();

View File

@ -11,7 +11,6 @@ PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
SQL_P = sql
include(kernel/kernel.pri)
include(drivers/drivers.pri)
include(models/models.pri)
MODULE_PLUGIN_TYPES = \

View File

@ -680,67 +680,51 @@ void Configure::parseCmdLine()
}
// Databases ------------------------------------------------
else if (configCmdLine.at(i) == "-qt-sql-mysql")
else if (configCmdLine.at(i) == "-sql-mysql" || configCmdLine.at(i) == "-plugin-sql-mysql")
dictionary[ "SQL_MYSQL" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-mysql")
dictionary[ "SQL_MYSQL" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-mysql")
dictionary[ "SQL_MYSQL" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-odbc")
else if (configCmdLine.at(i) == "-sql-odbc" || configCmdLine.at(i) == "-plugin-sql-odbc")
dictionary[ "SQL_ODBC" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-odbc")
dictionary[ "SQL_ODBC" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-odbc")
dictionary[ "SQL_ODBC" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-oci")
else if (configCmdLine.at(i) == "-sql-oci" || configCmdLine.at(i) == "-plugin-sql-oci")
dictionary[ "SQL_OCI" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-oci")
dictionary[ "SQL_OCI" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-oci")
dictionary[ "SQL_OCI" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-psql")
else if (configCmdLine.at(i) == "-sql-psql" || configCmdLine.at(i) == "-plugin-sql-psql")
dictionary[ "SQL_PSQL" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-psql")
dictionary[ "SQL_PSQL" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-psql")
dictionary[ "SQL_PSQL" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-tds")
else if (configCmdLine.at(i) == "-sql-tds" || configCmdLine.at(i) == "-plugin-sql-tds")
dictionary[ "SQL_TDS" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-tds")
dictionary[ "SQL_TDS" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-tds")
dictionary[ "SQL_TDS" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-db2")
else if (configCmdLine.at(i) == "-sql-db2")
dictionary[ "SQL_DB2" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-db2")
dictionary[ "SQL_DB2" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-db2")
dictionary[ "SQL_DB2" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-sqlite")
else if (configCmdLine.at(i) == "-sql-sqlite" || configCmdLine.at(i) == "-plugin-sql-sqlite")
dictionary[ "SQL_SQLITE" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-sqlite")
dictionary[ "SQL_SQLITE" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-sqlite")
dictionary[ "SQL_SQLITE" ] = "no";
else if (configCmdLine.at(i) == "-system-sqlite")
dictionary[ "SQL_SQLITE_LIB" ] = "system";
else if (configCmdLine.at(i) == "-qt-sql-sqlite2")
else if (configCmdLine.at(i) == "-sql-sqlite2" || configCmdLine.at(i) == "-plugin-sql-sqlite2")
dictionary[ "SQL_SQLITE2" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-sqlite2")
dictionary[ "SQL_SQLITE2" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-sqlite2")
dictionary[ "SQL_SQLITE2" ] = "no";
else if (configCmdLine.at(i) == "-qt-sql-ibase")
else if (configCmdLine.at(i) == "-sql-ibase" || configCmdLine.at(i) == "-plugin-sql-ibase")
dictionary[ "SQL_IBASE" ] = "yes";
else if (configCmdLine.at(i) == "-plugin-sql-ibase")
dictionary[ "SQL_IBASE" ] = "plugin";
else if (configCmdLine.at(i) == "-no-sql-ibase")
dictionary[ "SQL_IBASE" ] = "no";
@ -2000,7 +1984,7 @@ QString Configure::defaultTo(const QString &option)
|| option == "SQL_SQLITE"
|| option == "SQL_SQLITE2"
|| option == "SQL_IBASE")
return "plugin";
return "yes";
}
// By default we do not want to compile OCI driver when compiling with
@ -2691,52 +2675,26 @@ void Configure::generateOutputVars()
// Databases ----------------------------------------------------
if (dictionary[ "SQL_MYSQL" ] == "yes")
qmakeSql += "mysql";
else if (dictionary[ "SQL_MYSQL" ] == "plugin")
qmakeSqlPlugins += "mysql";
if (dictionary[ "SQL_ODBC" ] == "yes")
qmakeSql += "odbc";
else if (dictionary[ "SQL_ODBC" ] == "plugin")
qmakeSqlPlugins += "odbc";
if (dictionary[ "SQL_OCI" ] == "yes")
qmakeSql += "oci";
else if (dictionary[ "SQL_OCI" ] == "plugin")
qmakeSqlPlugins += "oci";
if (dictionary[ "SQL_PSQL" ] == "yes")
qmakeSql += "psql";
else if (dictionary[ "SQL_PSQL" ] == "plugin")
qmakeSqlPlugins += "psql";
if (dictionary[ "SQL_TDS" ] == "yes")
qmakeSql += "tds";
else if (dictionary[ "SQL_TDS" ] == "plugin")
qmakeSqlPlugins += "tds";
if (dictionary[ "SQL_DB2" ] == "yes")
qmakeSql += "db2";
else if (dictionary[ "SQL_DB2" ] == "plugin")
qmakeSqlPlugins += "db2";
if (dictionary[ "SQL_SQLITE2" ] == "yes")
qmakeSql += "sqlite2";
if (dictionary[ "SQL_IBASE" ] == "yes")
qmakeSql += "ibase";
if (dictionary[ "SQL_SQLITE" ] == "yes")
qmakeSql += "sqlite";
else if (dictionary[ "SQL_SQLITE" ] == "plugin")
qmakeSqlPlugins += "sqlite";
if (dictionary[ "SQL_SQLITE_LIB" ] == "system")
qmakeConfig += "system-sqlite";
if (dictionary[ "SQL_SQLITE2" ] == "yes")
qmakeSql += "sqlite2";
else if (dictionary[ "SQL_SQLITE2" ] == "plugin")
qmakeSqlPlugins += "sqlite2";
if (dictionary[ "SQL_IBASE" ] == "yes")
qmakeSql += "ibase";
else if (dictionary[ "SQL_IBASE" ] == "plugin")
qmakeSqlPlugins += "ibase";
// Other options ------------------------------------------------
if (dictionary[ "BUILDALL" ] == "yes") {
qtConfig += "build_all";
@ -2944,8 +2902,6 @@ void Configure::generateOutputVars()
if (!qmakeSql.isEmpty())
qmakeVars += QString("sql-drivers += ") + qmakeSql.join(' ');
if (!qmakeSqlPlugins.isEmpty())
qmakeVars += QString("sql-plugins += ") + qmakeSqlPlugins.join(' ');
if (!qmakeStyles.isEmpty())
qmakeVars += QString("styles += ") + qmakeStyles.join(' ');
if (!qmakeStylePlugins.isEmpty())
@ -3545,15 +3501,6 @@ void Configure::generateConfigfiles()
if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES";
if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2";
if (dictionary["DYNAMICGL"] == "yes") qconfigList += "QT_OPENGL_DYNAMIC";
if (dictionary["SQL_MYSQL"] == "yes") qconfigList += "QT_SQL_MYSQL";
if (dictionary["SQL_ODBC"] == "yes") qconfigList += "QT_SQL_ODBC";
if (dictionary["SQL_OCI"] == "yes") qconfigList += "QT_SQL_OCI";
if (dictionary["SQL_PSQL"] == "yes") qconfigList += "QT_SQL_PSQL";
if (dictionary["SQL_TDS"] == "yes") qconfigList += "QT_SQL_TDS";
if (dictionary["SQL_DB2"] == "yes") qconfigList += "QT_SQL_DB2";
if (dictionary["SQL_SQLITE"] == "yes") qconfigList += "QT_SQL_SQLITE";
if (dictionary["SQL_SQLITE2"] == "yes") qconfigList += "QT_SQL_SQLITE2";
if (dictionary["SQL_IBASE"] == "yes") qconfigList += "QT_SQL_IBASE";
if (dictionary["POSIX_IPC"] == "yes")
qconfigList += "QT_POSIX_IPC";