diff options
Diffstat (limited to 'kexi')
-rw-r--r-- | kexi/kexidb/drivers/configure.in.in | 69 | ||||
-rw-r--r-- | kexi/kexidb/drivers/pqxx/Makefile.am | 2 | ||||
-rw-r--r-- | kexi/kexidb/drivers/pqxx/pqxxcursor.cpp | 4 | ||||
-rw-r--r-- | kexi/kexidb/drivers/pqxx/pqxxcursor.h | 4 | ||||
-rw-r--r-- | kexi/migration/pqxx/Makefile.am | 2 |
5 files changed, 78 insertions, 3 deletions
diff --git a/kexi/kexidb/drivers/configure.in.in b/kexi/kexidb/drivers/configure.in.in index 1f3e70f3..c33c6fbc 100644 --- a/kexi/kexidb/drivers/configure.in.in +++ b/kexi/kexidb/drivers/configure.in.in @@ -241,4 +241,73 @@ if test "$compile_pgsql_plugin" = "yes"; then fi fi +dnl ======================================== +dnl libpqxx build flags +dnl ======================================== +if test "$compile_pgsql_plugin" = "yes"; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + SAVED_CXXFLAGS="$CXXFLAGS" + for CXX_STD_TEST in "" 11 14 17; do + CXXFLAGS="$SAVED_CXXFLAGS" + if test "x$CXX_STD_TEST" = "x"; then + AC_MSG_CHECKING([PostgreSQL build with default C++ standard]) + else + AC_MSG_CHECKING([PostgreSQL build with C++$CXX_STD_TEST]) + CXXFLAGS=-std=c++$CXX_STD_TEST + fi + AC_TRY_COMPILE([ + #include <$PQXX_INCDIR/pqxx/pqxx> + ],[ ], + pqxx_cxx_std=yes, + pqxx_cxx_std=no + ) + if test "x$pqxx_cxx_std" = "xyes"; then + PQXX_CXXFLAGS=$CXXFLAGS + compile_pgsql_plugin="yes" + AC_SUBST(PQXX_CXXFLAGS) + AC_MSG_RESULT(yes) + break + else + compile_pgsql_plugin="no" + AC_MSG_RESULT(no) + fi + done + CXXFLAGS="$SAVED_CXXFLAGS" + AC_LANG_RESTORE +fi + +dnl ======================================== +dnl libpqxx field class name +dnl ======================================== +if test "$compile_pgsql_plugin" = "yes"; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + SAVED_CXXFLAGS="$CXXFLAGS" + + CXXFLAGS=$PQXX_CXXFLAGS + for PQXX_FIELD_CLASS in "pqxx::field" "pqxx::result::field"; do + AC_MSG_CHECKING([for PostgreSQL field class name - $PQXX_FIELD_CLASS]) + AC_TRY_COMPILE([ + #include <$PQXX_INCDIR/pqxx/pqxx> + ],[ + sizeof($PQXX_FIELD_CLASS); + ], + pqxx_field_class=yes, + pqxx_field_class=no + ) + if test "x$pqxx_field_class" = "xyes"; then + compile_pgsql_plugin="yes" + AC_DEFINE_UNQUOTED(PQXX_FIELD_CLASS, $PQXX_FIELD_CLASS, [ PQXX field class name ]) + AC_MSG_RESULT(yes) + break + else + compile_pgsql_plugin="no" + AC_MSG_RESULT(no) + fi + done + CXXFLAGS="$SAVED_CXXFLAGS" + AC_LANG_RESTORE +fi + AM_CONDITIONAL(compile_pgsql_plugin, test "$compile_pgsql_plugin" = "yes") diff --git a/kexi/kexidb/drivers/pqxx/Makefile.am b/kexi/kexidb/drivers/pqxx/Makefile.am index 6f5d73e2..fe0c5633 100644 --- a/kexi/kexidb/drivers/pqxx/Makefile.am +++ b/kexi/kexidb/drivers/pqxx/Makefile.am @@ -4,6 +4,8 @@ kde_module_LTLIBRARIES = kexidb_pqxxsqldriver.la INCLUDES = -I$(srcdir)/../../.. $(all_includes) -I$(PG_INCDIR) -I$(PQXX_INCDIR) +CXXFLAGS += $(PQXX_CXXFLAGS) + kexidb_pqxxsqldriver_la_METASOURCES = AUTO kexidb_pqxxsqldriver_la_SOURCES = pqxxdriver.cpp pqxxcursor.cpp pqxxconnection.cpp \ diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp index 746a383a..048d6685 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp +++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp @@ -34,7 +34,7 @@ using namespace KexiDB; unsigned int pqxxSqlCursor_trans_num=0; //!< debug helper -static TQByteArray pgsqlByteaToByteArray(const pqxx::result::field& r) +static TQByteArray pgsqlByteaToByteArray(const PQXX_FIELD_CLASS& r) { return KexiDB::pgsqlByteaToByteArray(r.c_str(), r.size()); } @@ -243,7 +243,7 @@ TQVariant pqxxSqlCursor::pValue(uint pos)const } else if (f->typeGroup() == Field::BLOBGroup) { -// pqxx::result::field r = (*m_res)[at()][pos]; +// PQXX_FIELD_CLASS r = (*m_res)[at()][pos]; // kdDebug() << r.name() << ", " << r.c_str() << ", " << r.type() << ", " << r.size() << endl; return ::pgsqlByteaToByteArray((*m_res)[at()][pos]); } diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.h b/kexi/kexidb/drivers/pqxx/pqxxcursor.h index 0a0fb2d5..8304ea2d 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxcursor.h +++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.h @@ -20,6 +20,8 @@ #ifndef KEXIDB_CURSOR_PQXX_H #define KEXIDB_CURSOR_PQXX_H +#include "config.h" + #include <kexidb/cursor.h> #include <kexidb/connection.h> #include <kexidb/utils.h> @@ -74,7 +76,7 @@ private: friend class pqxxSqlConnection; }; -inline TQVariant pgsqlCStrToVariant(const pqxx::result::field& r) +inline TQVariant pgsqlCStrToVariant(const PQXX_FIELD_CLASS& r) { switch(r.type()) { diff --git a/kexi/migration/pqxx/Makefile.am b/kexi/migration/pqxx/Makefile.am index a3d78de5..87f6c247 100644 --- a/kexi/migration/pqxx/Makefile.am +++ b/kexi/migration/pqxx/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/kexi/Makefile.global +CXXFLAGS += $(PQXX_CXXFLAGS) + kde_module_LTLIBRARIES = keximigrate_pqxx.la INCLUDES = -I$(srcdir)/../../.. -I$(top_srcdir)/kexi $(all_includes) -I$(PG_INCDIR) -I$(PQXX_INCDIR) |