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

Stephan Bergmann sbergman at redhat.com
Tue Feb 10 07:43:06 PST 2015


 configure.ac |   69 +++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 41 insertions(+), 28 deletions(-)

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

    Make C++ AC_RUN_IFELSE check link on Windows
    
    Change-Id: Idb4e50a98a2fcdd1746ef14fc0dbe53bf1d7db8a

diff --git a/configure.ac b/configure.ac
index 8ad4f6c..6ea2dc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6225,34 +6225,6 @@ if test "$GCC" = "yes"; then
 fi
 AC_SUBST(HAVE_GCC_PRAGMA_OPERATOR)
 
-AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
-save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
-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++])
-CXXFLAGS=$save_CXXFLAGS
-AC_MSG_RESULT([$broken])
-if test "$broken" = yes; then
-    AC_DEFINE([HAVE_BROKEN_STATIC_INITILIZER_LIST])
-fi
-
 dnl ===================================================================
 dnl system stl sanity tests
 dnl ===================================================================
@@ -12582,22 +12554,30 @@ fi
 #
 # Set up ILIB for MSVC build
 #
+ILIB1=
 if test "$build_os" = "cygwin"; then
     ILIB="."
     if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
         ILIB="$ILIB;$JAVA_HOME/lib"
     fi
+    ILIB1=-link
     if test "$BITNESS_OVERRIDE" = 64; then
         ILIB="$ILIB;$COMPATH/lib/amd64"
+        ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/amd64"
         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
+        ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
         if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81; then
             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
+            ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
         fi
     else
         ILIB="$ILIB;$COMPATH/lib"
+        ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib"
         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
+        ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
         if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81; then
             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
+            ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
         fi
     fi
     ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
@@ -12605,6 +12585,39 @@ if test "$build_os" = "cygwin"; then
     AC_SUBST(ILIB)
 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"
+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])
+fi
+
 
 # ===================================================================
 # Creating bigger shared library to link against


More information about the Libreoffice-commits mailing list