diff options
Diffstat (limited to 'kexi/kexidb/drivers/configure.in.in')
-rw-r--r-- | kexi/kexidb/drivers/configure.in.in | 69 |
1 files changed, 69 insertions, 0 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") |