From 0452c25aedb7d2778e5b26fad924ed61b72bbe33 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 18 Mar 2016 13:35:40 +0100 Subject: [PATCH] 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 Reviewed-by: Mark Brand --- configure | 97 +++++---------- src/plugins/sqldrivers/db2/db2.pro | 11 +- src/plugins/sqldrivers/db2/main.cpp | 2 +- .../sqldrivers}/db2/qsql_db2.cpp | 0 .../sqldrivers}/db2/qsql_db2_p.h | 0 src/plugins/sqldrivers/ibase/ibase.pro | 13 +- src/plugins/sqldrivers/ibase/main.cpp | 2 +- .../sqldrivers}/ibase/qsql_ibase.cpp | 0 .../sqldrivers}/ibase/qsql_ibase_p.h | 0 src/plugins/sqldrivers/mysql/main.cpp | 2 +- src/plugins/sqldrivers/mysql/mysql.pro | 19 ++- .../sqldrivers}/mysql/qsql_mysql.cpp | 0 .../sqldrivers}/mysql/qsql_mysql_p.h | 0 src/plugins/sqldrivers/oci/main.cpp | 2 +- src/plugins/sqldrivers/oci/oci.pro | 12 +- .../sqldrivers}/oci/qsql_oci.cpp | 0 .../sqldrivers}/oci/qsql_oci_p.h | 0 src/plugins/sqldrivers/odbc/main.cpp | 2 +- src/plugins/sqldrivers/odbc/odbc.pro | 15 ++- .../sqldrivers}/odbc/qsql_odbc.cpp | 0 .../sqldrivers}/odbc/qsql_odbc_p.h | 0 src/plugins/sqldrivers/psql/main.cpp | 2 +- src/plugins/sqldrivers/psql/psql.pro | 13 +- .../sqldrivers}/psql/qsql_psql.cpp | 0 .../sqldrivers}/psql/qsql_psql_p.h | 0 src/plugins/sqldrivers/sqldrivers.pro | 18 +-- .../sqldrivers}/sqlite/qsql_sqlite.cpp | 0 .../sqldrivers}/sqlite/qsql_sqlite_p.h | 0 src/plugins/sqldrivers/sqlite/smain.cpp | 2 +- src/plugins/sqldrivers/sqlite/sqlite.pro | 12 +- .../sqldrivers}/sqlite2/qsql_sqlite2.cpp | 0 .../sqldrivers}/sqlite2/qsql_sqlite2_p.h | 0 src/plugins/sqldrivers/sqlite2/smain.cpp | 2 +- src/plugins/sqldrivers/sqlite2/sqlite2.pro | 7 +- src/plugins/sqldrivers/tds/main.cpp | 2 +- .../sqldrivers}/tds/qsql_tds.cpp | 0 .../sqldrivers}/tds/qsql_tds_p.h | 0 src/plugins/sqldrivers/tds/tds.pro | 13 +- src/sql/drivers/db2/qsql_db2.pri | 8 -- src/sql/drivers/drivers.pri | 11 -- src/sql/drivers/ibase/qsql_ibase.pri | 10 -- src/sql/drivers/mysql/qsql_mysql.pri | 16 --- src/sql/drivers/oci/qsql_oci.pri | 9 -- src/sql/drivers/odbc/qsql_odbc.pri | 12 -- src/sql/drivers/psql/qsql_psql.pri | 10 -- src/sql/drivers/sqlite/qsql_sqlite.pri | 9 -- src/sql/drivers/sqlite2/qsql_sqlite2.pri | 4 - src/sql/drivers/tds/qsql_tds.pri | 10 -- src/sql/kernel/qsqldatabase.cpp | 117 ------------------ src/sql/sql.pro | 1 - tools/configure/configureapp.cpp | 81 +++--------- 51 files changed, 157 insertions(+), 389 deletions(-) rename src/{sql/drivers => plugins/sqldrivers}/db2/qsql_db2.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/db2/qsql_db2_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/ibase/qsql_ibase.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/ibase/qsql_ibase_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/mysql/qsql_mysql.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/mysql/qsql_mysql_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/oci/qsql_oci.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/oci/qsql_oci_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/odbc/qsql_odbc.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/odbc/qsql_odbc_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/psql/qsql_psql.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/psql/qsql_psql_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/sqlite/qsql_sqlite.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/sqlite/qsql_sqlite_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/sqlite2/qsql_sqlite2.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/sqlite2/qsql_sqlite2_p.h (100%) rename src/{sql/drivers => plugins/sqldrivers}/tds/qsql_tds.cpp (100%) rename src/{sql/drivers => plugins/sqldrivers}/tds/qsql_tds_p.h (100%) delete mode 100644 src/sql/drivers/db2/qsql_db2.pri delete mode 100644 src/sql/drivers/drivers.pri delete mode 100644 src/sql/drivers/ibase/qsql_ibase.pri delete mode 100644 src/sql/drivers/mysql/qsql_mysql.pri delete mode 100644 src/sql/drivers/oci/qsql_oci.pri delete mode 100644 src/sql/drivers/odbc/qsql_odbc.pri delete mode 100644 src/sql/drivers/psql/qsql_psql.pri delete mode 100644 src/sql/drivers/sqlite/qsql_sqlite.pri delete mode 100644 src/sql/drivers/sqlite2/qsql_sqlite2.pri delete mode 100644 src/sql/drivers/tds/qsql_tds.pri diff --git a/configure b/configure index a75fcc8b58..e94c5b0fba 100755 --- a/configure +++ b/configure @@ -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- ... Disable SQL entirely. - -qt-sql- ... Enable a SQL in the Qt SQL module, by default - none are turned on. - -plugin-sql- Enable SQL as a plugin to be linked to - at run time. + -no-sql- ... Disable SQL . + -sql- Enable SQL plugin. Possible values for : [$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" diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro index 2365c5bc0e..31822ef8dc 100644 --- a/src/plugins/sqldrivers/db2/db2.pro +++ b/src/plugins/sqldrivers/db2/db2.pro @@ -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) diff --git a/src/plugins/sqldrivers/db2/main.cpp b/src/plugins/sqldrivers/db2/main.cpp index 3869d7798d..97338b8eef 100644 --- a/src/plugins/sqldrivers/db2/main.cpp +++ b/src/plugins/sqldrivers/db2/main.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../sql/drivers/db2/qsql_db2_p.h" +#include "qsql_db2_p.h" QT_BEGIN_NAMESPACE diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/plugins/sqldrivers/db2/qsql_db2.cpp similarity index 100% rename from src/sql/drivers/db2/qsql_db2.cpp rename to src/plugins/sqldrivers/db2/qsql_db2.cpp diff --git a/src/sql/drivers/db2/qsql_db2_p.h b/src/plugins/sqldrivers/db2/qsql_db2_p.h similarity index 100% rename from src/sql/drivers/db2/qsql_db2_p.h rename to src/plugins/sqldrivers/db2/qsql_db2_p.h diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro index 1f29597a2b..8237245183 100644 --- a/src/plugins/sqldrivers/ibase/ibase.pro +++ b/src/plugins/sqldrivers/ibase/ibase.pro @@ -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) diff --git a/src/plugins/sqldrivers/ibase/main.cpp b/src/plugins/sqldrivers/ibase/main.cpp index c6f0b785de..8d462afcdc 100644 --- a/src/plugins/sqldrivers/ibase/main.cpp +++ b/src/plugins/sqldrivers/ibase/main.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../sql/drivers/ibase/qsql_ibase_p.h" +#include "qsql_ibase_p.h" QT_BEGIN_NAMESPACE diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp similarity index 100% rename from src/sql/drivers/ibase/qsql_ibase.cpp rename to src/plugins/sqldrivers/ibase/qsql_ibase.cpp diff --git a/src/sql/drivers/ibase/qsql_ibase_p.h b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h similarity index 100% rename from src/sql/drivers/ibase/qsql_ibase_p.h rename to src/plugins/sqldrivers/ibase/qsql_ibase_p.h diff --git a/src/plugins/sqldrivers/mysql/main.cpp b/src/plugins/sqldrivers/mysql/main.cpp index 855a6eeb9c..00d9c5bb34 100644 --- a/src/plugins/sqldrivers/mysql/main.cpp +++ b/src/plugins/sqldrivers/mysql/main.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../sql/drivers/mysql/qsql_mysql_p.h" +#include "qsql_mysql_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro index c917bfca48..442ad7f5a4 100644 --- a/src/plugins/sqldrivers/mysql/mysql.pro +++ b/src/plugins/sqldrivers/mysql/mysql.pro @@ -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) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp similarity index 100% rename from src/sql/drivers/mysql/qsql_mysql.cpp rename to src/plugins/sqldrivers/mysql/qsql_mysql.cpp diff --git a/src/sql/drivers/mysql/qsql_mysql_p.h b/src/plugins/sqldrivers/mysql/qsql_mysql_p.h similarity index 100% rename from src/sql/drivers/mysql/qsql_mysql_p.h rename to src/plugins/sqldrivers/mysql/qsql_mysql_p.h diff --git a/src/plugins/sqldrivers/oci/main.cpp b/src/plugins/sqldrivers/oci/main.cpp index 980116123d..e576928d31 100644 --- a/src/plugins/sqldrivers/oci/main.cpp +++ b/src/plugins/sqldrivers/oci/main.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../sql/drivers/oci/qsql_oci_p.h" +#include "qsql_oci_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro index 96a0dd9ab6..a22d1181bf 100644 --- a/src/plugins/sqldrivers/oci/oci.pro +++ b/src/plugins/sqldrivers/oci/oci.pro @@ -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) diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp similarity index 100% rename from src/sql/drivers/oci/qsql_oci.cpp rename to src/plugins/sqldrivers/oci/qsql_oci.cpp diff --git a/src/sql/drivers/oci/qsql_oci_p.h b/src/plugins/sqldrivers/oci/qsql_oci_p.h similarity index 100% rename from src/sql/drivers/oci/qsql_oci_p.h rename to src/plugins/sqldrivers/oci/qsql_oci_p.h diff --git a/src/plugins/sqldrivers/odbc/main.cpp b/src/plugins/sqldrivers/odbc/main.cpp index 69ea7b1f8e..ac63941a82 100644 --- a/src/plugins/sqldrivers/odbc/main.cpp +++ b/src/plugins/sqldrivers/odbc/main.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../sql/drivers/odbc/qsql_odbc_p.h" +#include "qsql_odbc_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro index c0020c065f..e002f06576 100644 --- a/src/plugins/sqldrivers/odbc/odbc.pro +++ b/src/plugins/sqldrivers/odbc/odbc.pro @@ -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) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp similarity index 100% rename from src/sql/drivers/odbc/qsql_odbc.cpp rename to src/plugins/sqldrivers/odbc/qsql_odbc.cpp diff --git a/src/sql/drivers/odbc/qsql_odbc_p.h b/src/plugins/sqldrivers/odbc/qsql_odbc_p.h similarity index 100% rename from src/sql/drivers/odbc/qsql_odbc_p.h rename to src/plugins/sqldrivers/odbc/qsql_odbc_p.h diff --git a/src/plugins/sqldrivers/psql/main.cpp b/src/plugins/sqldrivers/psql/main.cpp index eae1c1c554..7657fcbfdf 100644 --- a/src/plugins/sqldrivers/psql/main.cpp +++ b/src/plugins/sqldrivers/psql/main.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../sql/drivers/psql/qsql_psql_p.h" +#include "qsql_psql_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro index 0fabe0e616..43eebab7d3 100644 --- a/src/plugins/sqldrivers/psql/psql.pro +++ b/src/plugins/sqldrivers/psql/psql.pro @@ -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) diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp similarity index 100% rename from src/sql/drivers/psql/qsql_psql.cpp rename to src/plugins/sqldrivers/psql/qsql_psql.cpp diff --git a/src/sql/drivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h similarity index 100% rename from src/sql/drivers/psql/qsql_psql_p.h rename to src/plugins/sqldrivers/psql/qsql_psql_p.h diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro index 39c58d4f2b..37dbd2394e 100644 --- a/src/plugins/sqldrivers/sqldrivers.pro +++ b/src/plugins/sqldrivers/sqldrivers.pro @@ -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 diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp similarity index 100% rename from src/sql/drivers/sqlite/qsql_sqlite.cpp rename to src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp diff --git a/src/sql/drivers/sqlite/qsql_sqlite_p.h b/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h similarity index 100% rename from src/sql/drivers/sqlite/qsql_sqlite_p.h rename to src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h diff --git a/src/plugins/sqldrivers/sqlite/smain.cpp b/src/plugins/sqldrivers/sqlite/smain.cpp index 94b41c9878..2ad466a61e 100644 --- a/src/plugins/sqldrivers/sqlite/smain.cpp +++ b/src/plugins/sqldrivers/sqlite/smain.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../../src/sql/drivers/sqlite/qsql_sqlite_p.h" +#include "qsql_sqlite_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro index cc6d02cbe8..6b2c083878 100644 --- a/src/plugins/sqldrivers/sqlite/sqlite.pro +++ b/src/plugins/sqldrivers/sqlite/sqlite.pro @@ -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) diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp similarity index 100% rename from src/sql/drivers/sqlite2/qsql_sqlite2.cpp rename to src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2_p.h b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h similarity index 100% rename from src/sql/drivers/sqlite2/qsql_sqlite2_p.h rename to src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h diff --git a/src/plugins/sqldrivers/sqlite2/smain.cpp b/src/plugins/sqldrivers/sqlite2/smain.cpp index 06b428c8ef..3a5734f8c9 100644 --- a/src/plugins/sqldrivers/sqlite2/smain.cpp +++ b/src/plugins/sqldrivers/sqlite2/smain.cpp @@ -39,7 +39,7 @@ #include #include -#include "../../../../src/sql/drivers/sqlite2/qsql_sqlite2_p.h" +#include "qsql_sqlite2_p.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro index d69afc119f..d0ab0eef41 100644 --- a/src/plugins/sqldrivers/sqlite2/sqlite2.pro +++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro @@ -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) diff --git a/src/plugins/sqldrivers/tds/main.cpp b/src/plugins/sqldrivers/tds/main.cpp index ffb31ae179..4aa1444608 100644 --- a/src/plugins/sqldrivers/tds/main.cpp +++ b/src/plugins/sqldrivers/tds/main.cpp @@ -45,7 +45,7 @@ #define _WINSCARD_H_ #include #endif -#include "../../../sql/drivers/tds/qsql_tds_p.h" +#include "qsql_tds_p.h" QT_BEGIN_NAMESPACE diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/plugins/sqldrivers/tds/qsql_tds.cpp similarity index 100% rename from src/sql/drivers/tds/qsql_tds.cpp rename to src/plugins/sqldrivers/tds/qsql_tds.cpp diff --git a/src/sql/drivers/tds/qsql_tds_p.h b/src/plugins/sqldrivers/tds/qsql_tds_p.h similarity index 100% rename from src/sql/drivers/tds/qsql_tds_p.h rename to src/plugins/sqldrivers/tds/qsql_tds_p.h diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro index 88f4b7c451..790c74de4e 100644 --- a/src/plugins/sqldrivers/tds/tds.pro +++ b/src/plugins/sqldrivers/tds/tds.pro @@ -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) diff --git a/src/sql/drivers/db2/qsql_db2.pri b/src/sql/drivers/db2/qsql_db2.pri deleted file mode 100644 index c9e65e2c2e..0000000000 --- a/src/sql/drivers/db2/qsql_db2.pri +++ /dev/null @@ -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 -} diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri deleted file mode 100644 index 87cc0b1d9e..0000000000 --- a/src/sql/drivers/drivers.pri +++ /dev/null @@ -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) diff --git a/src/sql/drivers/ibase/qsql_ibase.pri b/src/sql/drivers/ibase/qsql_ibase.pri deleted file mode 100644 index ef3b68d34e..0000000000 --- a/src/sql/drivers/ibase/qsql_ibase.pri +++ /dev/null @@ -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 - } -} diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri deleted file mode 100644 index 3cfb6144a1..0000000000 --- a/src/sql/drivers/mysql/qsql_mysql.pri +++ /dev/null @@ -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 -} diff --git a/src/sql/drivers/oci/qsql_oci.pri b/src/sql/drivers/oci/qsql_oci.pri deleted file mode 100644 index 66ccdb1abb..0000000000 --- a/src/sql/drivers/oci/qsql_oci.pri +++ /dev/null @@ -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 diff --git a/src/sql/drivers/odbc/qsql_odbc.pri b/src/sql/drivers/odbc/qsql_odbc.pri deleted file mode 100644 index b206df37c3..0000000000 --- a/src/sql/drivers/odbc/qsql_odbc.pri +++ /dev/null @@ -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 -} diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri deleted file mode 100644 index 867be3edb8..0000000000 --- a/src/sql/drivers/psql/qsql_psql.pri +++ /dev/null @@ -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 -} diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri deleted file mode 100644 index e323f2eba5..0000000000 --- a/src/sql/drivers/sqlite/qsql_sqlite.pri +++ /dev/null @@ -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 -} diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.pri b/src/sql/drivers/sqlite2/qsql_sqlite2.pri deleted file mode 100644 index 5baba30db0..0000000000 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.pri +++ /dev/null @@ -1,4 +0,0 @@ -HEADERS += $$PWD/qsql_sqlite2_p.h -SOURCES += $$PWD/qsql_sqlite2.cpp - -!contains(LIBS, .*sqlite.*):LIBS += -lsqlite diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri deleted file mode 100644 index 8c528c154d..0000000000 --- a/src/sql/drivers/tds/qsql_tds.pri +++ /dev/null @@ -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 -} diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 62e1b6a7a5..d91e502b96 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -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 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(); diff --git a/src/sql/sql.pro b/src/sql/sql.pro index 218671d7e7..622ffb66c5 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -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 = \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a796ffcbd6..b3df3cceaf 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -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";