summaryrefslogtreecommitdiff
path: root/ACE/include
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2018-10-29 17:15:48 -0500
committerFred Hornsey <hornseyf@objectcomputing.com>2018-10-29 17:15:48 -0500
commitef125b3b256e85068b74f2e74755139caada6ecb (patch)
tree1ea5a3be2926d5572d9555c5f8fb2089be8523a7 /ACE/include
parentcddb2d2bb178b0d618c3f4ea6be1a1351ad3998e (diff)
downloadATCD-ef125b3b256e85068b74f2e74755139caada6ecb.tar.gz
platform_android.GNU: Force clang by default
This tries to fix a problem with NDKs where the transision between GCC and clang is causing problems using g++. android_force_clang will have to be set to 0 to use g++, which can be GCC or clang.
Diffstat (limited to 'ACE/include')
-rw-r--r--ACE/include/makeinclude/platform_android.GNU25
1 files changed, 18 insertions, 7 deletions
diff --git a/ACE/include/makeinclude/platform_android.GNU b/ACE/include/makeinclude/platform_android.GNU
index c788dc7f7aa..d0ea482d53a 100644
--- a/ACE/include/makeinclude/platform_android.GNU
+++ b/ACE/include/makeinclude/platform_android.GNU
@@ -25,6 +25,9 @@ rwho = 0
# Android Studio does not seem to reconize so files with versions
versioned_so=0
+# Only try to use clang, unless this is set to 0, then try to use g++
+android_force_clang ?= 1
+
# This section deals with selecting the architecture/compiler
# As of writing information on ABIs can be found at https://developer.android.com/ndk/guides/abis
@@ -78,13 +81,21 @@ ifndef CROSS_COMPILE
$(error ANDROID_ABI passed (set to: $(ANDROID_ABI)) is not valid)
endif
-# Determine if the g++ compiler is GCC or Clang.
-# There are at least 3 assumptions being made here:
-# - There is a g++ command to get the version from
-# - Clang will have "clang" in the version string
-# - If g++ is actually clang, then we can replace that with clang++
-gplusplus_version = $(shell $(CROSS_COMPILE)g++$(CROSS_COMPILE_SUFFIX) --version)
-actually_is_clang := $(strip $(findstring clang,$(gplusplus_version)))
+ifeq ($(android_force_clang),0)
+ # Determine if the g++ compiler is GCC or Clang.
+ # There are at least 3 assumptions being made here:
+ # - There is a g++ command to get the version from
+ # - Clang will have "clang" in the version string
+ # - If g++ is actually clang, then we can replace that with clang++
+ gplusplus_version = $(shell $(CROSS_COMPILE)g++$(CROSS_COMPILE_SUFFIX) --version)
+ actually_is_clang := $(strip $(findstring clang,$(gplusplus_version)))
+else
+ ifeq ($(android_force_clang),1)
+ actually_is_clang := 1
+ else
+ $(error Invalid value for android_force_clang: $(android_force_clang))
+ endif
+endif
FLAGS_C_CC += -W -Wall -Wpointer-arith
ifeq ($(threads),1)