[Mesa-dev] [PATCH v2 15/15] android: build with libcxx of android lollipop

Chih-Wei Huang cwhuang at android-x86.org
Tue May 19 20:25:39 PDT 2015


The libcxx introduced in android lollipop can be used to
replace stlport.

Fallback to use stlport when build with earlier android
releases.

Signed-off-by: Chih-Wei Huang <cwhuang at linux.org.tw>
---
 Android.common.mk                      | 1 +
 src/gallium/drivers/nouveau/Android.mk | 4 ++++
 src/gallium/drivers/r600/Android.mk    | 4 ++++
 src/gallium/targets/dri/Android.mk     | 3 ++-
 src/glsl/Android.mk                    | 1 -
 5 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index 45474ee..49a4402 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -78,6 +78,7 @@ endif
 
 LOCAL_CPPFLAGS += \
 	-std=c++11 \
+	$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \
 	-Wno-error=non-virtual-dtor \
 	-Wno-non-virtual-dtor
 
diff --git a/src/gallium/drivers/nouveau/Android.mk b/src/gallium/drivers/nouveau/Android.mk
index 420c8e5..daf3abd 100644
--- a/src/gallium/drivers/nouveau/Android.mk
+++ b/src/gallium/drivers/nouveau/Android.mk
@@ -39,6 +39,10 @@ LOCAL_SRC_FILES := \
 LOCAL_SHARED_LIBRARIES := libdrm libdrm_nouveau
 LOCAL_MODULE := libmesa_pipe_nouveau
 
+ifeq ($(MESA_LOLLIPOP_BUILD),true)
+LOCAL_C_INCLUDES := external/libcxx/include
+else
 include external/stlport/libstlport.mk
+endif
 include $(GALLIUM_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/drivers/r600/Android.mk b/src/gallium/drivers/r600/Android.mk
index e935759..bfe3987 100644
--- a/src/gallium/drivers/r600/Android.mk
+++ b/src/gallium/drivers/r600/Android.mk
@@ -33,6 +33,10 @@ LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES)
 LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon
 LOCAL_MODULE := libmesa_pipe_r600
 
+ifeq ($(MESA_LOLLIPOP_BUILD),true)
+LOCAL_C_INCLUDES := external/libcxx/include
+else
 include external/stlport/libstlport.mk
+endif
 include $(GALLIUM_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk
index 78f7b7c..1772d25 100644
--- a/src/gallium/targets/dri/Android.mk
+++ b/src/gallium/targets/dri/Android.mk
@@ -95,7 +95,7 @@ gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga
 LOCAL_CFLAGS += -DGALLIUM_VMWGFX
 endif
 ifneq ($(filter nouveau r600g,$(MESA_GPU_DRIVERS)),)
-LOCAL_SHARED_LIBRARIES += libstlport
+LOCAL_SHARED_LIBRARIES += $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),libc++,libstlport)
 endif
 
 LOCAL_STATIC_LIBRARIES := \
@@ -116,6 +116,7 @@ LOCAL_STATIC_LIBRARIES += \
 	libLLVMR600Info \
 	libLLVMR600AsmPrinter \
 	libelf
+LOCAL_LDLIBS += $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-lgcc)
 endif
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk
index f20741e..f63b7da 100644
--- a/src/glsl/Android.mk
+++ b/src/glsl/Android.mk
@@ -46,7 +46,6 @@ LOCAL_C_INCLUDES := \
 
 LOCAL_MODULE := libmesa_glsl
 
-include external/stlport/libstlport.mk
 include $(LOCAL_PATH)/Android.gen.mk
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
-- 
1.9.1



More information about the mesa-dev mailing list