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

Emil Velikov emil.l.velikov at gmail.com
Mon May 23 12:20:39 UTC 2016


On 23 May 2016 at 12:17, Nicolas Boichat <drinkcat at chromium.org> wrote:
> 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)...
>
Indeed.

> 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"
>
Hmm ...configure should error out if the these two deps. are unmet. We
either have a bug or there's some extra patches somewhere ;-)

Can we have .pc files for the extra libraries (something like below,
with the @@ expanded). That way one can use
PKG_CHECK_MODULES(ANDROID_EGL, ....) PKG_CHECK_MODULES(ANDROID_DRI,
...) and the respective _CFLAGS, _LIBS in the targets.

prefix=@prefix@
exec_prefix=${prefix}
libdir=@libdir@
includedir=@includedir@

Name: xatracker
Description: Xorg Gallium3D acceleration library
Version: @XA_VERSION@
Libs: -L${libdir} -lxatracker


> 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)...
>
Indeed it does. I'll push these two in a second, but please follow up
with any extra patches to make things a bit easier to manage.

-Emil


More information about the mesa-dev mailing list