[Mesa-dev] [PATCH 2/8] android: fix building on lollipop

Wu Zhen wuzhen at jidemail.com
Fri Jan 6 17:35:03 UTC 2017


From: WuZhen <wuzhen at jidemail.com>

this commit fixes mesa building on lollipop, however,
llvm on lollipop is too old to build amdgpu

based on initial work by Mauro Rossi <issor.oruam at gmail.com>

Change-Id: I98d646f9e1c61fe2754479382885718386a8bbb7
Reviewed-by: Mauro Rossi <issor.oruam at gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang at linux.org.tw>
---
 Android.common.mk                   | 2 +-
 Android.mk                          | 5 ++++-
 src/gbm/Android.mk                  | 1 +
 src/mesa/Android.libmesa_st_mesa.mk | 1 +
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index 9f64c220f8..7ab3942ee2 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -91,7 +91,7 @@ endif
 endif
 
 LOCAL_CPPFLAGS += \
-	$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \
+	$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-std=c++11) \
 	-Wno-error=non-virtual-dtor \
 	-Wno-non-virtual-dtor
 
diff --git a/Android.mk b/Android.mk
index fb29105a60..b52e7f8232 100644
--- a/Android.mk
+++ b/Android.mk
@@ -95,10 +95,13 @@ SUBDIRS := \
 	src/mesa \
 	src/util \
 	src/egl \
-	src/amd \
 	src/intel \
 	src/mesa/drivers/dri
 
+ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),)
+SUBDIRS += src/amd
+endif
+
 INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS))
 
 ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
diff --git a/src/gbm/Android.mk b/src/gbm/Android.mk
index a3f8fbbeab..89127766e6 100644
--- a/src/gbm/Android.mk
+++ b/src/gbm/Android.mk
@@ -33,6 +33,7 @@ LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/main
 
 LOCAL_STATIC_LIBRARIES := libmesa_loader
+LOCAL_SHARED_LIBRARIES := libdl
 LOCAL_MODULE := libgbm
 
 LOCAL_SRC_FILES := \
diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/Android.libmesa_st_mesa.mk
index 3905ddcf24..90e4ccd210 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -67,6 +67,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += \
 
 LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_glsl
 
+include external/libcxx/libcxx.mk
 include $(LOCAL_PATH)/Android.gen.mk
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
-- 
2.11.0



More information about the mesa-dev mailing list