Fix language context when testing linking against boost, by moving the AC_LANG_PUSH and AC_LANG_POP macros into a macro-wide scope for the AX_BOOST_FOO macros. Upstream: Pending --- libreoffice-7.2.2.2.orig/m4/ax_boost_date_time.m4 +++ libreoffice-7.2.2.2/m4/ax_boost_date_time.m4 @@ -62,15 +62,15 @@ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AC_LANG_PUSH([C++]) + AC_CACHE_CHECK(whether the Boost::Date_Time library is available, ax_cv_boost_date_time, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], [[using namespace boost::gregorian; date d(2002,Jan,10); return 0; ]])], ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) - AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_date_time" = "xyes"; then AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) @@ -110,4 +110,6 @@ CPPFLAGS="$CPPFLAGS_SAVED" LDFLAGS="$LDFLAGS_SAVED" fi + + AC_LANG_POP([C++]) ]) --- libreoffice-7.2.2.2.orig/m4/ax_boost_filesystem.m4 +++ libreoffice-7.2.2.2/m4/ax_boost_filesystem.m4 @@ -67,15 +67,15 @@ LIBS="$LIBS $BOOST_SYSTEM_LIB" export LIBS + AC_LANG_PUSH([C++]) + AC_CACHE_CHECK(whether the Boost::Filesystem library is available, ax_cv_boost_filesystem, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], [[using namespace boost::filesystem; path my_path( "foo/bar/data.txt" ); return 0;]])], ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) - AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_filesystem" = "xyes"; then AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) @@ -115,4 +115,6 @@ LDFLAGS="$LDFLAGS_SAVED" LIBS="$LIBS_SAVED" fi + + AC_LANG_POP([C++]) ]) --- libreoffice-7.2.2.2.orig/m4/ax_boost_iostreams.m4 +++ libreoffice-7.2.2.2/m4/ax_boost_iostreams.m4 @@ -61,10 +61,11 @@ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AC_LANG_PUSH([C++]) + AC_CACHE_CHECK(whether the Boost::IOStreams library is available, ax_cv_boost_iostreams, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include @%:@include ]], [[std::string input = "Hello World!"; @@ -73,7 +74,6 @@ return 0; ]])], ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no) - AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_iostreams" = "xyes"; then AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available]) @@ -113,4 +113,6 @@ CPPFLAGS="$CPPFLAGS_SAVED" LDFLAGS="$LDFLAGS_SAVED" fi + + AC_LANG_POP([C++]) ]) --- libreoffice-7.2.2.2.orig/m4/ax_boost_locale.m4 +++ libreoffice-7.2.2.2/m4/ax_boost_locale.m4 @@ -62,9 +62,11 @@ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AC_LANG_PUSH([C++]) + AC_CACHE_CHECK(whether the Boost::Locale library is available, ax_cv_boost_locale, - [AC_LANG_PUSH([C++]) + [ CXXFLAGS_SAVE=$CXXFLAGS AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], @@ -72,7 +74,6 @@ std::locale::global(gen(""));]])], ax_cv_boost_locale=yes, ax_cv_boost_locale=no) CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_locale" = "xyes"; then AC_SUBST(BOOST_CPPFLAGS) @@ -116,4 +117,6 @@ CPPFLAGS="$CPPFLAGS_SAVED" LDFLAGS="$LDFLAGS_SAVED" fi + + AC_LANG_POP([C++]) ]) --- libreoffice-7.2.2.2.orig/m4/ax_boost_system.m4 +++ libreoffice-7.2.2.2/m4/ax_boost_system.m4 @@ -64,9 +64,11 @@ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS + AC_LANG_PUSH([C++]) + AC_CACHE_CHECK(whether the Boost::System library is available, ax_cv_boost_system, - [AC_LANG_PUSH([C++]) + [ CXXFLAGS_SAVE=$CXXFLAGS CXXFLAGS= @@ -74,7 +76,6 @@ [[boost::system::error_category *a = 0;]])], ax_cv_boost_system=yes, ax_cv_boost_system=no) CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_system" = "xyes"; then AC_SUBST(BOOST_CPPFLAGS) @@ -118,4 +119,6 @@ CPPFLAGS="$CPPFLAGS_SAVED" LDFLAGS="$LDFLAGS_SAVED" fi + + AC_LANG_POP([C++]) ])