Skip to content

Commit 0c15604

Browse files
author
stoeckerb
committed
init Qt 5.12.8
1 parent a22ed43 commit 0c15604

13 files changed

+3902
-0
lines changed

Diff for: .qmake.conf

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file detaches this sub-tree from the rest of qtbase,
2+
# so it can be configured stand-alone.
3+
# Of course, under normal circumstances, this _is_ part of qtbase,
4+
# so we have to make some contortions to restore normality.
5+
6+
isEmpty(_QMAKE_CONF_): return() # Pre-scan during spec loading.
7+
8+
SQLDRV_SRC_TREE = $$dirname(_QMAKE_CONF_)
9+
QTBASE_SRC_TREE = $$section(SQLDRV_SRC_TREE, /, 0, -4)
10+
11+
QTBASE_BLD_TREE = $$shadowed($$QTBASE_SRC_TREE)
12+
!isEmpty(QTBASE_BLD_TREE):exists($$QTBASE_BLD_TREE/.qmake.cache) {
13+
# This tricks qt_build_config.prf and qt_build_paths.prf
14+
_QMAKE_CONF_ = $$QTBASE_SRC_TREE/.qmake.conf
15+
} else {
16+
CONFIG += sqldrivers_standalone
17+
}
18+
19+
include($$QTBASE_SRC_TREE/.qmake.conf)

Diff for: README

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Please note that the DB2, Oracle and TDS client drivers are not distributed
2+
with the Qt Open Source Editions.
3+
4+
This is because the client libraries are distributed under a license which
5+
is not compatible with the GPL license.

Diff for: configure.json

