summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-07-27 02:50:53 +0200
committerSlávek Banko <slavek.banko@axis.cz>2018-07-27 02:50:53 +0200
commitd3ca65fd8dd632a157f3199f07c6a765bd715b09 (patch)
tree69ec449ce20d585adcc1e7b0497cf293c5a80b21
parentc17464869b6c5f7fbbf5a072ea470fbfff2ae26b (diff)
downloadkoffice-d3ca65fd8dd632a157f3199f07c6a765bd715b09.tar.gz
koffice-d3ca65fd8dd632a157f3199f07c6a765bd715b09.zip
Add test for build of libpqxx with enabled exceptions
This resolves FTBFS with libpqxx 3.x Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--kexi/kexidb/drivers/configure.in.in63
1 files changed, 44 insertions, 19 deletions
diff --git a/kexi/kexidb/drivers/configure.in.in b/kexi/kexidb/drivers/configure.in.in
index c33c6fbc..1afe3487 100644
--- a/kexi/kexidb/drivers/configure.in.in
+++ b/kexi/kexidb/drivers/configure.in.in
@@ -248,31 +248,56 @@ 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_MSG_CHECKING([PostgreSQL build with default flags])
+ PQXX_CXXFLAGS=""
+ CXXFLAGS="$SAVED_CXXFLAGS $PQXX_CXXFLAGS"
+ AC_TRY_COMPILE([
+ #include <$PQXX_INCDIR/pqxx/pqxx>
+ ],[ ],
+ pqxx_flags=yes,
+ pqxx_flags=no
+ )
+ if test "x$pqxx_flags" = "xno"; then
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([PostgreSQL build with enabled exceptions])
+ PQXX_CXXFLAGS+=" $USE_EXCEPTIONS"
+ CXXFLAGS="$SAVED_CXXFLAGS $PQXX_CXXFLAGS"
AC_TRY_COMPILE([
#include <$PQXX_INCDIR/pqxx/pqxx>
],[ ],
- pqxx_cxx_std=yes,
- pqxx_cxx_std=no
+ pqxx_exceptions=yes,
+ pqxx_exceptions=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"
+ if test "x$pqxx_exceptions" = "xno"; then
AC_MSG_RESULT(no)
+ for CXX_STD_TEST in 11 14 17; do
+ AC_MSG_CHECKING([PostgreSQL build with C++$CXX_STD_TEST])
+ CXXFLAGS="$SAVED_CXXFLAGS $PQXX_CXXFLAGS -std=c++$CXX_STD_TEST"
+ AC_TRY_COMPILE([
+ #include <$PQXX_INCDIR/pqxx/pqxx>
+ ],[ ],
+ pqxx_cxx_std=yes,
+ pqxx_cxx_std=no
+ )
+ if test "x$pqxx_cxx_std" = "xyes"; then
+ AC_MSG_RESULT(yes)
+ compile_pgsql_plugin="yes"
+ PQXX_CXXFLAGS+=" -std=c++$CXX_STD_TEST"
+ AC_SUBST(PQXX_CXXFLAGS)
+ break
+ else
+ AC_MSG_RESULT(no)
+ compile_pgsql_plugin="no"
+ fi
+ done
+ else
+ AC_MSG_RESULT(yes)
+ AC_SUBST(PQXX_CXXFLAGS)
fi
- done
+ else
+ AC_MSG_RESULT(yes)
+ AC_SUBST(PQXX_CXXFLAGS)
+ fi
CXXFLAGS="$SAVED_CXXFLAGS"
AC_LANG_RESTORE
fi