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

Stephan Bergmann sbergman at redhat.com
Tue Feb 10 07:56:50 PST 2015


 configure.ac |   56 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 30 insertions(+), 26 deletions(-)

New commits:
commit e7b9306d8b48dda16c33be84cc926fa0fd9aeac0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 10 16:56:16 2015 +0100

    ...and work around AC_RUN_IFELSE not working when cross-compiling
    
    Change-Id: I7a3a9593cabec68c0d60c17a991207b5d3dab69c

diff --git a/configure.ac b/configure.ac
index 6ea2dc5..d4594e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12586,33 +12586,37 @@ if test "$build_os" = "cygwin"; then
 fi
 
 AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
-save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
-save_LIBS=$LIBS
-if test -n "$ILIB1"; then
-    LIBS="$LIBS $ILIB1"
+if test "$CROSS_COMPILING" = "TRUE"; then
+    broken='assuming not (cross-compiling)'
+else
+    save_CXXFLAGS=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+    save_LIBS=$LIBS
+    if test -n "$ILIB1"; then
+        LIBS="$LIBS $ILIB1"
+    fi
+    AC_LANG_PUSH([C++])
+    AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+        // Exit with failure if the static initializer_list is stored on the
+        // stack (as done by Clang < 3.4):
+        #include <initializer_list>
+        struct S {};
+        bool g(void const * p1, void const * p2) {
+            int n;
+            return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
+        }
+        bool f(void const * p1) {
+            static std::initializer_list<S> s { S() };
+            return g(p1, s.begin());
+        }
+        ]],[[
+            int n;
+            return f(&n) ? 0 : 1;
+        ]])], [broken=no], [broken=yes])
+    AC_LANG_POP([C++])
+    LIBS=$save_LIBS
+    CXXFLAGS=$save_CXXFLAGS
 fi
-AC_LANG_PUSH([C++])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-    // Exit with failure if the static initializer_list is stored on the stack
-    // (as done by Clang < 3.4):
-    #include <initializer_list>
-    struct S {};
-    bool g(void const * p1, void const * p2) {
-        int n;
-        return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
-    }
-    bool f(void const * p1) {
-        static std::initializer_list<S> s { S() };
-        return g(p1, s.begin());
-    }
-    ]],[[
-        int n;
-        return f(&n) ? 0 : 1;
-    ]])], [broken=no], [broken=yes])
-AC_LANG_POP([C++])
-LIBS=$save_LIBS
-CXXFLAGS=$save_CXXFLAGS
 AC_MSG_RESULT([$broken])
 if test "$broken" = yes; then
     AC_DEFINE([HAVE_BROKEN_STATIC_INITILIZER_LIST])


More information about the Libreoffice-commits mailing list