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>
pull/1/head
Slávek Banko 6 years ago
parent c17464869b
commit d3ca65fd8d

@ -248,14 +248,31 @@ 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 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_exceptions=yes,
pqxx_exceptions=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=-std=c++$CXX_STD_TEST
fi
CXXFLAGS="$SAVED_CXXFLAGS $PQXX_CXXFLAGS -std=c++$CXX_STD_TEST"
AC_TRY_COMPILE([
#include <$PQXX_INCDIR/pqxx/pqxx>
],[ ],
@ -263,16 +280,24 @@ if test "$compile_pgsql_plugin" = "yes"; then
pqxx_cxx_std=no
)
if test "x$pqxx_cxx_std" = "xyes"; then
PQXX_CXXFLAGS=$CXXFLAGS
AC_MSG_RESULT(yes)
compile_pgsql_plugin="yes"
PQXX_CXXFLAGS+=" -std=c++$CXX_STD_TEST"
AC_SUBST(PQXX_CXXFLAGS)
AC_MSG_RESULT(yes)
break
else
compile_pgsql_plugin="no"
AC_MSG_RESULT(no)
compile_pgsql_plugin="no"
fi
done
else
AC_MSG_RESULT(yes)
AC_SUBST(PQXX_CXXFLAGS)
fi
else
AC_MSG_RESULT(yes)
AC_SUBST(PQXX_CXXFLAGS)
fi
CXXFLAGS="$SAVED_CXXFLAGS"
AC_LANG_RESTORE
fi

Loading…
Cancel
Save