[Mesa-dev] [PATCH 2/2] egl: Use pkg-config for Android NDK build

Emil Velikov emil.l.velikov at gmail.com
Fri Oct 28 15:13:15 UTC 2016


On 27 October 2016 at 17:07, Gurchetan Singh
<gurchetansingh at chromium.org> wrote:
> It's possible to build Mesa for Android using the traditional
> autotools workflow.  To enable this, let's add the required
> pkg-config checks and link against them.
Does the upstream repositories have the files or one requires extra patches ?
Please add a reference or two to bugzilla/gerrit or upstream where
these are available.

> ---
>  configure.ac        | 3 +++
>  src/egl/Makefile.am | 1 +
>  2 files changed, 4 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 3f21cd5..f85538b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2059,6 +2059,9 @@ for plat in $egl_platforms; do
>                 ;;
>
>         android)
> +               PKG_CHECK_MODULES([CUTILS], [cutils])
> +               PKG_CHECK_MODULES([HARDWARE], [hardware])
> +               PKG_CHECK_MODULES([SYNC], [sync])
The following one liner should also work, correct ?
Feel free to name different from "ANDROID" and use that for the
_CFLAGS/_LIBS below.

               PKG_CHECK_MODULES([ANDROID], [cutils hardware sync])

>                 ;;
>
>         *)
> diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
> index 304b0d3..e2f3f70 100644
> --- a/src/egl/Makefile.am
> +++ b/src/egl/Makefile.am
> @@ -85,6 +85,7 @@ dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
>  endif
>
>  if HAVE_EGL_PLATFORM_ANDROID
> +libEGL_la_LIBADD += $(SYNC_LIBS) $(HARDWARE_LIBS) $(CUTILS_LIBS)
>  AM_CFLAGS += -DHAVE_ANDROID_PLATFORM
Then this will become:

 AM_CFLAGS += -DHAVE_ANDROID_PLATFORM
+AM_CFLAGS += $(ANDROID_CFLAGS)
+libEGL_la_LIBADD += $(ANDROID_LIBS)


Thanks
Emil


More information about the mesa-dev mailing list