Fix FTBFS with libpqxx >= 6.x

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 6 years ago
parent f622d0aa10
commit c17464869b

@ -241,4 +241,73 @@ if test "$compile_pgsql_plugin" = "yes"; then
fi fi
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") AM_CONDITIONAL(compile_pgsql_plugin, test "$compile_pgsql_plugin" = "yes")

@ -4,6 +4,8 @@ kde_module_LTLIBRARIES = kexidb_pqxxsqldriver.la
INCLUDES = -I$(srcdir)/../../.. $(all_includes) -I$(PG_INCDIR) -I$(PQXX_INCDIR) INCLUDES = -I$(srcdir)/../../.. $(all_includes) -I$(PG_INCDIR) -I$(PQXX_INCDIR)
CXXFLAGS += $(PQXX_CXXFLAGS)
kexidb_pqxxsqldriver_la_METASOURCES = AUTO kexidb_pqxxsqldriver_la_METASOURCES = AUTO
kexidb_pqxxsqldriver_la_SOURCES = pqxxdriver.cpp pqxxcursor.cpp pqxxconnection.cpp \ kexidb_pqxxsqldriver_la_SOURCES = pqxxdriver.cpp pqxxcursor.cpp pqxxconnection.cpp \

@ -34,7 +34,7 @@ using namespace KexiDB;
unsigned int pqxxSqlCursor_trans_num=0; //!< debug helper 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()); return KexiDB::pgsqlByteaToByteArray(r.c_str(), r.size());
} }
@ -243,7 +243,7 @@ TQVariant pqxxSqlCursor::pValue(uint pos)const
} }
else if (f->typeGroup() == Field::BLOBGroup) 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; // kdDebug() << r.name() << ", " << r.c_str() << ", " << r.type() << ", " << r.size() << endl;
return ::pgsqlByteaToByteArray((*m_res)[at()][pos]); return ::pgsqlByteaToByteArray((*m_res)[at()][pos]);
} }

@ -20,6 +20,8 @@
#ifndef KEXIDB_CURSOR_PQXX_H #ifndef KEXIDB_CURSOR_PQXX_H
#define KEXIDB_CURSOR_PQXX_H #define KEXIDB_CURSOR_PQXX_H
#include "config.h"
#include <kexidb/cursor.h> #include <kexidb/cursor.h>
#include <kexidb/connection.h> #include <kexidb/connection.h>
#include <kexidb/utils.h> #include <kexidb/utils.h>
@ -74,7 +76,7 @@ private:
friend class pqxxSqlConnection; friend class pqxxSqlConnection;
}; };
inline TQVariant pgsqlCStrToVariant(const pqxx::result::field& r) inline TQVariant pgsqlCStrToVariant(const PQXX_FIELD_CLASS& r)
{ {
switch(r.type()) switch(r.type())
{ {

@ -1,5 +1,7 @@
include $(top_srcdir)/kexi/Makefile.global include $(top_srcdir)/kexi/Makefile.global
CXXFLAGS += $(PQXX_CXXFLAGS)
kde_module_LTLIBRARIES = keximigrate_pqxx.la kde_module_LTLIBRARIES = keximigrate_pqxx.la
INCLUDES = -I$(srcdir)/../../.. -I$(top_srcdir)/kexi $(all_includes) -I$(PG_INCDIR) -I$(PQXX_INCDIR) INCLUDES = -I$(srcdir)/../../.. -I$(top_srcdir)/kexi $(all_includes) -I$(PG_INCDIR) -I$(PQXX_INCDIR)

@ -1,7 +1,7 @@
SUBDIRS = kohyphen . tests SUBDIRS = kohyphen . tests
INCLUDES= $(KOFFICECORE_INCLUDES) $(KOFFICEUI_INCLUDES) $(KSTORE_INCLUDES) $(all_includes) INCLUDES= $(KOFFICECORE_INCLUDES) $(KOFFICEUI_INCLUDES) $(KSTORE_INCLUDES) $(all_includes)
## Needed for kohyphen... ## Needed for kohyphen...
KDE_CXXFLAGS = $(USE_EXCEPTIONS) CXXFLAGS += $(USE_EXCEPTIONS)
lib_LTLIBRARIES = libkotext.la lib_LTLIBRARIES = libkotext.la
libkotext_la_SOURCES = KoComplexText.cpp KoRichText.cpp \ libkotext_la_SOURCES = KoComplexText.cpp KoRichText.cpp \

@ -1,6 +1,8 @@
include $(top_srcdir)/lib/kross/Makefile.global include $(top_srcdir)/lib/kross/Makefile.global
apiincludedir=$(includedir)/kross/api apiincludedir=$(includedir)/kross/api
CXXFLAGS += $(USE_EXCEPTIONS)
apiinclude_HEADERS = \ apiinclude_HEADERS = \
callable.h \ callable.h \
class.h \ class.h \

@ -1,5 +1,7 @@
include $(top_srcdir)/lib/kross/Makefile.global include $(top_srcdir)/lib/kross/Makefile.global
CXXFLAGS += $(USE_EXCEPTIONS)
lib_LTLIBRARIES = libkrossmain.la lib_LTLIBRARIES = libkrossmain.la
libkrossmain_la_SOURCES = krossconfig.cpp mainmodule.cpp scriptcontainer.cpp manager.cpp \ libkrossmain_la_SOURCES = krossconfig.cpp mainmodule.cpp scriptcontainer.cpp manager.cpp \

@ -1,5 +1,7 @@
include $(top_srcdir)/lib/kross/Makefile.global include $(top_srcdir)/lib/kross/Makefile.global
CXXFLAGS += $(USE_EXCEPTIONS)
kde_module_LTLIBRARIES = krosspython.la kde_module_LTLIBRARIES = krosspython.la
krosspython_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries) $(LIBPYTHON) $(PYTHONLIB) -module $(VER_INFO) krosspython_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries) $(LIBPYTHON) $(PYTHONLIB) -module $(VER_INFO)

@ -1,5 +1,7 @@
include $(top_srcdir)/lib/kross/Makefile.global include $(top_srcdir)/lib/kross/Makefile.global
CXXFLAGS += $(USE_EXCEPTIONS)
noinst_LTLIBRARIES = libkrosspythoncxx.la noinst_LTLIBRARIES = libkrosspythoncxx.la
libkrosspythoncxx_la_SOURCES = \ libkrosspythoncxx_la_SOURCES = \

@ -1,5 +1,7 @@
include $(top_srcdir)/lib/kross/Makefile.global include $(top_srcdir)/lib/kross/Makefile.global
CXXFLAGS += $(USE_EXCEPTIONS)
INCLUDES = -I$(top_srcdir)/lib/kross -I$(RUBY_INCLUDEDIR) $(RUBY_CFLAGS) $(all_includes) INCLUDES = -I$(top_srcdir)/lib/kross -I$(RUBY_INCLUDEDIR) $(RUBY_CFLAGS) $(all_includes)
METASOURCES = AUTO METASOURCES = AUTO
kde_module_LTLIBRARIES = krossruby.la kde_module_LTLIBRARIES = krossruby.la

Loading…
Cancel
Save