[Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds
Emil Velikov
emil.l.velikov at gmail.com
Tue May 24 14:52:13 UTC 2016
On 23 May 2016 at 14:42, Nicolas Boichat <drinkcat at chromium.org> wrote:
> On Mon, May 23, 2016 at 8:20 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> 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 ;-)
>
> We also set PKGCONFIG="false", because, well, we do not have .pc files
> for Android libs. We _could_ create them manually, though,
Arr... it seems like there's more 'hacks' then expected. I would
kindly urge that if you're using the autoconf build to use .pc files,
please ?
There's not need to manually create any of them - just throw the
template and wire it up in the build system.
> but I'm not
> 100% convinced it's any better than specifying them in the mesa ebuild
> (knowing that mesa is the only package we build this way, the
> dependencies are prebuilts that we pull from Android builders).
>
Is adding such workarounds encouranged/wide spread in the ebuild ?
Last time I've looked at the Gentoo ones, there weren't many such
cases.
> So we replace them with LIBXYZ_[CFLAGS/LIBS], and configure is happy with that.
>
> One thing that I wonder about is how we could specify
> libEGL_la_LIBADD += -lhardware -lcutils -lsync
> without hardcoding it in the Makefile.am.
>
> Any idea how we could do that? Or do you think it's ok to hardcode the libs?
>
The proposed solution will handle these. If you guys feel that it's
too much/annoying to deal with, show me a repo and I'll send you the
patches ;-) Please ?
Thanks
Emil
More information about the mesa-dev
mailing list