[Mesa-dev] [PATCH 02/15] glapi: Build libmesa_glapi on Android
Chad Versace
chad at chad-versace.us
Thu Aug 4 02:47:11 PDT 2011
The libmesa_glapi.so on Android is analogous to the libglapi.so on Linux.
libmesa_glapi uses the shared glapi.
The libname is libmesa_glapi, rather than libglapi, due to conventions of
the Android build system. Names of intermediate libraries should be
prefixes by the project name so to prevent naming collisions in the build
tree. (For an example, grep for `libc_` in bionic's Makefiles).
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>
---
Android.mk | 2 +
src/Android.mk | 1 +
src/mapi/Android.mk | 1 +
src/mapi/shared-glapi/Android.mk | 95 ++++++++++++++++++++++++++++++++++++++
4 files changed, 99 insertions(+), 0 deletions(-)
create mode 100644 src/Android.mk
create mode 100644 src/mapi/Android.mk
create mode 100644 src/mapi/shared-glapi/Android.mk
diff --git a/Android.mk b/Android.mk
index 4158194..139491f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -63,4 +63,6 @@ MESA_COMMON_CPPFLAGS := \
MESA_PYTHON2 := python2
MESA_PYTHON_FLAGS := -OO -tt
+include $(call all-subdir-makefiles)
+
endif # !TARGET_SIMULATOR
diff --git a/src/Android.mk b/src/Android.mk
new file mode 100644
index 0000000..5053e7d
--- /dev/null
+++ b/src/Android.mk
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk
new file mode 100644
index 0000000..5053e7d
--- /dev/null
+++ b/src/mapi/Android.mk
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
diff --git a/src/mapi/shared-glapi/Android.mk b/src/mapi/shared-glapi/Android.mk
new file mode 100644
index 0000000..e77f346
--- /dev/null
+++ b/src/mapi/shared-glapi/Android.mk
@@ -0,0 +1,95 @@
+#
+# Copyright © 2011 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+# Authors:
+# Chad Versace <chad at chad-versace.us>
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# ----------------------------------------------------------------------------
+# Build libmesa_glapi
+# ----------------------------------------------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libmesa_glapi
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_TAGS := optional
+
+intermediates := $(call local-intermediates-dir)
+
+# ----------------------------------------------
+# Define MAPI_GLAPI_SOURCES
+# ----------------------------------------------
+
+include $(MESA_TOP)/src/mapi/mapi/sources.mak
+MAPI_GLAPI_SOURCES := $(addprefix $(MESA_TOP)/src/mapi/mapi/, $(MAPI_GLAPI_SOURCES))
+
+
+# ----------------------------------------------
+# Generate MESA_SHARED_GLAPI_H
+# ----------------------------------------------
+
+MESA_SHARED_GLAPI_H := $(intermediates)/glapi_mapi_tmp.h
+
+MESA_SHARED_GLAPI_H: PRIVATE_APIXML := $(MESA_TOP)/src/mapi/glapi/gen/gl_and_es_API.xml
+MESA_SHARED_GLAPI_H: PRIVATE_XML_SOURCES := $(find $(MESA_TOP)/src/mapi/glapi/gen -name \"*.xml\")
+MESA_SHARED_GLAPI_H: PRIVATE_GEN_SCRIPT := $(MESA_TOP)/src/mapi/mapi/mapi_abi.py
+MESA_SHARED_GLAPI_H: PRIVATE_PY_SCRIPTS := $(find $(MESA_TOP)/src/mapi/glapi/gen -name \"*.py\")
+
+MESA_SHARED_GLAPI_H: PRIVATE_DEPS := \
+ $(PRIVATE_XML_SOURCES) \
+ $(PRIVATE_PY_SCRIPTS)
+
+MESA_SHARED_GLAPI_H: PRIVATE_TOOL := \
+ $(MESA_PYTHON2) $(MESA_PYTHON2_FLAGS) $(PRIVATE_GEN_SCRIPT) \
+ --printer shared-glapi \
+ --mode lib \
+ -o $(MESA_SHARED_GLAPI_H) \
+ $(PRIVATE_APIXML)
+
+MESA_SHARED_GLAPI_H: $(PRIVATE_DEPS)
+ @echo XXX01
+ $(call transform-generated-sources)
+
+
+# ----------------------------------------------
+
+LOCAL_C_FLAGS :=
+
+LOCAL_CPPFLAGS := \
+ -DMAPI_MODE_GLAPI \
+ -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
+
+LOCAL_C_INCLUDES := \
+ $(intermediates) \
+ $(MESA_TOP)/src/mapi
+
+LOCAL_C_SOURCES := \
+ $(MAPI_GLAPI_SOURCES)
+
+LOCAL_GENERATED_SOURCES := \
+ $(MESA_SHARED_GLAPI_H)
+
+include $(MESA_LOCAL_VARS)
+include $(BUILD_SHARED_LIBRARY)
--
1.7.6
More information about the mesa-dev
mailing list