[Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds

Emil Velikov emil.l.velikov at gmail.com
Mon May 23 09:49:48 UTC 2016


On 23 May 2016 at 03:15, Nicolas Boichat <drinkcat at chromium.org> wrote:
> Hi Emil,
>
> Apologies for the delay, it's easier to answer your questions now that
> the project has launched
> (https://chrome.googleblog.com/2016/05/the-google-play-store-coming-to.html).
> Basically we are running Android in a Linux container, on top of
> existing Chrome OS.
>
> On Thu, Apr 28, 2016 at 10:36 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> Hi Nicolas,
>>
>> On 28 April 2016 at 11:41, Nicolas Boichat <drinkcat at chromium.org> wrote:
>>> Add support for EGL android platform.
>>>
>>> Also, detect when --host finishes with -android. In that case, we
>>> do not set _GNU_SOURCE, and define autoconf symbol HAVE_ANDROID, so
>>> that Android-specific workarounds can be applied.
>>>
>> I'm quite happy to see patches from Android/CrOS people although I'm a
>> bit confused here.
>> Are these are based for CrOS or Android ? I thought Android had it's
>> own build system.
>
> In our context, we need 2 copies of Mesa libraries: one for Chrome OS
> (surfaceless), and another one for Android.
>
> We considered using Android build system for the Android side, but
> that means having 2 separate repos (which we'd need to keep in sync),
> and 2 different build systems (I've heard Android.mk tends to get out
> of sync over time...).
>
Yes the android build is broken every now and then. That's why I'm
looking if we can get any more people involved or just 'beat' some
sense into Android to use autotools.

> Instead, we are building both libraries using the same sources, and
> same automake-based build system, from Chrome OS chroot (we have a
> minimalist Android toolchain in the Chrome OS chroot that allows us to
> build the Android version).
>
Ack. I hope that Android world will move in the same/similar direction
for the future.

>> Is there any documentation on how one can get things going on your platform ?
>
> No quite, yet, but the ebuild should be available very soon.
>
>>> Signed-off-by: Nicolas Boichat <drinkcat at google.com>
>>> ---
>>>  configure.ac        | 10 ++++++++++
>>>  src/egl/Makefile.am |  5 +++++
>>>  2 files changed, 15 insertions(+)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 5f75c60..6ee978c 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -248,7 +248,11 @@ _SAVE_CPPFLAGS="$CPPFLAGS"
>>>  dnl Compiler macros
>>>  DEFINES="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
>>>  AC_SUBST([DEFINES])
>>> +android=no
>>>  case "$host_os" in
>>> +*-android)
>>> +    android=yes
>>> +    ;;
>>>  linux*|*-gnu*|gnu*)
>>>      DEFINES="$DEFINES -D_GNU_SOURCE"
>>>      ;;
>>> @@ -260,6 +264,8 @@ cygwin*)
>>>      ;;
>>>  esac
>>>
>>> +AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes)
>>> +
>>>  dnl Add flags for gcc and g++
>>>  if test "x$GCC" = xyes; then
>>>      CFLAGS="$CFLAGS -Wall"
>>> @@ -1959,6 +1965,9 @@ for plat in $egl_platforms; do
>>>                         AC_MSG_ERROR([EGL platform surfaceless requires libdrm >= $LIBDRM_REQUIRED])
>>>                 ;;
>>>
>>> +       android)
>> Can you update the documentation in docs/egl.html as well please. Feel
>> free to do that as follow-up patch.
>
> Will do.
>
>> Do you guys have X related libraries on the host_os ? Or you
>> explicitly disable those mesa features that depend on it ?
>
> AFAIK, no X libraries, neither on Chrome OS or Android side.
>
Just realised that Android requires additional libraries (and their
respective headers)

Quick grep shows

for libEGL:
libhardware
liblog
libcutils
libgralloc_drm
libsync

For the dri module(s):
libcutils
liblog


How are you managing to build without mentioning there ? There would
be either issues due to missing includes or unresolved symbols.

Thanks
Emil


More information about the mesa-dev mailing list