From 43a249df9f257ea2d50f68815e33e9c238740e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Tue, 13 Oct 2015 13:18:39 +0200 Subject: Build fixes for Android M MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't assume that Android means STLport... M uses libc++ Change-Id: I2abe680f365f043b211ce5e024c65a01b0f5473a Signed-off-by: Bernhard Rosenkränzer --- Android.mk | 10 +++++----- src/android_stubs.h | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Android.mk b/Android.mk index a47f7c4..be7c995 100644 --- a/Android.mk +++ b/Android.mk @@ -5,8 +5,7 @@ include $(LOCAL_PATH)/android.config LOCAL_MODULE := powertop LOCAL_MODULE_TAGS := debug -LOCAL_SHARED_LIBRARIES := libstlport \ - libnl \ +LOCAL_SHARED_LIBRARIES := libnl LOCAL_STATIC_LIBRARIES := libncurses @@ -30,9 +29,7 @@ LOCAL_CPPFLAGS += -DHAVE_NO_PCI \ -DDEFAULT_TERM=\"xterm\" \ -DTERMINFO_PATH=\"/system/etc/terminfo\" -LOCAL_C_INCLUDES += external/stlport/stlport/ \ - external/stlport/stlport/stl \ - external/stlport/stlport/using/h/ \ +LOCAL_C_INCLUDES += external/libcxx/include/ \ bionic \ external/libnl/include/ \ external/ncurses/include \ @@ -109,4 +106,7 @@ LOCAL_SRC_FILES += \ traceevent/trace-seq.c systemimage: powertop + +LOCAL_CPPFLAGS += -std=gnu++11 + include $(BUILD_EXECUTABLE) diff --git a/src/android_stubs.h b/src/android_stubs.h index ceea1b1..2364b6f 100644 --- a/src/android_stubs.h +++ b/src/android_stubs.h @@ -1,5 +1,6 @@ #include #include +#include // Or any other STL header, we're really after _LIBCPP_VERSION /* Android doesn't provide locale support int its C and C++ * runtime. Handled at higher level in application stack. @@ -12,8 +13,10 @@ #define textdomain(x) #define gettext(x) (x) -/* Android C++ new operator does not throw exception on failure */ +#ifndef _LIBCPP_VERSION +/* STLport C++ new operator does not throw exception on failure */ #define set_new_handler(x) +#endif /* define stubs for C++ exception handling */ #define try if (true) -- cgit v1.2.3