<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-04-27 21:43 GMT+02:00 Rob Herring <span dir="ltr"><<a href="mailto:robh@kernel.org" target="_blank">robh@kernel.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">src/gallium/targets/dri/<wbr>Android.mk contains lots of conditional for<br>
individual drivers. Let's move these details into the individual driver<br>
makefiles.<br>
<br>
In the process, align the make driver conditionals with automake<br>
(i.e. HAVE_GALLIUM_*).<br>
<br>
Signed-off-by: Rob Herring <<a href="mailto:robh@kernel.org">robh@kernel.org</a>><br>
---<br>
Android.mk | 41 +++++++++-------------<br>
src/egl/Android.mk | 14 +++-----<br>
src/gallium/Android.mk | 6 ++--<br>
src/gallium/drivers/freedreno/<wbr>Android.mk | 5 +++<br>
src/gallium/drivers/i915/<wbr>Android.mk | 4 +++<br>
src/gallium/drivers/nouveau/<wbr>Android.mk | 5 +++<br>
src/gallium/drivers/r300/<wbr>Android.mk | 4 +++<br>
src/gallium/drivers/r600/<wbr>Android.mk | 7 ++++<br>
src/gallium/drivers/radeon/<wbr>Android.mk | 7 +++-<br>
src/gallium/drivers/radeonsi/<wbr>Android.mk | 12 ++++++-<br>
src/gallium/drivers/softpipe/<wbr>Android.mk | 4 +++<br>
src/gallium/drivers/svga/<wbr>Android.mk | 4 +++<br>
src/gallium/drivers/vc4/<wbr>Android.mk | 4 +++<br>
src/gallium/drivers/virgl/<wbr>Android.mk | 4 +++<br>
src/gallium/state_trackers/<wbr>dri/Android.mk | 2 +-<br>
src/gallium/targets/dri/<wbr>Android.mk | 58 +++---------------------------<wbr>-<br>
src/gallium/winsys/amdgpu/drm/<wbr>Android.mk | 5 +++<br>
src/gallium/winsys/i915/drm/<wbr>Android.mk | 4 +++<br>
18 files changed, 96 insertions(+), 94 deletions(-)<br>
<br>
diff --git a/Android.mk b/Android.mk<br>
index 08daf770f26b..9f481ee7e109 100644<br>
--- a/Android.mk<br>
+++ b/Android.mk<br>
@@ -40,19 +40,22 @@ MESA_DRI_MODULE_UNSTRIPPED_<wbr>PATH := $(TARGET_OUT_SHARED_LIBRARIES_<wbr>UNSTRIPPED)/$(M<br>
MESA_COMMON_MK := $(MESA_TOP)/<a href="http://Android.common.mk" rel="noreferrer" target="_blank">Android.common.mk</a><br>
MESA_PYTHON2 := python<br>
<br>
-classic_drivers := i915 i965<br>
-gallium_drivers := swrast freedreno i915g nouveau r300g r600g radeonsi vmwgfx vc4 virgl<br>
+classic_drivers := i915.HAVE_I915_DRI i965.HAVE_I965_DRI<br>
+gallium_drivers := \<br>
+ swrast.HAVE_GALLIUM_SOFTPIPE \<br>
+ freedreno.HAVE_GALLIUM_<wbr>FREEDRENO \<br>
+ i915g.HAVE_GALLIUM_I915 \<br>
+ nouveau.HAVE_GALLIUM_NOUVEAU \<br>
+ r300g.HAVE_GALLIUM_R300 \<br>
+ r600g.HAVE_GALLIUM_R600 \<br>
+ radeonsi.HAVE_GALLIUM_RADEONSI \<br>
+ vmwgfx.HAVE_GALLIUM_VMWGFX \<br>
+ vc4.HAVE_GALLIUM_VC4 \<br>
+ virgl.HAVE_GALLIUM_VIRGL<br>
<br>
-MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))<br>
-<br>
-# warn about invalid drivers<br>
-invalid_drivers := $(filter-out \<br>
- $(classic_drivers) $(gallium_drivers), $(MESA_GPU_DRIVERS))<br>
-ifneq ($(invalid_drivers),)<br>
-$(warning invalid GPU drivers: $(invalid_drivers))<br>
-# tidy up<br>
-MESA_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(MESA_GPU_DRIVERS))<br>
-endif<br>
+MESA_BUILD_CLASSIC := $(strip $(foreach d, $(BOARD_GPU_DRIVERS), $(patsubst $(d).%,%, $(filter $(d).%, $(classic_drivers)))))<br>
+MESA_BUILD_GALLIUM := $(strip $(foreach d, $(BOARD_GPU_DRIVERS), $(patsubst $(d).%,%, $(filter $(d).%, $(gallium_drivers)))))<br>
+$(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := true))<br>
<br>
# host and target must be the same arch to generate matypes.h<br>
ifeq ($(TARGET_ARCH),$(HOST_ARCH))<br>
@@ -61,19 +64,7 @@ else<br>
MESA_ENABLE_ASM := false<br>
endif<br>
<br>
-ifneq ($(filter $(classic_drivers), $(MESA_GPU_DRIVERS)),)<br>
-MESA_BUILD_CLASSIC := true<br>
-else<br>
-MESA_BUILD_CLASSIC := false<br>
-endif<br>
-<br>
-ifneq ($(filter $(gallium_drivers), $(MESA_GPU_DRIVERS)),)<br>
-MESA_BUILD_GALLIUM := true<br>
-else<br>
-MESA_BUILD_GALLIUM := false<br>
-endif<br>
-<br>
-MESA_ENABLE_LLVM := $(if $(filter radeonsi,$(MESA_GPU_DRIVERS)),<wbr>true,false)<br>
+MESA_ENABLE_LLVM := $(if $(HAVE_GALLIUM_RADEONSI),true,<wbr>false)<br></blockquote><div><br></div><div>In order to have better flexibility to set MESA_ENABLE_LLVM</div><div>when a second driver will require it, I propose to check named drivers in BOARD_GPU_DRIVERS,</div><div>this will allow simpler integration of new drivers requiring llvm (e.g. swrast)</div><div><br></div><div>+MESA_ENABLE_LLVM := $(if $(filter radeonsi,$(BOARD_GPU_DRIVERS)),true,false)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
# add subdirectories<br>
SUBDIRS := \<br>
diff --git a/src/egl/Android.mk b/src/egl/Android.mk<br>
index 8bbd4605cdca..a0f803a7fc39 100644<br>
--- a/src/egl/Android.mk<br>
+++ b/src/egl/Android.mk<br>
@@ -57,16 +57,10 @@ LOCAL_SHARED_LIBRARIES := \<br>
libcutils \<br>
libsync<br>
<br>
-ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)<br>
-# require i915_dri and/or i965_dri<br>
-LOCAL_REQUIRED_MODULES += \<br>
- $(addsuffix _dri, $(filter i915 i965, $(MESA_GPU_DRIVERS)))<br>
-endif # MESA_BUILD_CLASSIC<br>
-<br>
-ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)<br>
-LOCAL_REQUIRED_MODULES += gallium_dri<br>
-endif # MESA_BUILD_GALLIUM<br>
-<br>
+# This controls enabling building of driver libraries<br>
+LOCAL_REQUIRED_MODULES += $(if $(HAVE_I915_DRI),i915_dri,)<br>
+LOCAL_REQUIRED_MODULES += $(if $(HAVE_I965_DRI),i965_dri,)<br>
+LOCAL_REQUIRED_MODULES += $(if $(MESA_BUILD_GALLIUM),gallium_<wbr>dri,)<br>
<br>
LOCAL_MODULE := libGLES_mesa<br>
LOCAL_MODULE_RELATIVE_PATH := egl<br>
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk<br>
index 7c6bda68d59f..d591aaf62e6a 100644<br>
--- a/src/gallium/Android.mk<br>
+++ b/src/gallium/Android.mk<br>
@@ -42,7 +42,9 @@ SUBDIRS += winsys/amdgpu/drm winsys/radeon/drm<br>
SUBDIRS += winsys/vc4/drm drivers/vc4<br>
SUBDIRS += winsys/virgl/drm winsys/virgl/vtest drivers/virgl<br>
SUBDIRS += winsys/svga/drm drivers/svga<br>
+SUBDIRS += state_trackers/dri<br>
<br>
-SUBDIRS += state_trackers/dri targets/dri<br>
+INC_DIRS := $(call all-named-subdir-makefiles,$(<wbr>SUBDIRS))<br>
+INC_DIRS += $(call all-named-subdir-makefiles,<wbr>targets/dri)<br>
<br>
-include $(call all-named-subdir-makefiles,$(<wbr>SUBDIRS))<br>
+include $(INC_DIRS)<br>
diff --git a/src/gallium/drivers/<wbr>freedreno/Android.mk b/src/gallium/drivers/<wbr>freedreno/Android.mk<br>
index 5c97d9ef2906..330e82420426 100644<br>
--- a/src/gallium/drivers/<wbr>freedreno/Android.mk<br>
+++ b/src/gallium/drivers/<wbr>freedreno/Android.mk<br>
@@ -48,3 +48,8 @@ LOCAL_MODULE := libmesa_pipe_freedreno<br>
include $(LOCAL_PATH)/<a href="http://Android.gen.mk" rel="noreferrer" target="_blank">Android.gen.mk</a><br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_FREEDRENO),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_freedreno)<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/drivers/i915/<wbr>Android.mk b/src/gallium/drivers/i915/<wbr>Android.mk<br>
index fece3053e375..6860770167fc 100644<br>
--- a/src/gallium/drivers/i915/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/i915/<wbr>Android.mk<br>
@@ -34,3 +34,7 @@ LOCAL_MODULE := libmesa_pipe_i915<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_I915),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_i915)<br>
+endif<br>
diff --git a/src/gallium/drivers/nouveau/<wbr>Android.mk b/src/gallium/drivers/nouveau/<wbr>Android.mk<br>
index 3b26b592cdd6..1099cc7a97b4 100644<br>
--- a/src/gallium/drivers/nouveau/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/nouveau/<wbr>Android.mk<br>
@@ -42,3 +42,8 @@ LOCAL_MODULE := libmesa_pipe_nouveau<br>
LOCAL_C_INCLUDES := external/libcxx/include<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_NOUVEAU),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_nouveau)<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/drivers/r300/<wbr>Android.mk b/src/gallium/drivers/r300/<wbr>Android.mk<br>
index e2939ac4043d..0c89cdbb1472 100644<br>
--- a/src/gallium/drivers/r300/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/r300/<wbr>Android.mk<br>
@@ -41,3 +41,7 @@ LOCAL_MODULE := libmesa_pipe_r300<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
<br>
+ifneq ($(HAVE_GALLIUM_R300),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_radeon)<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/drivers/r600/<wbr>Android.mk b/src/gallium/drivers/r600/<wbr>Android.mk<br>
index cc89d8f6aeda..5ae3e945917f 100644<br>
--- a/src/gallium/drivers/r600/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/r600/<wbr>Android.mk<br>
@@ -31,8 +31,15 @@ include $(CLEAR_VARS)<br>
LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES)<br>
<br>
LOCAL_STATIC_LIBRARIES := libmesa_amd_common<br>
+<br>
LOCAL_SHARED_LIBRARIES := libdrm_radeon<br>
LOCAL_MODULE := libmesa_pipe_r600<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_R600),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) $(LOCAL_STATIC_LIBRARIES) \<br>
+ libmesa_winsys_radeon)<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/drivers/radeon/<wbr>Android.mk b/src/gallium/drivers/radeon/<wbr>Android.mk<br>
index 2bddac832a2e..64815f6f0847 100644<br>
--- a/src/gallium/drivers/radeon/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/radeon/<wbr>Android.mk<br>
@@ -34,8 +34,13 @@ ifeq ($(MESA_ENABLE_LLVM),true)<br>
LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU # instructs LLVM to declare LLVMInitializeAMDGPU* functions<br>
endif<br>
<br>
-LOCAL_SHARED_LIBRARIES := libdrm_radeon<br>
+LOCAL_SHARED_LIBRARIES := libdrm_radeon libLLVM<br>
LOCAL_MODULE := libmesa_pipe_radeon<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_R600)$(HAVE_<wbr>GALLIUM_RADEONSI),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE))<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/drivers/<wbr>radeonsi/Android.mk b/src/gallium/drivers/<wbr>radeonsi/Android.mk<br>
index b6f9e26fcccc..1092736e9d02 100644<br>
--- a/src/gallium/drivers/<wbr>radeonsi/Android.mk<br>
+++ b/src/gallium/drivers/<wbr>radeonsi/Android.mk<br>
@@ -38,8 +38,18 @@ LOCAL_C_INCLUDES := \<br>
$(MESA_TOP)/src/amd/common \<br>
$(call generated-sources-dir-for,<wbr>STATIC_LIBRARIES,libmesa_amd_<wbr>common,,)/common<br>
<br>
-LOCAL_SHARED_LIBRARIES := libdrm_radeon<br>
+LOCAL_STATIC_LIBRARIES := libmesa_amd_common<br>
+<br>
+LOCAL_SHARED_LIBRARIES := libdrm_radeon libLLVM<br>
LOCAL_MODULE := libmesa_pipe_radeonsi<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_RADEONSI),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) $(LOCAL_STATIC_LIBRARIES) \<br>
+ libmesa_winsys_radeon \<br>
+ libmesa_winsys_amdgpu \<br>
+)<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/drivers/<wbr>softpipe/Android.mk b/src/gallium/drivers/<wbr>softpipe/Android.mk<br>
index 5d3a93bcee45..dc0fe9dcdbd9 100644<br>
--- a/src/gallium/drivers/<wbr>softpipe/Android.mk<br>
+++ b/src/gallium/drivers/<wbr>softpipe/Android.mk<br>
@@ -35,3 +35,7 @@ LOCAL_MODULE := libmesa_pipe_softpipe<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_SOFTPIPE),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_sw_dri)<br>
+endif<br>
diff --git a/src/gallium/drivers/svga/<wbr>Android.mk b/src/gallium/drivers/svga/<wbr>Android.mk<br>
index 7d23fd500ef5..c50743d50948 100644<br>
--- a/src/gallium/drivers/svga/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/svga/<wbr>Android.mk<br>
@@ -36,3 +36,7 @@ LOCAL_MODULE := libmesa_pipe_svga<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_VMWGFX),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_svga)<br>
+endif<br>
diff --git a/src/gallium/drivers/vc4/<wbr>Android.mk b/src/gallium/drivers/vc4/<wbr>Android.mk<br>
index fdc06744e5ab..003827059cfd 100644<br>
--- a/src/gallium/drivers/vc4/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/vc4/<wbr>Android.mk<br>
@@ -38,3 +38,7 @@ LOCAL_MODULE := libmesa_pipe_vc4<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_VC4),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_vc4)<br>
+endif<br>
diff --git a/src/gallium/drivers/virgl/<wbr>Android.mk b/src/gallium/drivers/virgl/<wbr>Android.mk<br>
index 7c1ba42a5f6c..010e15144c9b 100644<br>
--- a/src/gallium/drivers/virgl/<wbr>Android.mk<br>
+++ b/src/gallium/drivers/virgl/<wbr>Android.mk<br>
@@ -32,3 +32,7 @@ LOCAL_MODULE := libmesa_pipe_virgl<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_VIRGL),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl libmesa_winsys_virgl_vtest)<br>
+endif<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/Android.mk b/src/gallium/state_trackers/<wbr>dri/Android.mk<br>
index 97cf9376e199..a867e50d86c6 100644<br>
--- a/src/gallium/state_trackers/<wbr>dri/Android.mk<br>
+++ b/src/gallium/state_trackers/<wbr>dri/Android.mk<br>
@@ -42,7 +42,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \<br>
LOCAL_STATIC_LIBRARIES := \<br>
libmesa_dri_common<br>
<br>
-ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),)<br>
+ifneq ($(HAVE_GALLIUM_SOFTPIPE),)<br>
LOCAL_SRC_FILES += $(drisw_SOURCES)<br>
endif<br>
<br>
diff --git a/src/gallium/targets/dri/<wbr>Android.mk b/src/gallium/targets/dri/<wbr>Android.mk<br>
index 9dbac8f79637..14d1dd5f5d8b 100644<br>
--- a/src/gallium/targets/dri/<wbr>Android.mk<br>
+++ b/src/gallium/targets/dri/<wbr>Android.mk<br>
@@ -37,62 +37,10 @@ LOCAL_SHARED_LIBRARIES := \<br>
libglapi \<br>
libexpat<br>
<br>
-ifneq ($(filter freedreno,$(MESA_GPU_DRIVERS))<wbr>,)<br>
-LOCAL_CFLAGS += -DGALLIUM_FREEDRENO<br>
-gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno<br>
-LOCAL_SHARED_LIBRARIES += libdrm_freedreno<br>
-endif<br>
-ifneq ($(filter i915g,$(MESA_GPU_DRIVERS)),)<br>
-gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915<br>
-LOCAL_SHARED_LIBRARIES += libdrm_intel<br>
-LOCAL_CFLAGS += -DGALLIUM_I915<br>
-endif<br>
-ifneq ($(filter nouveau,$(MESA_GPU_DRIVERS)),)<br>
-gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau<br>
-LOCAL_CFLAGS += -DGALLIUM_NOUVEAU<br>
-LOCAL_SHARED_LIBRARIES += libdrm_nouveau<br>
-endif<br>
-<br>
-ifneq ($(filter r%,$(MESA_GPU_DRIVERS)),)<br>
-ifneq ($(filter r300g,$(MESA_GPU_DRIVERS)),)<br>
-gallium_DRIVERS += libmesa_pipe_r300<br>
-LOCAL_CFLAGS += -DGALLIUM_R300<br>
-endif<br>
-ifneq ($(filter r600g,$(MESA_GPU_DRIVERS)),)<br>
-gallium_DRIVERS += libmesa_pipe_r600 libmesa_pipe_radeon<br>
-LOCAL_CFLAGS += -DGALLIUM_R600<br>
-endif<br>
-ifneq ($(filter radeonsi,$(MESA_GPU_DRIVERS)),<wbr>)<br>
-gallium_DRIVERS += libmesa_pipe_radeonsi libmesa_winsys_amdgpu libmesa_amd_common libmesa_pipe_radeon<br>
-LOCAL_SHARED_LIBRARIES += libLLVM libdrm_amdgpu<br>
-LOCAL_CFLAGS += -DGALLIUM_RADEONSI<br>
-endif<br>
-gallium_DRIVERS += libmesa_winsys_radeon libmesa_amdgpu_addrlib<br>
-LOCAL_SHARED_LIBRARIES += libdrm_radeon<br>
-endif<br>
-<br>
-ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),)<br>
-gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_dri<br>
-LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE<br>
-endif<br>
-ifneq ($(filter vc4,$(MESA_GPU_DRIVERS)),)<br>
-LOCAL_CFLAGS += -DGALLIUM_VC4<br>
-gallium_DRIVERS += libmesa_winsys_vc4 libmesa_pipe_vc4<br>
-endif<br>
-ifneq ($(filter virgl,$(MESA_GPU_DRIVERS)),)<br>
-LOCAL_CFLAGS += -DGALLIUM_VIRGL<br>
-gallium_DRIVERS += libmesa_winsys_virgl libmesa_winsys_virgl_vtest libmesa_pipe_virgl<br>
-endif<br>
-ifneq ($(filter vmwgfx,$(MESA_GPU_DRIVERS)),)<br>
-gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga<br>
-LOCAL_CFLAGS += -DGALLIUM_VMWGFX<br>
-endif<br>
-ifneq ($(filter nouveau r600g,$(MESA_GPU_DRIVERS)),)<br>
-LOCAL_SHARED_LIBRARIES += libc++<br>
-endif<br>
+$(foreach d, $(MESA_BUILD_GALLIUM), $(eval LOCAL_CFLAGS += $(patsubst HAVE_%,-D%,$(d))))<br>
<br>
LOCAL_WHOLE_STATIC_LIBRARIES := \<br>
- $(gallium_DRIVERS) \<br>
+ $(sort $(GALLIUM_LIBS)) \<br>
libmesa_st_dri \<br>
libmesa_st_mesa \<br>
libmesa_glsl \<br>
@@ -105,6 +53,8 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \<br>
libmesa_util \<br>
libmesa_loader<br>
<br>
+LOCAL_SHARED_LIBRARIES += $(sort $(GALLIUM_SHARED_LIBS))<br>
+<br>
LOCAL_STATIC_LIBRARIES := libelf<br>
<br>
ifeq ($(MESA_ENABLE_LLVM),true)<br>
diff --git a/src/gallium/winsys/amdgpu/<wbr>drm/Android.mk b/src/gallium/winsys/amdgpu/<wbr>drm/Android.mk<br>
index 1b9439c4f886..75a4a15809fe 100644<br>
--- a/src/gallium/winsys/amdgpu/<wbr>drm/Android.mk<br>
+++ b/src/gallium/winsys/amdgpu/<wbr>drm/Android.mk<br>
@@ -41,3 +41,8 @@ LOCAL_MODULE := libmesa_winsys_amdgpu<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_RADEONSI),)<br>
+$(eval GALLIUM_LIBS += $(LOCAL_MODULE) $(LOCAL_STATIC_LIBRARIES))<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
diff --git a/src/gallium/winsys/i915/drm/<wbr>Android.mk b/src/gallium/winsys/i915/drm/<wbr>Android.mk<br>
index b38bd8dca06a..bab3e85c5dd0 100644<br>
--- a/src/gallium/winsys/i915/drm/<wbr>Android.mk<br>
+++ b/src/gallium/winsys/i915/drm/<wbr>Android.mk<br>
@@ -35,3 +35,7 @@ LOCAL_MODULE := libmesa_winsys_i915<br>
<br>
include $(GALLIUM_COMMON_MK)<br>
include $(BUILD_STATIC_LIBRARY)<br>
+<br>
+ifneq ($(HAVE_GALLIUM_I915),)<br>
+$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))<br>
+endif<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
</font></span></blockquote></div><br></div></div>