[Mesa-dev] [PATCH 12/15] dri/Makefile.defines: Cleanup filepaths for Android

Chad Versace chad at chad-versace.us
Thu Aug 4 02:47:21 PDT 2011


Cleanup 1: Android builds out-of-source, so all paths must be absolute.

Cleanup 2: Include paths for Android cannot be prefixed with -I. (Goodbye
pkgconfig). So define SHARED_INCLUDES without the -I's, and conditionally
add them if doing a non-Android build.

Note: This is in preparation for porting i965 to Android.
CC: Chia-I Wu <olv at lunarg.com>,
CC: Chih-Wei Huang <cwhuang at android-x86.org>
Signed-off-by: Chad Versace <chad at chad-versace.us>
---
 src/mesa/drivers/dri/Makefile.defines |   50 +++++++++++++++++++++-----------
 1 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/src/mesa/drivers/dri/Makefile.defines b/src/mesa/drivers/dri/Makefile.defines
index 3235bdc..71b7c7e 100644
--- a/src/mesa/drivers/dri/Makefile.defines
+++ b/src/mesa/drivers/dri/Makefile.defines
@@ -1,30 +1,46 @@
 # -*-makefile-*-
 
+ifneq ($(MESA_PLATFORM), android)
+	MESA_TOP = ../../../../..
+	LOCAL_PATH = .
+endif
+
 COMMON_GALLIUM_SOURCES := \
-        ../common/utils.c \
-        ../common/vblank.c \
-        ../common/dri_util.c \
-        ../common/xmlconfig.c
+        $(MESA_TOP)/src/mesa/drivers/dri/common/utils.c \
+        $(MESA_TOP)/src/mesa/drivers/dri/common/vblank.c \
+        $(MESA_TOP)/src/mesa/drivers/dri/common/dri_util.c \
+        $(MESA_TOP)/src/mesa/drivers/dri/common/xmlconfig.c
 
 COMMON_SOURCES := $(COMMON_GALLIUM_SOURCES) \
-        ../../common/driverfuncs.c \
-        ../common/texmem.c \
-        ../common/drirenderbuffer.c
+        $(MESA_TOP)/src/mesa/drivers/common/driverfuncs.c \
+        $(MESA_TOP)/src/mesa/drivers/dri/common/texmem.c \
+        $(MESA_TOP)/src/mesa/drivers/dri/common/drirenderbuffer.c
 
 ### Include directories
 SHARED_INCLUDES := \
-	-I. \
-	-I$(TOP)/src/mesa/drivers/dri/common \
-	-I$(TOP)/include \
-	-I$(TOP)/src/mapi \
-	-I$(TOP)/src/mesa \
-	-I$(TOP)/src/egl/main \
-	$(LIBDRM_CFLAGS)
-
-ifeq (0, $(shell test -d server; echo $?))
-	SHARED_INCLUDES += -Iserver
+	$(LOCAL_PATH) \
+	$(MESA_TOP)/src/mesa/drivers/dri/common \
+	$(MESA_TOP)/include \
+	$(MESA_TOP)/src/mapi \
+	$(MESA_TOP)/src/mesa \
+	$(MESA_TOP)/src/egl/main
+
+ifeq (0, $(shell test -d $(LOCAL_PATH)/server; echo $?))
+	SHARED_INCLUDES += $(LOCAL_PATH)/server
 endif
 
+ifeq ($(MESA_PLATFORM), android)
+	SHARED_INCLUDES += \
+		$(call include-path-for drm) \
+		$(call include-path-for expat)
+else
+	SHARED_INCLUDES := $(addprefix -I,$(SHARED_INCLUDES))
+	SHARED_INCLUDES += \
+		$(LIBDRM_CFLAGS) \
+		$(EXPAT_INCLUDES)
+endif # android
+
+
 INCLUDES := $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
 INCLUDES += $(API_DEFINES)
 
-- 
1.7.6



More information about the mesa-dev mailing list