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

Nicolas Boichat drinkcat at chromium.org
Mon May 23 11:17:36 UTC 2016


On Mon, May 23, 2016 at 5:49 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> [...]
>>> 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.

By manually adding the libs into some *_LIBS variables:

export DRM_GRALLOC_LIBS="-lsync -lcutils"
export LIBDRM_LIBS="-ldrm ${DRM_GRALLOC_LIBS}"
export INTEL_LIBS+="-lgralloc_drm"

Not very pretty, but it works (some of the dependencies are implicit, then)...

In the interval of time between I sent the patch and now, we started
using this in src/egl/Makefile.am (3 new lines after the "if" line):

if HAVE_EGL_PLATFORM_ANDROID
libEGL_la_LIBADD += -lhardware -lcutils -lsync
libEGL_la_LIBADD += $(DRM_GRALLOC_LIBS)
AM_CFLAGS += $(DRM_GRALLOC_CFLAGS)
AM_CFLAGS += -DHAVE_ANDROID_PLATFORM
dri2_backend_FILES += drivers/dri2/platform_android.c
endif

which allows us to use saner _LIBS definitions:
export DRM_GRALLOC_LIBS="-lgralloc_drm"
export LIBDRM_LIBS="-ldrm"
export INTEL_LIBS="${LIBDRM_LIBS} -ldrm_intel"

This seems to be a little odd as HAVE_EGL_PLATFORM_ANDROID is not 100%
the same thing as building for Android target (even though I can't see
how one could work without the other, and platform_android.c would not
build on other targets anyway)...

Thanks,


More information about the mesa-dev mailing list