[Libreoffice-commits] core.git: configure.ac

Stephan Bergmann sbergman at redhat.com
Wed Sep 30 07:43:27 PDT 2015


 configure.ac |   37 +++++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 16 deletions(-)

New commits:
commit 08ba2b2886c98b9c9d33e66a527c062b1b6b1d37
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 30 16:43:02 2015 +0200

    Blind fix for cross compilation
    
    Change-Id: I3b44f153f66dfc8cbd95c23e5456ffad8df46949

diff --git a/configure.ac b/configure.ac
index 50b75fa..aec3e4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6356,22 +6356,27 @@ if test "$cxx14_constexpr" = yes; then
 fi
 
 AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation])
-save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
-AC_LANG_PUSH([C++])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-    #include <cstddef>
-    #include <cstdlib>
-    void operator delete(void *) throw () { std::exit(1); }
-    void operator delete(void *, std::size_t) throw () { std::exit(0); }
-    struct S { S() { throw 0; } };
-    ]],[[
-    try { new S; } catch (...) {}
-    return 1;
-    ]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no])
-AC_LANG_POP([C++])
-CXXFLAGS=$save_CXXFLAGS
-AC_MSG_RESULT([$cxx14_sized_deallocation])
+if test "$CROSS_COMPILING" = TRUE; then
+    cxx14_sized_deallocation=no
+    AC_MSG_RESULT([$cxx14_sized_deallocation (assumed; cross compiling)])
+else
+    save_CXXFLAGS=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+    AC_LANG_PUSH([C++])
+    AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+        #include <cstddef>
+        #include <cstdlib>
+        void operator delete(void *) throw () { std::exit(1); }
+        void operator delete(void *, std::size_t) throw () { std::exit(0); }
+        struct S { S() { throw 0; } };
+        ]],[[
+        try { new S; } catch (...) {}
+        return 1;
+        ]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no])
+    AC_LANG_POP([C++])
+    CXXFLAGS=$save_CXXFLAGS
+    AC_MSG_RESULT([$cxx14_sized_deallocation])
+fi
 if test "$cxx14_sized_deallocation" = yes; then
     AC_DEFINE([HAVE_CXX14_SIZED_DEALLOCATION])
 fi


More information about the Libreoffice-commits mailing list