From 9e8f0ee2579793123bb3a113397ea023c9e0145e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 4 Jan 2017 19:49:41 +0100 Subject: [btls] Pass CC and CXX to the BTLS CMake and disable BTLS on older GCC (#4200) CMake doesn't pick up the compiler from the PATH by default, it only looks in default locations so without this we might end up using a different compiler for BTLS than for the main Mono build which we don't want. BTLS also requires a fairly new GCC which includes C++11 features, added a quick check for stdalign.h which BTLS requires and disable it if the header isn't found. Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46712 (cherry picked from commit 488b550ac0275c944e0a2c23be93173382084e5f) --- configure.ac | 2 ++ mono/btls/Makefile.am | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9959c554e0d..e39a33a5453 100644 --- a/configure.ac +++ b/configure.ac @@ -2989,6 +2989,7 @@ case "$host" in AOT_SUPPORTED="yes" BTLS_SUPPORTED=yes BTLS_PLATFORM=i386 + AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no]) ;; darwin*) AOT_SUPPORTED="yes" @@ -3011,6 +3012,7 @@ case "$host" in AOT_SUPPORTED="yes" BTLS_SUPPORTED=yes BTLS_PLATFORM=x86_64 + AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no]) ;; darwin*) AOT_SUPPORTED="yes" diff --git a/mono/btls/Makefile.am b/mono/btls/Makefile.am index 6a5b1061320..9b61a23468e 100644 --- a/mono/btls/Makefile.am +++ b/mono/btls/Makefile.am @@ -50,16 +50,16 @@ all-local: $(BTLS_STATIC_LIST) $(BTLS_SHARED_LIST) if DYNAMIC_BTLS build-shared/Makefile: -mkdir -p build-shared - (cd build-shared && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_DYNAMIC_BTLS=1 $(abs_top_srcdir)/mono/btls) + (cd build-shared && CC="$(CC)" CXX="$(CXX)" $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_DYNAMIC_BTLS=1 $(abs_top_srcdir)/mono/btls) else build-shared/Makefile: -mkdir -p build-shared - (cd build-shared && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls) + (cd build-shared && CC="$(CC)" CXX="$(CXX)" $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls) endif build-static/Makefile: -mkdir -p build-static - (cd build-static && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) $(abs_top_srcdir)/mono/btls) + (cd build-static && CC="$(CC)" CXX="$(CXX)" $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) $(abs_top_srcdir)/mono/btls) $(BTLS_STATIC_LIST): build-static/Makefile $(MAKE) -C build-static $(CMAKE_VERBOSE) -- cgit v1.2.3