From f8c9f960ad6595060fef7075f5e0ef7346af44f8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 19 Mar 2013 08:57:30 +0100 Subject: [PATCH] Fix crosscompiling for Android on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no logic in configure to detect compiler capabilities in the host- and cross-compilers separately, so if the cross-compiler has more capabilities than the host compiler, the compilation will break. This was the case for c++11 on Mac, which is supported by the Android cross-compiler but not by default on the host. There is a fix planned to enable c++11 on Mac, so this is a temporary patch to work around the problem by disabling c++11 explicitly until it has been fixed. Change-Id: I2048dc7f63991c97b11b3980ac91292d2c9b7ce4 Reviewed-by: Morten Johan Sørvig --- configure | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index be0fe72845..91f7c1a4fa 100755 --- a/configure +++ b/configure @@ -4162,7 +4162,12 @@ fi # Detect C++11 support if [ "$CFG_CXX11" != "no" ]; then - if compileTest common/c++11 "C++11"; then + # Configure detects compiler features based on cross compiler, so we need + # to explicitly disable C++11 on Mac to avoid breaking builds where the + # host compiler does not support it. + if [ "$PLATFORM_MAC" = "yes" ] && [ "$XPLATFORM_ANDROID" = "yes" ]; then + CFG_CXX11="no" + elif compileTest common/c++11 "C++11"; then CFG_CXX11="yes" elif [ "$CFG_CXX11" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "C++11 support cannot be enabled due to functionality tests!"