[Mesa-dev] [PATCH] mapi: Fix Android build

Chad Versace chad.versace at linux.intel.com
Mon Apr 9 17:05:59 PDT 2012


The Android build was broken by
    commit ca760181b4420696c7e86aa2951d7203522ad1e8
    Author: Kristian Høgsberg <krh at bitplanet.net>
    Date:   Fri Mar 16 12:55:40 2012 -0400
    Subject: shared-glapi: Convert to automake

The guilty change in that commit was changing the variable pattern in
sources.mak from
    FOO_FILE := bar.c
to
    FOO_FILE := $(TOP)/src/mapi/mapi/bar.c

Source file paths in Android makefiles must be relative to the makefile.
To fix this, I reverted the variable pattern back to `FOO_FILE := bar.c`.

CC: Kristian Høgsberg <krh at bitplanet.net>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mapi/Android.mk               |    2 +-
 src/mapi/es1api/Makefile          |    4 ++--
 src/mapi/glapi/Makefile           |    8 ++++----
 src/mapi/mapi/sources.mak         |   22 +++++++++++-----------
 src/mapi/shared-glapi/Makefile.am |    3 ++-
 src/mapi/vgapi/Makefile           |    4 ++--
 6 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk
index b75361f..4f41142 100644
--- a/src/mapi/Android.mk
+++ b/src/mapi/Android.mk
@@ -38,7 +38,7 @@ include $(CLEAR_VARS)
 
 abi_header := shared-glapi/glapi_mapi_tmp.h
 
-LOCAL_SRC_FILES := $(MAPI_GLAPI_FILES)
+LOCAL_SRC_FILES := $(addprefix mapi/, $(MAPI_GLAPI_FILES))
 
 LOCAL_CFLAGS := \
 	-DMAPI_MODE_GLAPI \
diff --git a/src/mapi/es1api/Makefile b/src/mapi/es1api/Makefile
index a9c9123..782dbaa 100644
--- a/src/mapi/es1api/Makefile
+++ b/src/mapi/es1api/Makefile
@@ -41,8 +41,8 @@ esapi_CPPFLAGS := \
 	-DMAPI_ABI_HEADER=\"$(ESAPI)/glapi_mapi_tmp.h\"
 
 include $(MAPI)/sources.mak
-esapi_SOURCES := $(MAPI_BRIDGE_FILES)
-esapi_OBJECTS := $(notdir $(MAPI_BRIDGE_FILES:.c=.o))
+esapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_FILES))
+esapi_OBJECTS := $(esapi_SOURCES:.c=.o)
 esapi_CPPFLAGS += -DMAPI_MODE_BRIDGE
 
 esapi_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(esapi_LIB_DEPS)
diff --git a/src/mapi/glapi/Makefile b/src/mapi/glapi/Makefile
index 211f384..14f4d2a 100644
--- a/src/mapi/glapi/Makefile
+++ b/src/mapi/glapi/Makefile
@@ -19,18 +19,18 @@ ifeq ($(SHARED_GLAPI),1)
 glapi_CPPFLAGS += \
 	-DMAPI_MODE_BRIDGE \
 	-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
-glapi_SOURCES := $(MAPI_BRIDGE_FILES)
+glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_FILES))
 
 glapi_GLAPI_OBJECTS :=
 glapi_ASM_OBJECTS :=
-glapi_MAPI_OBJECTS := $(notdir $(MAPI_BRIDGE_FILES:.c=.o))
+glapi_MAPI_OBJECTS := $(glapi_SOURCES:.c=.o)
 else
 glapi_CPPFLAGS += -DMAPI_MODE_UTIL
-glapi_SOURCES := $(GLAPI_SOURCES) $(MAPI_UTIL_FILES)
+glapi_SOURCES := $(GLAPI_SOURCES) $(addprefix $(MAPI)/, $(MAPI_UTIL_FILES))
 
 glapi_GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
 glapi_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
-glapi_MAPI_OBJECTS := $(notdir $(MAPI_UTIL_FILES:.c=.o))
+glapi_MAPI_OBJECTS := $($(addprefix $(MAPI)/, $(MAPI_UTIL_FILES)):.c=.o)
 endif # SHARED_GLAPI
 
 glapi_OBJECTS := \
diff --git a/src/mapi/mapi/sources.mak b/src/mapi/mapi/sources.mak
index 56f4afd..4add6c4 100644
--- a/src/mapi/mapi/sources.mak
+++ b/src/mapi/mapi/sources.mak
@@ -15,22 +15,22 @@
 #    this mode, compile MAPI_BRIDGE_FILES with MAPI_MODE_BRIDGE defined.
 
 MAPI_UTIL_FILES = \
-	$(TOP)/src/mapi/mapi/u_current.c \
-	$(TOP)/src/mapi/mapi/u_execmem.c
+	u_current.c \
+	u_execmem.c
 
 MAPI_FILES = \
-	$(TOP)/src/mapi/mapi/entry.c \
-	$(TOP)/src/mapi/mapi/mapi.c \
-	$(TOP)/src/mapi/mapi/stub.c \
-	$(TOP)/src/mapi/mapi/table.c \
+	entry.c \
+	mapi.c \
+	stub.c \
+	table.c \
 	$(MAPI_UTIL_FILES)
 
 MAPI_GLAPI_FILES = \
-	$(TOP)/src/mapi/mapi/entry.c \
-	$(TOP)/src/mapi/mapi/mapi_glapi.c \
-	$(TOP)/src/mapi/mapi/stub.c \
-	$(TOP)/src/mapi/mapi/table.c \
+	entry.c \
+	mapi_glapi.c \
+	stub.c \
+	table.c \
 	$(MAPI_UTIL_FILES)
 
 MAPI_BRIDGE_FILES = \
-	$(TOP)/src/mapi/mapi/entry.c
+	entry.c
diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am
index a80ba1f..130479e 100644
--- a/src/mapi/shared-glapi/Makefile.am
+++ b/src/mapi/shared-glapi/Makefile.am
@@ -2,10 +2,11 @@
 
 TOP = $(top_srcdir)
 GLAPI = $(top_srcdir)/src/mapi/glapi
+MAPI = $(top_srcdir)/src/mapi/mapi
 include $(top_srcdir)/src/mapi/mapi/sources.mak
 
 lib_LTLIBRARIES = libglapi.la
-libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
+libglapi_la_SOURCES = $(addprefix $(MAPI)/, $(MAPI_GLAPI_FILES))
 libglapi_la_LDFLAGS = -no-undefined
 
 include $(GLAPI)/gen/glapi_gen.mk
diff --git a/src/mapi/vgapi/Makefile b/src/mapi/vgapi/Makefile
index 91766f0..5628029 100644
--- a/src/mapi/vgapi/Makefile
+++ b/src/mapi/vgapi/Makefile
@@ -10,8 +10,8 @@ VG_LIB_PATCH = 0
 MAPI := $(TOP)/src/mapi/mapi
 
 include $(MAPI)/sources.mak
-VGAPI_SOURCES := $(MAPI_FILES)
-VGAPI_OBJECTS := $(notdir $(MAPI_FILES:.c=.o))
+VGAPI_SOURCES := $(addprefix $(MAPI)/, $(MAPI_FILES))
+VGAPI_OBJECTS := $(VGAPI_SOURCES:.c=.o)
 
 VGAPI_CPPFLAGS := -DMAPI_ABI_HEADER=\"vgapi/vgapi_tmp.h\"
 
-- 
1.7.7.6



More information about the mesa-dev mailing list