summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-06 10:03:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-06 11:41:10 +0200
commit247d0795312fdb8b1bfc68bf9e0d33459dbfeb63 (patch)
tree53f7fa1b1e82ed4d364d1ae475bacc1d63e4d9c7 /configure.ac
parent5ac1f17e0885f3301287cf494664ff8e02bbd8c2 (diff)
Make AC_LINK_IFELSE (to check HAVE_CPP_INLINE_VARIABLES) work on Windows
Change-Id: I6c71e079f21093d5f8dc4dbca20624e9fc927882 Reviewed-on: https://gerrit.libreoffice.org/60072 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac45
1 files changed, 26 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index ebf8b01ac657..9861188660e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6433,25 +6433,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
-AC_MSG_CHECKING([whether $CXX supports inline variables])
-AC_LANG_PUSH([C++])
-save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #if !defined __cpp_inline_variables
- // This tests for one specific aspect of inline variables that is actually used by
- // ORegistry::ROOT (registry/source/regimpl.cxx):
- struct S { constexpr S() {} };
- struct T { static constexpr S s{}; };
- S const * f() { return &T::s; }
- #endif
- ]])], [
- AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
- AC_MSG_RESULT([yes])
- ], [AC_MSG_RESULT([no])])
-CXXFLAGS=$save_CXXFLAGS
-AC_LANG_POP([C++])
-
AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
@@ -12435,6 +12416,32 @@ if test "$build_os" = "cygwin"; then
AC_SUBST(ILIB)
fi
+AC_MSG_CHECKING([whether $CXX supports inline variables])
+AC_LANG_PUSH([C++])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+if test "$build_os" = cygwin; then
+ save_LIB=$LIB
+ export LIB=$ILIB
+fi
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #if !defined __cpp_inline_variables
+ // This tests for one specific aspect of inline variables that is actually used by
+ // ORegistry::ROOT (registry/source/regimpl.cxx):
+ struct S { constexpr S() {} };
+ struct T { static constexpr S s{}; };
+ S const * f() { return &T::s; }
+ #endif
+ ]])], [
+ AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+CXXFLAGS=$save_CXXFLAGS
+if test "$build_os" = cygwin; then
+ LIB=$save_LIB
+fi
+AC_LANG_POP([C++])
+
dnl We should be able to drop the below check when bumping the GCC baseline to
dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577>
dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be