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>
(cherry picked from commit d3ca65fd8d)
pull/8/head r14.0.5
Slávek Banko 6 years ago
parent 9f407e268c
commit cbc6165918

@ -248,31 +248,56 @@ if test "$compile_pgsql_plugin" = "yes"; then
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
SAVED_CXXFLAGS="$CXXFLAGS" SAVED_CXXFLAGS="$CXXFLAGS"
for CXX_STD_TEST in "" 11 14 17; do AC_MSG_CHECKING([PostgreSQL build with default flags])
CXXFLAGS="$SAVED_CXXFLAGS" PQXX_CXXFLAGS=""
if test "x$CXX_STD_TEST" = "x"; then CXXFLAGS="$SAVED_CXXFLAGS $PQXX_CXXFLAGS"
AC_MSG_CHECKING([PostgreSQL build with default C++ standard]) AC_TRY_COMPILE([
else #include <$PQXX_INCDIR/pqxx/pqxx>
AC_MSG_CHECKING([PostgreSQL build with C++$CXX_STD_TEST]) ],[ ],
CXXFLAGS=-std=c++$CXX_STD_TEST pqxx_flags=yes,
fi 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([ AC_TRY_COMPILE([
#include <$PQXX_INCDIR/pqxx/pqxx> #include <$PQXX_INCDIR/pqxx/pqxx>
],[ ], ],[ ],
pqxx_cxx_std=yes, pqxx_exceptions=yes,
pqxx_cxx_std=no pqxx_exceptions=no
) )
if test "x$pqxx_cxx_std" = "xyes"; then if test "x$pqxx_exceptions" = "xno"; 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) 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 fi
done else
AC_MSG_RESULT(yes)
AC_SUBST(PQXX_CXXFLAGS)
fi
CXXFLAGS="$SAVED_CXXFLAGS" CXXFLAGS="$SAVED_CXXFLAGS"
AC_LANG_RESTORE AC_LANG_RESTORE
fi fi

Loading…
Cancel
Save