summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-12-07 19:30:07 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-12-14 23:44:30 +0000
commite80bf655e922e9864f8843b5e7bbb47019a6d95a (patch)
tree7ffae51f5170a58b38f883ff30547e2f9d55843d /src/plugins
parenta227ea5bd5af50ac6f874ecf764858a43c53cada (diff)
configure: verify header presence against sources
in addition to the actual library resolution, also resolve the headers belonging to the library, to validate the include path, and possibly ensure that the right version of the library is present. the "include" entries were moved out of the "test" objects, and renamed to "headers". this cleanly permits libraries without compile tests. the headers were not put into the sources, because the variance among the includes is generally orthogonal to the variance among the libraries. note that this - like the library resolution - provides no support for darwin frameworks. consequently, the opengl libraries are excluded from the conversion on darwin. similarly, wasm is excluded (centrally), because emcc is magic and would need advanced wizardry to be dealt with. Change-Id: Ib390c75371efa2badcfec9b74274047ce67c3e5a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sqldrivers/configure.json33
-rw-r--r--src/plugins/sqldrivers/configure.pri4
2 files changed, 16 insertions, 21 deletions
diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json
index 4802d3b04d..cd20eef1df 100644
--- a/src/plugins/sqldrivers/configure.json
+++ b/src/plugins/sqldrivers/configure.json
@@ -39,9 +39,8 @@
"libraries": {
"db2": {
"label": "DB2 (IBM)",
- "test": {
- "include": [ "sqlcli.h", "sqlcli1.h" ]
- },
+ "test": {},
+ "headers": [ "sqlcli.h", "sqlcli1.h" ],
"sources": [
{ "libs": "-ldb2cli", "condition": "config.win32" },
{ "libs": "-ldb2", "condition": "!config.win32" }
@@ -49,9 +48,8 @@
},
"ibase": {
"label": "InterBase",
- "test": {
- "include": "ibase.h"
- },
+ "test": {},
+ "headers": "ibase.h",
"sources": [
{ "libs": "-lgds32_ms", "condition": "config.win32" },
{ "libs": "-lgds", "condition": "!config.win32" }
@@ -65,9 +63,9 @@
"# include <windows.h>",
"#endif"
],
- "include": "mysql.h",
"main": "mysql_get_client_version();"
},
+ "headers": "mysql.h",
"sources": [
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true },
{ "type": "mysqlConfig", "query": "--libs", "cleanlibs": true },
@@ -81,12 +79,12 @@
"psql": {
"label": "PostgreSQL",
"test": {
- "include": "libpq-fe.h",
"main": [
"PQescapeBytea(0, 0, 0);",
"PQunescapeBytea(0, 0);"
]
},
+ "headers": "libpq-fe.h",
"sources": [
{ "type": "pkgConfig", "args": "libpq" },
{ "type": "psqlConfig" },
@@ -96,9 +94,8 @@
},
"tds": {
"label": "TDS (Sybase)",
- "test": {
- "include": [ "sybfront.h", "sybdb.h" ]
- },
+ "test": {},
+ "headers": [ "sybfront.h", "sybdb.h" ],
"sources": [
{ "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
{ "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
@@ -106,9 +103,8 @@
},
"oci": {
"label": "OCI (Oracle)",
- "test": {
- "include": "oci.h"
- },
+ "test": {},
+ "headers": "oci.h",
"sources": [
{ "libs": "-loci", "condition": "config.win32" },
{ "libs": "-lclntsh", "condition": "!config.win32" }
@@ -122,12 +118,12 @@
"# include <windows.h>",
"#endif"
],
- "include": [ "sql.h", "sqlext.h" ],
"main": [
"SQLHANDLE env;",
"SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);"
]
},
+ "headers": [ "sql.h", "sqlext.h" ],
"sources": [
{ "libs": "-lodbc32", "condition": "config.win32" },
{ "libs": "-liodbc", "condition": "config.darwin" },
@@ -136,9 +132,8 @@
},
"sqlite2": {
"label": "SQLite (version 2)",
- "test": {
- "include": "sqlite.h"
- },
+ "test": {},
+ "headers": "sqlite.h",
"sources": [
"-lsqlite"
]
@@ -147,9 +142,9 @@
"label": "SQLite (version 3)",
"export": "sqlite",
"test": {
- "include": "sqlite3.h",
"main": "sqlite3_open_v2(0, 0, 0, 0);"
},
+ "headers": "sqlite3.h",
"sources": [
{ "type": "pkgConfig", "args": "sqlite3" },
"-lsqlite3"
diff --git a/src/plugins/sqldrivers/configure.pri b/src/plugins/sqldrivers/configure.pri
index 747a47e7b8..84c8114c7b 100644
--- a/src/plugins/sqldrivers/configure.pri
+++ b/src/plugins/sqldrivers/configure.pri
@@ -9,7 +9,7 @@ defineTest(qtConfLibrary_psqlConfig) {
!qtConfResolvePathLibs($${1}.libs, $$libdir, -lpq): \
return(false)
qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
- !qtConfResolvePathIncs($${1}.includedir, $$includedir): \
+ !qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
return(false)
return(true)
}
@@ -63,7 +63,7 @@ defineTest(qtConfLibrary_mysqlConfig) {
includedir =
for (id, rawincludedir): \
includedir += $$clean_path($$id)
- !qtConfResolvePathIncs($${1}.includedir, $$includedir): \
+ !qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
return(false)
return(true)
}