[waffle] [PATCH] android: Don't specify -std=gnu99 for C++ builds -- it breaks clang

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 9 07:49:20 PDT 2015


From: Bernhard Rosenkränzer <Bernhard.Rosenkranzer at linaro.org>

Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer at linaro.org>
[Emil Velikov: Apply the workaround for kitkat and older]
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 Android.mk | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Android.mk b/Android.mk
index d29a16a..abfe4ff 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,6 +13,7 @@ waffle_api_version := 0x0106
 
 waffle_android_major_version := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
 waffle_android_minor_version := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
+waffle_android_version := $(waffle_android_major_version).$(waffle_android_minor_version)
 
 $(waffle_top)/include/waffle/waffle_version.h: \
     $(waffle_top)/Android.mk \
@@ -36,7 +37,13 @@ LOCAL_CFLAGS := \
     -DWAFFLE_ANDROID_MINOR_VERSION=$(waffle_android_minor_version) \
     -Wno-pointer-arith
 
-LOCAL_CFLAGS += -std=c99 -fvisibility=hidden
+ifeq ($(shell echo "$(waffle_android_version) >= 4.4" | bc),1)
+LOCAL_CONLYFLAGS := -std=c99
+else
+LOCAL_CFLAGS += -std=c99
+endif
+
+LOCAL_CFLAGS += -fvisibility=hidden
 
 LOCAL_C_INCLUDES := \
     $(LOCAL_PATH)/include \
-- 
2.3.1



More information about the waffle mailing list