diff options
author | Bill King <bill.king@nokia.com> | 2009-05-28 01:12:26 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-05-28 01:12:26 (GMT) |
commit | 8aef511877d460e4d7e75c978142f1ca3bd50451 (patch) | |
tree | 78362c8a123dce23991f0d6e0200db4e13278650 | |
parent | fcfdccc03b6dd26a82e87a6b6a0ca48d67f78cf6 (diff) | |
download | Qt-8aef511877d460e4d7e75c978142f1ca3bd50451.zip Qt-8aef511877d460e4d7e75c978142f1ca3bd50451.tar.gz Qt-8aef511877d460e4d7e75c978142f1ca3bd50451.tar.bz2 |
Adds support for linking against iodbc on linux.
If unixodbc detection fails, try and link/detect iodbc libraries and link against them.
Reviewed-by: Lincoln Ramsay
-rw-r--r-- | config.tests/unix/iodbc/iodbc.cpp | 7 | ||||
-rw-r--r-- | config.tests/unix/iodbc/iodbc.pro | 4 | ||||
-rwxr-xr-x | configure | 25 | ||||
-rw-r--r-- | projects.pro | 1 | ||||
-rw-r--r-- | src/plugins/sqldrivers/odbc/odbc.pro | 8 |
5 files changed, 31 insertions, 14 deletions
diff --git a/config.tests/unix/iodbc/iodbc.cpp b/config.tests/unix/iodbc/iodbc.cpp new file mode 100644 index 0000000..6b64e12 --- /dev/null +++ b/config.tests/unix/iodbc/iodbc.cpp @@ -0,0 +1,7 @@ +#include <sql.h> +#include <sqlext.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/iodbc/iodbc.pro b/config.tests/unix/iodbc/iodbc.pro new file mode 100644 index 0000000..465a9a7 --- /dev/null +++ b/config.tests/unix/iodbc/iodbc.pro @@ -0,0 +1,4 @@ +SOURCES = iodbc.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -liodbc @@ -716,6 +716,7 @@ QT_LFLAGS_MYSQL= QT_LFLAGS_MYSQL_R= QT_CFLAGS_SQLITE= QT_LFLAGS_SQLITE= +QT_LFLAGS_ODBC="-lodbc" # flags for libdbus-1 QT_CFLAGS_DBUS= @@ -4431,14 +4432,21 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do CFG_SQL_odbc=plugin fi else - if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then - echo "ODBC support cannot be enabled due to functionality tests!" - echo " Turn on verbose messaging (-v) to $0 to see the final report." - echo " If you believe this message is in error you may use the continue" - echo " switch (-continue) to $0 to continue." - exit 101 + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iodbc "iODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_ARCHS_COMMANDLINE; then + QT_LFLAGS_ODBC="-liodbc" + if [ "$CFG_SQL_odbc" = "auto" ]; then + CFG_SQL_odbc=plugin + fi else - CFG_SQL_odbc=no + if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + echo "ODBC support cannot be enabled due to functionality tests!" + echo " Turn on verbose messaging (-v) to $0 to see the final report." + echo " If you believe this message is in error you may use the continue" + echo " switch (-continue) to $0 to continue." + exit 101 + else + CFG_SQL_odbc=no + fi fi fi fi @@ -6684,6 +6692,9 @@ fi if [ -n "$QT_LFLAGS_SQLITE" ]; then echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp" fi +if [ -n "$QT_LFLAGS_ODBC" ]; then + echo "QT_LFLAGS_ODBC = $QT_LFLAGS_ODBC" >> "$CACHEFILE.tmp" +fi if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp" diff --git a/projects.pro b/projects.pro index 2596c0a..3817792 100644 --- a/projects.pro +++ b/projects.pro @@ -61,6 +61,7 @@ unix { (cd config.tests/unix/mysql_r && $(MAKE) distclean); \ (cd config.tests/unix/nis && $(MAKE) distclean); \ (cd config.tests/unix/nix && $(MAKE) distclean); \ + (cd config.tests/unix/iodbc && $(MAKE) distclean); \ (cd config.tests/unix/odbc && $(MAKE) distclean); \ (cd config.tests/unix/oci && $(MAKE) distclean); \ (cd config.tests/unix/tds && $(MAKE) distclean); \ diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro index 0835ce1..3de8ab2 100644 --- a/src/plugins/sqldrivers/odbc/odbc.pro +++ b/src/plugins/sqldrivers/odbc/odbc.pro @@ -4,15 +4,9 @@ HEADERS = ../../../sql/drivers/odbc/qsql_odbc.h SOURCES = main.cpp \ ../../../sql/drivers/odbc/qsql_odbc.cpp -mac { - !contains( LIBS, .*odbc.* ) { - LIBS *= -liodbc - } -} - unix { !contains( LIBS, .*odbc.* ) { - LIBS *= -lodbc + LIBS *= $$QT_LFLAGS_ODBC } } |