Skip to content

init Qt 5.12.8 #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file detaches this sub-tree from the rest of qtbase,
# so it can be configured stand-alone.
# Of course, under normal circumstances, this _is_ part of qtbase,
# so we have to make some contortions to restore normality.

isEmpty(_QMAKE_CONF_): return() # Pre-scan during spec loading.

SQLDRV_SRC_TREE = $$dirname(_QMAKE_CONF_)
QTBASE_SRC_TREE = $$section(SQLDRV_SRC_TREE, /, 0, -4)

QTBASE_BLD_TREE = $$shadowed($$QTBASE_SRC_TREE)
!isEmpty(QTBASE_BLD_TREE):exists($$QTBASE_BLD_TREE/.qmake.cache) {
# This tricks qt_build_config.prf and qt_build_paths.prf
_QMAKE_CONF_ = $$QTBASE_SRC_TREE/.qmake.conf
} else {
CONFIG += sqldrivers_standalone
}

include($$QTBASE_SRC_TREE/.qmake.conf)
5 changes: 5 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Please note that the DB2, Oracle and TDS client drivers are not distributed
with the Qt Open Source Editions.

This is because the client libraries are distributed under a license which
is not compatible with the GPL license.
234 changes: 234 additions & 0 deletions configure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"module": "sqldrivers",
"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": {},
"headers": [ "sqlcli.h", "sqlcli1.h" ],
"sources": [
{ "libs": "-ldb2cli", "condition": "config.win32" },
{ "libs": "-ldb2", "condition": "!config.win32" }
]
},
"ibase": {
"label": "InterBase",
"test": {},
"headers": "ibase.h",
"sources": [
{ "libs": "-lgds32_ms", "condition": "config.win32" },
{ "libs": "-lgds", "condition": "!config.win32" }
]
},
"mysql": {
"label": "MySQL",
"test": {
"head": [
"#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)",
"# include <windows.h>",
"#endif"
],
"main": "mysql_get_client_version();"
},
"headers": "mysql.h",
"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": {
"main": [
"PQescapeBytea(0, 0, 0);",
"PQunescapeBytea(0, 0);"
]
},
"headers": "libpq-fe.h",
"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": {},
"headers": [ "sybfront.h", "sybdb.h" ],
"sources": [
{ "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
{ "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
]
},
"oci": {
"label": "OCI (Oracle)",
"test": {},
"headers": "oci.h",
"sources": [
{ "libs": "-loci", "condition": "config.win32" },
{ "libs": "-lclntsh", "condition": "!config.win32" }
]
},
"odbc": {
"label": "ODBC",
"test": {
"head": [
"#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)",
"# include <windows.h>",
"#endif"
],
"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" },
{ "libs": "-lodbc", "condition": "!config.win32 && !config.darwin" }
]
},
"sqlite2": {
"label": "SQLite (version 2)",
"test": {},
"headers": "sqlite.h",
"sources": [
"-lsqlite"
]
},
"sqlite3": {
"label": "SQLite (version 3)",
"export": "sqlite",
"test": {
"main": "sqlite3_open_v2(0, 0, 0, 0);"
},
"headers": "sqlite3.h",
"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": [ "privateFeature" ]
},
"sql-ibase": {
"label": "InterBase",
"condition": "libs.ibase",
"output": [ "privateFeature" ]
},
"sql-mysql": {
"label": "MySql",
"condition": "libs.mysql",
"output": [ "privateFeature" ]
},
"sql-oci": {
"label": "OCI (Oracle)",
"condition": "libs.oci",
"output": [ "privateFeature" ]
},
"sql-odbc": {
"label": "ODBC",
"condition": "features.datestring && libs.odbc",
"output": [ "privateFeature" ]
},
"sql-psql": {
"label": "PostgreSQL",
"condition": "libs.psql",
"output": [ "privateFeature" ]
},
"sql-sqlite2": {
"label": "SQLite2",
"condition": "libs.sqlite2",
"output": [ "privateFeature" ]
},
"sql-sqlite": {
"label": "SQLite",
"condition": "features.datestring",
"output": [ "privateFeature" ]
},
"system-sqlite": {
"label": " Using system provided SQLite",
"autoDetect": false,
"condition": "features.sql-sqlite && libs.sqlite3",
"output": [ "privateFeature" ]
},
"sql-tds": {
"label": "TDS (Sybase)",
"condition": "features.datestring && libs.tds",
"output": [ "privateFeature" ]
}
},

"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 Drivers",
"entries": [
"sql-db2", "sql-ibase", "sql-mysql", "sql-oci", "sql-odbc", "sql-psql",
"sql-sqlite2", "sql-sqlite", "system-sqlite", "sql-tds"
]
}
]
}
85 changes: 85 additions & 0 deletions configure.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# custom tests

defineTest(qtConfLibrary_psqlConfig) {
pg_config = $$config.input.psql_config
isEmpty(pg_config):!cross_compile: \
pg_config = $$qtConfFindInPath("pg_config")
!win32:!isEmpty(pg_config) {
qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
!qtConfResolvePathLibs($${1}.libs, $$libdir, -lpq): \
return(false)
qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
!qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
return(false)
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) {
eval(libs = $$PSQL_LIBS)
!qtConfResolveLibs($${1}.libs, $$libs): \
return(false)
} else {
!qtConfLibrary_inline($$1, $$2): \
return(false)
}
return(true)
}

defineTest(qtConfLibrary_mysqlConfig) {
mysql_config = $$config.input.mysql_config
isEmpty(mysql_config):!cross_compile: \
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)
# -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
}
!qtConfResolveLibs($${1}.libs, $$libs): \
return(false)
eval(rawincludedir = $$includedir)
rawincludedir ~= s/^-I//g
includedir =
for (id, rawincludedir): \
includedir += $$clean_path($$id)
!qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \
return(false)
return(true)
}
qtLog("mysql_config not found.")
return(false)
}

defineTest(qtConfLibrary_sybaseEnv) {
libdir =
sybase = $$getenv(SYBASE)
!isEmpty(sybase): \
libdir += $${sybase}/lib
eval(libs = $$getenv(SYBASE_LIBS))
isEmpty(libs): \
libs = $$eval($${1}.libs)
!qtConfResolvePathLibs($${1}.libs, $$libdir, $$libs): \
return(false)
return(true)
}
6 changes: 6 additions & 0 deletions mysql/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
You will need the MySQL development headers and libraries installed
before compiling this plugin.

See the Qt SQL documentation for more information on compiling Qt SQL
driver plugins (sql-driver.html).

Loading