diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-30 16:43:02 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-30 16:43:02 +0200 |
commit | 08ba2b2886c98b9c9d33e66a527c062b1b6b1d37 (patch) | |
tree | a8e4c5b16f327b5136d61039ef23beb99cbc8e3d /configure.ac | |
parent | 8217c99f6ef29207965ffd43aff64b24b399934d (diff) |
Blind fix for cross compilation
Change-Id: I3b44f153f66dfc8cbd95c23e5456ffad8df46949
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index 50b75fa97d6d..aec3e4a0cca0 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 |