[Mesa-dev] [PATCH 1/3] mesa: Add toplevel Android.mk

Chia-I Wu olv at lunarg.com
Tue Aug 16 00:30:51 PDT 2011


Hi Chad,

On Tue, Aug 16, 2011 at 2:14 PM, Chad Versace <chad at chad-versace.us> wrote:
> This is the first step in porting libGLES* and libEGL to Android.
I also has a branch[1] that is ready for merge IMHO and is known to
work.  I do not want to run into a hypothetical situation that we
review and NAK each other.  Shouldn't it be better if we and the list
discuss what is the best way to merge Android support before going
on[2]?

I will talk about my approach first.  I plan to submit a series of
patches that are either small or isolated.  They can be reviewed as
usual.  Then there is a patch that adds Android.mk's to mesa's source
tree.  The patch only adds new files for use by Android, and nothing
else is touched.  The idea is that at that point, the Android support
is known to work, and no regression is possible with the existing ways
of building mesa.  Those familiar with Android's build system can
review the new build system as a whole by just looking at this patch
and give it a try, instead of looking at a fraction at a time.

The upside of this approach is that it works and is ready for review.
The downside is that it suffers from the same pain as SCons does: when
Makefile is changed, Android.mk needs to be updated.

If that is a concern, then I would like to suggest another approach
that needs help from you and/or José.  The idea is for us to isolate
the bits in Makefile's that can be shared with SCons and move them to,
say, sources.mk's.  Then we can include sources.mk's in Makefile's and
have SCons parses them too.  This way we can improve the existing
build systems without cluttering mesa.  Then, I will redo my last
patch to use sources.mk's.

Do you have other concerns regarding either approach?

As implied by above, the main concern I have with your approach (from
the last series) is that I could not verify it and see the whole thing
come together.  You could end up doing what I have been doing for
Android-x86, and I may have to redo it again for gallium provided your
approach is adopted.  The other concern is that I do not think

 patch 1: fix src/mesa/Makefile
 patch 2: add src/mesa/Android.mk
 patch 3: fix src/mesa/drivers/Makefile
 patch 4: add src/mesa/drivers/Android.mk
 (follow this pattern for each directory)

is cleaner than fixing Makefile's first (say for SCons) and then add
Android.mk's as a third build system.

[1] http://cgit.freedesktop.org/~olv/mesa/log/?h=android-gingerbread-upstream,
not the -wip one
[2] I avoid the discussion of whether we want Android support on master here

> The toplevel makefile doesn't build anything yet; it just defines common
> variables.
>
> Also, in order to prevent cluttering of Mesa's toplevel directory, create
> the 'android' directory into which auxillary files needed by the Android
> build system will be placed.
>
> The values for MESA_COMMON_C_FLAGS and MESA_COMMON_CPP_FLAGS, I obtained
> by invoking autogen.sh with the options below and then inspecting
> MESA_TOP/configs/autoconf. My immediate goal is to port i965 to Android,
> so I used the typical flags for building i965.
>    --disable-gallium
>    --enable-32-bit
>    --enable-gles2
>    --enable-gles1
>    --enable-texture-float
>    --with-dri-drivers=i965
>    --with-gallium-drivers=
>
> Note: This is in preparation for porting i965 to Android.
> CC: Chia-I Wu <olv at lunarg.com>,
> Signed-off-by: Chad Versace <chad at chad-versace.us>
> ---
>  Android.mk                 |   63 ++++++++++++++++++++++++++++++++++++++++++++
>  android/mesa_local_vars.mk |   32 ++++++++++++++++++++++
>  2 files changed, 95 insertions(+), 0 deletions(-)
>  create mode 100644 Android.mk
>  create mode 100644 android/mesa_local_vars.mk
>
> diff --git a/Android.mk b/Android.mk
> new file mode 100644
> index 0000000..a52cae5
> --- /dev/null
> +++ b/Android.mk
> @@ -0,0 +1,63 @@
> +#
> +# 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.
> +#
> +
> +ifneq ($(TARGET_SIMULATOR),true)
> +
> +LOCAL_PATH := $(call my-dir)
> +
> +# Top directory of Mesa project.
> +MESA_TOP := $(LOCAL_PATH)
> +
> +MESA_PLATFORM := android
> +
> +# Each Android.mk must include MESA_LOCAL_VARS before "building" any targets.
> +MESA_LOCAL_VARS := $(LOCAL_PATH)/android/mesa_local_vars.mk
> +
> +MESA_COMMON_C_INCLUDES := \
> +       $(MESA_TOP)/include \
> +       $(MESA_TOP)/src
> +
> +MESA_COMMON_CFLAGS :=                          \
> +       -Wall                                  \
> +       -Wno-sign-compare                      \
> +       -Wno-unused-parameter                  \
> +                                              \
> +       -ffast-math                            \
> +       -fvisibility=hidden                    \
> +                                              \
> +       -DFEATURE_ES1                          \
> +       -DFEATURE_ES2                          \
> +       -D_GNU_SOURCE                          \
> +       -DHAVE_POSIX_MEMALIGN                  \
> +       -DPTHREADS                             \
> +       -DTEXTURE_FLOAT_ENABLED                \
> +       -DUSE_X86_ASM
> +
> +MESA_COMMON_CPPFLAGS := \
> +       -Wno-error=non-virtual-dtor \
> +       -Wno-non-virtual-dtor
> +
> +MESA_PYTHON2 := python2
> +MESA_PYTHON_FLAGS := -OO -tt
> +
> +endif # !TARGET_SIMULATOR
> diff --git a/android/mesa_local_vars.mk b/android/mesa_local_vars.mk
> new file mode 100644
> index 0000000..2f8abde
> --- /dev/null
> +++ b/android/mesa_local_vars.mk
> @@ -0,0 +1,32 @@
> +#
> +# 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.
> +#
> +
> +#
> +# file: mesa_local_vars.mk
> +#
> +# Each Android.mk must include this file before "building" any targets.
> +#
> +
> +LOCAL_CFLAGS += $(MESA_COMMON_CFLAGS)
> +LOCAL_CPPFLAGS += $(MESA_COMMON_CPPFLAGS)
> +LOCAL_C_INCLUDES += $(MESA_COMMON_C_INCLUDES)
> --
> 1.7.6
>
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list