aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2015-10-13 13:18:39 +0200
committerBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2015-10-13 13:18:39 +0200
commit43a249df9f257ea2d50f68815e33e9c238740e6f (patch)
tree94a6399749457ff25fe027d830a3ef940a216ee5
parentd67cd53d9a23147e04998a499eda314faff7face (diff)
downloadpowertop-2.0-linaro-android.tar.gz
Build fixes for Android Mlinaro-android
Don't assume that Android means STLport... M uses libc++ Change-Id: I2abe680f365f043b211ce5e024c65a01b0f5473a Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r--Android.mk10
-rw-r--r--src/android_stubs.h5
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 <linux/ethtool.h>
#include <sys/socket.h>
+#include <string> // 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)