summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-10 18:55:06 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-17 06:47:48 +0000
commited07bdcb5f96d723f9c4c6b689ae95965c57c723 (patch)
tree06600515441cbbd06cd04cbab271c59482e16b1a /src/sql
parent78731b434e0e99ad108601249108e12d8a49c350 (diff)
make sql drivers independently configurable
our binary packages come without many sql drivers, because they have proprietary dependencies we cannot ship. not every user wants to build all of qt from scratch, so it makes sense to make it possible to "enrich" the existing installation by compiling just the drivers. to enable this, the drivers' configuration must be independent. but note that it's still not possible to configure a single driver - the entire sqldrivers directory is configured at once. a side effect of this is that the availability of the sql plugins cannot be made known with publicFeatures any more, because there is no associated module pri file to put that information into. that should be made inconsequential by making qtHaveModule() work for plugins. Task-number: QTBUG-58372 Change-Id: Ibdebe3199688a57f93cea82dc15623081d1280f5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/configure.json201
-rw-r--r--src/sql/configure.pri99
2 files changed, 0 insertions, 300 deletions
diff --git a/src/sql/configure.json b/src/sql/configure.json
deleted file mode 100644
index dc7fffa02d..0000000000
--- a/src/sql/configure.json
+++ /dev/null
@@ -1,201 +0,0 @@
-{
- "module": "sql",
- "depends": [
- "core"
- ],
- "testDir": "../../config.tests",
-
- "commandline": {
- "assignments": {
- "MYSQL_PATH": "mysql.prefix",
- "SYBASE": "tds.prefix",
- "SYBASE_LIBS": "tds.libs"
- },
- "options": {
- "mysql_config": "string",
- "psql_config": "string",
- "sqlite": { "type": "enum", "name": "system-sqlite", "values": { "qt": "no", "system": "yes" } },
- "sql-db2": "boolean",
- "sql-ibase": "boolean",
- "sql-mysql": "boolean",
- "sql-oci": "boolean",
- "sql-odbc": "boolean",
- "sql-psql": "boolean",
- "sql-sqlite": "boolean",
- "sql-sqlite2": "boolean",
- "sql-tds": "boolean",
- "plugin-sql-db2": { "type": "void", "name": "sql-db2" },
- "plugin-sql-ibase": { "type": "void", "name": "sql-ibase" },
- "plugin-sql-mysql": { "type": "void", "name": "sql-mysql" },
- "plugin-sql-oci": { "type": "void", "name": "sql-oci" },
- "plugin-sql-odbc": { "type": "void", "name": "sql-odbc" },
- "plugin-sql-psql": { "type": "void", "name": "sql-psql" },
- "plugin-sql-sqlite": { "type": "void", "name": "sql-sqlite" },
- "plugin-sql-sqlite2": { "type": "void", "name": "sql-sqlite2" },
- "plugin-sql-tds": { "type": "void", "name": "sql-tds" }
- }
- },
-
- "libraries": {
- "db2": {
- "label": "DB2 (IBM)",
- "test": "unix/db2",
- "sources": [
- { "libs": "-ldb2cli", "condition": "config.win32" },
- { "libs": "-ldb2", "condition": "!config.win32" }
- ]
- },
- "ibase": {
- "label": "InterBase",
- "test": "unix/ibase",
- "sources": [
- { "libs": "-lgds32_ms", "condition": "config.win32" },
- { "libs": "-lgds", "condition": "!config.win32" }
- ]
- },
- "mysql": {
- "label": "MySQL",
- "test": "unix/mysql",
- "sources": [
- { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true },
- { "type": "mysqlConfig", "query": "--libs", "cleanlibs": true },
- { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": false },
- { "type": "mysqlConfig", "query": "--libs", "cleanlibs": false },
- { "libs": "-lmysqlclient_r", "condition": "!config.win32" },
- { "libs": "-llibmysql", "condition": "config.win32" },
- { "libs": "-lmysqlclient", "condition": "!config.win32" }
- ]
- },
- "psql": {
- "label": "PostgreSQL",
- "test": "unix/psql",
- "sources": [
- { "type": "pkgConfig", "args": "libpq" },
- { "type": "psqlConfig" },
- { "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
- { "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
- ]
- },
- "tds": {
- "label": "TDS (Sybase)",
- "test": "unix/tds",
- "sources": [
- { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
- { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
- ]
- },
- "oci": {
- "label": "OCI (Oracle)",
- "test": "unix/oci",
- "sources": [
- { "libs": "-loci", "condition": "config.win32" },
- { "libs": "-lclntsh", "condition": "!config.win32" }
- ]
- },
- "odbc": {
- "label": "ODBC",
- "test": "unix/odbc",
- "sources": [
- { "libs": "-lodbc32", "condition": "config.win32" },
- { "libs": "-liodbc", "condition": "config.darwin" },
- { "libs": "-lodbc", "condition": "!config.win32 && !config.darwin" }
- ]
- },
- "sqlite2": {
- "label": "SQLite (version 2)",
- "test": "unix/sqlite2",
- "sources": [
- "-lsqlite"
- ]
- },
- "sqlite3": {
- "label": "SQLite (version 3)",
- "export": "sqlite",
- "test": "unix/sqlite",
- "sources": [
- { "type": "pkgConfig", "args": "sqlite3" },
- "-lsqlite3"
- ],
- "use": [
- { "lib": "zlib", "condition": "!config.win32 && features.system-zlib" }
- ]
- }
- },
-
- "tests": {
- },
-
- "features": {
- "sql-db2": {
- "label": "DB2 (IBM)",
- "condition": "libs.db2",
- "output": [ "publicFeature" ]
- },
- "sql-ibase": {
- "label": "InterBase",
- "condition": "libs.ibase",
- "output": [ "publicFeature" ]
- },
- "sql-mysql": {
- "label": "MySql",
- "condition": "libs.mysql",
- "output": [ "publicFeature" ]
- },
- "sql-oci": {
- "label": "OCI (Oracle)",
- "condition": "libs.oci",
- "output": [ "publicFeature" ]
- },
- "sql-odbc": {
- "label": "ODBC",
- "condition": "libs.odbc && features.datestring",
- "output": [ "publicFeature" ]
- },
- "sql-psql": {
- "label": "PostgreSQL",
- "condition": "libs.psql",
- "output": [ "publicFeature" ]
- },
- "sql-sqlite2": {
- "label": "SQLite2",
- "condition": "libs.sqlite2",
- "output": [ "publicFeature" ]
- },
- "sql-sqlite": {
- "label": "SQLite",
- "condition": "features.datestring",
- "output": [ "publicFeature" ]
- },
- "system-sqlite": {
- "label": " Using system provided SQLite",
- "autoDetect": false,
- "condition": "features.sql-sqlite && libs.sqlite3",
- "output": [ "privateFeature" ]
- },
- "sql-tds": {
- "label": "TDS (Sybase)",
- "condition": "libs.tds && features.datestring",
- "output": [ "publicFeature" ]
- }
- },
-
- "report": [
- {
- "type": "warning",
- "condition": "config.win32 && !config.msvc && features.sql-oci",
- "message": "Qt does not support compiling the Oracle database driver with
-MinGW, due to lack of such support from Oracle. Consider disabling the
-Oracle driver, as the current build will most likely fail."
- }
- ],
-
- "summary": [
- {
- "section": "Qt Sql",
- "entries": [
- "sql-db2", "sql-ibase", "sql-mysql", "sql-oci", "sql-odbc", "sql-psql",
- "sql-sqlite2", "sql-sqlite", "system-sqlite", "sql-tds"
- ]
- }
- ]
-}
diff --git a/src/sql/configure.pri b/src/sql/configure.pri
deleted file mode 100644
index 9fb957291f..0000000000
--- a/src/sql/configure.pri
+++ /dev/null
@@ -1,99 +0,0 @@
-# custom tests
-
-defineReplace(filterLibraryPath) {
- str = $${1}
- for (l, QMAKE_DEFAULT_LIBDIRS): \
- str -= "-L$$l"
-
- return($$str)
-}
-
-defineTest(qtConfLibrary_psqlConfig) {
- pg_config = $$config.input.psql_config
- isEmpty(pg_config): \
- pg_config = $$qtConfFindInPath("pg_config")
- !win32:!isEmpty(pg_config) {
- qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
- qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
- libdir -= $$QMAKE_DEFAULT_LIBDIRS
- libs =
- !isEmpty(libdir): libs += "-L$$libdir"
- libs += "-lpq"
- $${1}.libs = "$$val_escape(libs)"
- includedir -= $$QMAKE_DEFAULT_INCDIRS
- $${1}.includedir = "$$val_escape(includedir)"
- export($${1}.libs)
- export($${1}.includedir)
- return(true)
- }
- qtLog("pg_config not found.")
- return(false)
-}
-
-defineTest(qtConfLibrary_psqlEnv) {
- # Respect PSQL_LIBS if set
- PSQL_LIBS = $$getenv(PSQL_LIBS)
- !isEmpty(PSQL_LIBS) {
- $${1}.libs = $$PSQL_LIBS
- export($${1}.libs)
- } else {
- !qtConfLibrary_inline($$1): \
- return(false)
- }
- return(true)
-}
-
-defineTest(qtConfLibrary_mysqlConfig) {
- mysql_config = $$config.input.mysql_config
- isEmpty(mysql_config): \
- mysql_config = $$qtConfFindInPath("mysql_config")
- !isEmpty(mysql_config) {
- qtRunLoggedCommand("$$mysql_config --version", version)|return(false)
- version = $$split(version, '.')
- version = $$first(version)
- isEmpty(version)|lessThan(version, 4): return(false)]
-
- # query is either --libs or --libs_r
- query = $$eval($${1}.query)
- qtRunLoggedCommand("$$mysql_config $$query", libs)|return(false)
- qtRunLoggedCommand("$$mysql_config --include", includedir)|return(false)
- eval(libs = $$libs)
- libs = $$filterLibraryPath($$libs)
- # -rdynamic should not be returned by mysql_config, but is on RHEL 6.6
- libs -= -rdynamic
- equals($${1}.cleanlibs, true) {
- for(l, libs) {
- # Drop all options besides the -L one and the -lmysqlclient one
- # so we don't unnecessarily link to libs like OpenSSL
- contains(l, "^(-L|-lmysqlclient).*"): cleanlibs += $$l
- }
- libs = $$cleanlibs
- }
- $${1}.libs = "$$val_escape(libs)"
- eval(rawincludedir = $$includedir)
- rawincludedir ~= s/^-I//g
- includedir =
- for (id, rawincludedir): \
- includedir += $$clean_path($$id)
- includedir -= $$QMAKE_DEFAULT_INCDIRS
- $${1}.includedir = "$$val_escape(includedir)"
- export($${1}.libs)
- export($${1}.includedir)
- return(true)
- }
- qtLog("mysql_config not found.")
- return(false)
-}
-
-defineTest(qtConfLibrary_sybaseEnv) {
- libs =
- sybase = $$getenv(SYBASE)
- !isEmpty(sybase): \
- libs += "-L$${sybase}/lib"
- libs += $$getenv(SYBASE_LIBS)
- !isEmpty(libs) {
- $${1}.libs = "$$val_escape(libs)"
- export($${1}.libs)
- }
- return(true)
-}