+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
{
2+
"module": "sqldrivers",
3+
"depends": [
4+
"core"
5+
],
6+
"testDir": "../../../config.tests",
7+
8+
"commandline": {
9+
"assignments": {
10+
"MYSQL_PATH": "mysql.prefix",
11+
"SYBASE": "tds.prefix",
12+
"SYBASE_LIBS": "tds.libs"
13+
},
14+
"options": {
15+
"mysql_config": "string",
16+
"psql_config": "string",
17+
"sqlite": { "type": "enum", "name": "system-sqlite", "values": { "qt": "no", "system": "yes" } },
18+
"sql-db2": "boolean",
19+
"sql-ibase": "boolean",
20+
"sql-mysql": "boolean",
21+
"sql-oci": "boolean",
22+
"sql-odbc": "boolean",
23+
"sql-psql": "boolean",
24+
"sql-sqlite": "boolean",
25+
"sql-sqlite2": "boolean",
26+
"sql-tds": "boolean",
27+
"plugin-sql-db2": { "type": "void", "name": "sql-db2" },
28+
"plugin-sql-ibase": { "type": "void", "name": "sql-ibase" },
29+
"plugin-sql-mysql": { "type": "void", "name": "sql-mysql" },
30+
"plugin-sql-oci": { "type": "void", "name": "sql-oci" },
31+
"plugin-sql-odbc": { "type": "void", "name": "sql-odbc" },
32+
"plugin-sql-psql": { "type": "void", "name": "sql-psql" },
33+
"plugin-sql-sqlite": { "type": "void", "name": "sql-sqlite" },
34+
"plugin-sql-sqlite2": { "type": "void", "name": "sql-sqlite2" },
35+
"plugin-sql-tds": { "type": "void", "name": "sql-tds" }
36+
}
37+
},
38+
39+
"libraries": {
40+
"db2": {
41+
"label": "DB2 (IBM)",
42+
"test": {},
43+
"headers": [ "sqlcli.h", "sqlcli1.h" ],
44+
"sources": [
45+
{ "libs": "-ldb2cli", "condition": "config.win32" },
46+
{ "libs": "-ldb2", "condition": "!config.win32" }
47+
]
48+
},
49+
"ibase": {
50+
"label": "InterBase",
51+
"test": {},
52+
"headers": "ibase.h",
53+
"sources": [
54+
{ "libs": "-lgds32_ms", "condition": "config.win32" },
55+
{ "libs": "-lgds", "condition": "!config.win32" }
56+
]
57+
},
58+
"mysql": {
59+
"label": "MySQL",
60+
"test": {
61+
"head": [
62+
"#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)",
63+
"# include <windows.h>",
64+
"#endif"
65+
],
66+
"main": "mysql_get_client_version();"
67+
},
68+
"headers": "mysql.h",
69+
"sources": [
70+
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true },
71+
{ "type": "mysqlConfig", "query": "--libs", "cleanlibs": true },
72+
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": false },
73+
{ "type": "mysqlConfig", "query": "--libs", "cleanlibs": false },
74+
{ "libs": "-lmysqlclient_r", "condition": "!config.win32" },
75+
{ "libs": "-llibmysql", "condition": "config.win32" },
76+
{ "libs": "-lmysqlclient", "condition": "!config.win32" }
77+
]
78+
},
79+
"psql": {
80+
"label": "PostgreSQL",
81+
"test": {
82+
"main": [
83+
"PQescapeBytea(0, 0, 0);",
84+
"PQunescapeBytea(0, 0);"
85+
]
86+
},
87+
"headers": "libpq-fe.h",
88+
"sources": [
89+
{ "type": "pkgConfig", "args": "libpq" },
90+
{ "type": "psqlConfig" },
91+
{ "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
92+
{ "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
93+
]
94+
},
95+
"tds": {
96+
"label": "TDS (Sybase)",
97+
"test": {},
98+
"headers": [ "sybfront.h", "sybdb.h" ],
99+
"sources": [
100+
{ "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
101+
{ "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
102+
]
103+
},
104+
"oci": {
105+
"label": "OCI (Oracle)",
106+
"test": {},
107+
"headers": "oci.h",
108+
"sources": [
109+
{ "libs": "-loci", "condition": "config.win32" },
110+
{ "libs": "-lclntsh", "condition": "!config.win32" }
111+
]
112+
},
113+
"odbc": {
114+
"label": "ODBC",
115+
"test": {
116+
"head": [
117+
"#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)",
118+
"# include <windows.h>",
119+
"#endif"
120+
],
121+
"main": [
122+
"SQLHANDLE env;",
123+
"SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);"
124+
]
125+
},
126+
"headers": [ "sql.h", "sqlext.h" ],
127+
"sources": [
128+
{ "libs": "-lodbc32", "condition": "config.win32" },
129+
{ "libs": "-liodbc", "condition": "config.darwin" },
130+
{ "libs": "-lodbc", "condition": "!config.win32 && !config.darwin" }
131+
]
132+
},
133+
"sqlite2": {
134+
"label": "SQLite (version 2)",
135+
"test": {},
136+
"headers": "sqlite.h",
137+
"sources": [
138+
"-lsqlite"
139+
]
140+
},
141+
"sqlite3": {
142+
"label": "SQLite (version 3)",
143+
"export": "sqlite",
144+
"test": {
145+
"main": "sqlite3_open_v2(0, 0, 0, 0);"
146+
},
147+
"headers": "sqlite3.h",
148+
"sources": [
149+
{ "type": "pkgConfig", "args": "sqlite3" },
150+
"-lsqlite3"
151+
],
152+
"use": [
153+
{ "lib": "zlib", "condition": "!config.win32 && features.system-zlib" }
154+
]
155+
}
156+
},
157+
158+
"tests": {
159+
},
160+
161+
"features": {
162+
"sql-db2": {
163+
"label": "DB2 (IBM)",
164+
"condition": "libs.db2",
165+
"output": [ "privateFeature" ]
166+
},
167+
"sql-ibase": {
168+
"label": "InterBase",
169+
"condition": "libs.ibase",
170+
"output": [ "privateFeature" ]
171+
},
172+
"sql-mysql": {
173+
"label": "MySql",
174+
"condition": "libs.mysql",
175+
"output": [ "privateFeature" ]
176+
},
177+
"sql-oci": {
178+
"label": "OCI (Oracle)",
179+
"condition": "libs.oci",
180+
"output": [ "privateFeature" ]
181+
},
182+
"sql-odbc": {
183+
"label": "ODBC",
184+
"condition": "features.datestring && libs.odbc",
185+
"output": [ "privateFeature" ]
186+
},
187+
"sql-psql": {
188+
"label": "PostgreSQL",
189+
"condition": "libs.psql",
190+
"output": [ "privateFeature" ]
191+
},
192+
"sql-sqlite2": {
193+
"label": "SQLite2",
194+
"condition": "libs.sqlite2",
195+
"output": [ "privateFeature" ]
196+
},
197+
"sql-sqlite": {
198+
"label": "SQLite",
199+
"condition": "features.datestring",
200+
"output": [ "privateFeature" ]
201+
},
202+
"system-sqlite": {
203+
"label": " Using system provided SQLite",
204+
"autoDetect": false,
205+
"condition": "features.sql-sqlite && libs.sqlite3",
206+
"output": [ "privateFeature" ]
207+
},
208+
"sql-tds": {
209+
"label": "TDS (Sybase)",
210+
"condition": "features.datestring && libs.tds",
211+
"output": [ "privateFeature" ]
212+
}
213+
},
214+
215+
"report": [
216+
{
217+
"type": "warning",
218+
"condition": "config.win32 && !config.msvc && features.sql-oci",
219+
"message": "Qt does not support compiling the Oracle database driver with
220+
MinGW, due to lack of such support from Oracle. Consider disabling the
221+
Oracle driver, as the current build will most likely fail."
222+
}
223+
],
224+
225+
"summary": [
226+
{
227+
"section": "Qt Sql Drivers",
228+
"entries": [
229+
"sql-db2", "sql-ibase", "sql-mysql", "sql-oci", "sql-odbc", "sql-psql",
230+
"sql-sqlite2", "sql-sqlite", "system-sqlite", "sql-tds"
231+
]
232+
}
233+
]
234+
}

Diff for: configure.pri

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# custom tests
2+
3+
defineTest(qtConfLibrary_psqlConfig) {
4+
pg_config = $$config.input.psql_config
5+
isEmpty(pg_config):!cross_compile: \
6+
pg_config = $$qtConfFindInPath("pg_config")
7+
!win32:!isEmpty(pg_config) {
8+
qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
9+
!qtConfResolvePathLibs($${1}.libs, $$libdir, -lpq): \
10+
return(false)
11+
qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
12+
!qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
13+
return(false)
14+
return(true)
15+
}
16+
qtLog("pg_config not found.")
17+
return(false)
18+
}
19+
20+
defineTest(qtConfLibrary_psqlEnv) {
21+
# Respect PSQL_LIBS if set
22+
PSQL_LIBS = $$getenv(PSQL_LIBS)
23+
!isEmpty(PSQL_LIBS) {
24+
eval(libs = $$PSQL_LIBS)
25+
!qtConfResolveLibs($${1}.libs, $$libs): \
26+
return(false)
27+
} else {
28+
!qtConfLibrary_inline($$1, $$2): \
29+
return(false)
30+
}
31+
return(true)
32+
}
33+
34+
defineTest(qtConfLibrary_mysqlConfig) {
35+
mysql_config = $$config.input.mysql_config
36+
isEmpty(mysql_config):!cross_compile: \
37+
mysql_config = $$qtConfFindInPath("mysql_config")
38+
!isEmpty(mysql_config) {
39+
qtRunLoggedCommand("$$mysql_config --version", version)|return(false)
40+
version = $$split(version, '.')
41+
version = $$first(version)
42+
isEmpty(version)|lessThan(version, 4): return(false)]
43+
44+
# query is either --libs or --libs_r
45+
query = $$eval($${1}.query)
46+
qtRunLoggedCommand("$$mysql_config $$query", libs)|return(false)
47+
qtRunLoggedCommand("$$mysql_config --include", includedir)|return(false)
48+
eval(libs = $$libs)
49+
# -rdynamic should not be returned by mysql_config, but is on RHEL 6.6
50+
libs -= -rdynamic
51+
equals($${1}.cleanlibs, true) {
52+
for(l, libs) {
53+
# Drop all options besides the -L one and the -lmysqlclient one
54+
# so we don't unnecessarily link to libs like OpenSSL
55+
contains(l, "^(-L|-lmysqlclient).*"): cleanlibs += $$l
56+
}
57+
libs = $$cleanlibs
58+
}
59+
!qtConfResolveLibs($${1}.libs, $$libs): \
60+
return(false)
61+
eval(rawincludedir = $$includedir)
62+
rawincludedir ~= s/^-I//g
63+
includedir =
64+
for (id, rawincludedir): \
65+
includedir += $$clean_path($$id)
66+
!qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
67+
return(false)
68+
return(true)
69+
}
70+
qtLog("mysql_config not found.")
71+
return(false)
72+
}
73+
74+
defineTest(qtConfLibrary_sybaseEnv) {
75+
libdir =
76+
sybase = $$getenv(SYBASE)
77+
!isEmpty(sybase): \
78+
libdir += $${sybase}/lib
79+
eval(libs = $$getenv(SYBASE_LIBS))
80+
isEmpty(libs): \
81+
libs = $$eval($${1}.libs)
82+
!qtConfResolvePathLibs($${1}.libs, $$libdir, $$libs): \
83+
return(false)
84+
return(true)
85+
}

Diff for: mysql/README

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
You will need the MySQL development headers and libraries installed
2+
before compiling this plugin.
3+
4+
See the Qt SQL documentation for more information on compiling Qt SQL
5+
driver plugins (sql-driver.html).
6+

0 commit comments

Comments
 (0)