Android: rework LLVM build support

Currently, building with "mmma external/mesa3d" which builds all targets
and dependencies is broken for targets that require LLVM. This is due to
the build settings depending on MESA_ENABLE_LLVM. Instead of using a
conditional in the global Android.common.mk, make all the components that
need LLVM explicitly include the necessary build settings.

GALLIVM_CPP_SOURCES doesn't exist anymore, so remove that as well.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
diff --git a/Android.mk b/Android.mk
index e2d792d8..600b37a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -82,6 +82,19 @@
 MESA_ENABLE_LLVM := true
 endif
 
+define mesa-build-with-llvm
+  $(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5), \
+    $(warning Unsupported LLVM version in Android $(MESA_ANDROID_MAJOR_VERSION)),) \
+  $(if $(filter 6,$(MESA_ANDROID_MAJOR_VERSION)), \
+    $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 -DMESA_LLVM_VERSION_PATCH=0) \
+    $(eval LOCAL_STATIC_LIBRARIES += libLLVMCore) \
+    $(eval LOCAL_C_INCLUDES += external/llvm/include external/llvm/device/include),) \
+  $(if $(filter 7,$(MESA_ANDROID_MAJOR_VERSION)), \
+    $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0308 -DMESA_LLVM_VERSION_PATCH=0) \
+    $(eval LOCAL_STATIC_LIBRARIES += libLLVMCore) \
+    $(eval LOCAL_C_INCLUDES += external/llvm/include external/llvm/device/include),)
+endef
+
 # add subdirectories
 SUBDIRS := \
 	src/gbm \