summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2018-07-27 02:50:53 +0200
committerSlávek Banko <[email protected]>2018-07-27 02:51:07 +0200
commitcbc61659188f9036f0efb5aaf95c6bf7cb558b17 (patch)
treeaeb77e97195e6668b42b9815f4bde609bf8e20d8
parent9f407e268c9aae10b409b009c0d3ed4727a98a7e (diff)
downloadkoffice-cbc61659188f9036f0efb5aaf95c6bf7cb558b17.tar.gz
koffice-cbc61659188f9036f0efb5aaf95c6bf7cb558b17.zip
Add test for build of libpqxx with enabled exceptionsr14.0.5
This resolves FTBFS with libpqxx 3.x Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit d3ca65fd8dd632a157f3199f07c6a765bd715b09)
-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