diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-10 16:41:43 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-10 16:42:22 +0100 |
commit | e83393a98ebc512fb261d52c903fb17827648d56 (patch) | |
tree | 107e7c0b7ec923f16e41eab523edf26777f03fd8 /configure.ac | |
parent | 3324d52dccacff9c3d8b18fe5deb8570a713d7c1 (diff) |
Make C++ AC_RUN_IFELSE check link on Windows
Change-Id: Idb4e50a98a2fcdd1746ef14fc0dbe53bf1d7db8a
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 69 |
1 files changed, 41 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac index 8ad4f6ca6fef..6ea2dc54567b 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 |