egl: Use pkg-config for Android NDK build
authorGurchetan Singh <gurchetansingh@chromium.org>
Thu, 10 Nov 2016 20:14:47 +0000 (12:14 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 15 Nov 2016 15:49:20 +0000 (15:49 +0000)
It's possible to build Mesa for Android using the traditional
autotools workflow [1]. ChromiumOS fetches Android prebuilts and
puts them in a sysroot. We now want to use pkg-config to specify
the location of system headers and libraries [2].

To enable this, let's add the required pkg-config checks and link
against them.

[1] https://developer.android.com/ndk/guides/standalone_toolchain.html
[2] https://chromium-review.googlesource.com/#/c/403237/

v2: Bundle pkg-config checks together (Emil)
v3: Provide further context on standalone NDK Mesa build (Emil)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
configure.ac
src/egl/Makefile.am

index 3f21cd53a76fdf6df34e343702eb5751fa278b6c..9d62b90cfb5157aee04ea1c232e062a3d3458c92 100644 (file)
@@ -2059,6 +2059,7 @@ for plat in $egl_platforms; do
                ;;
 
        android)
+               PKG_CHECK_MODULES([ANDROID], [cutils hardware sync])
                ;;
 
        *)
index 304b0d3133fcec57a0e13b7fb7bfd6af03b78ce2..7c5abd211485aed2de407153da7592cda8b81a50 100644 (file)
@@ -86,6 +86,8 @@ endif
 
 if HAVE_EGL_PLATFORM_ANDROID
 AM_CFLAGS += -DHAVE_ANDROID_PLATFORM
+AM_CFLAGS += $(ANDROID_CFLAGS)
+libEGL_la_LIBADD += $(ANDROID_LIBS)
 dri2_backend_FILES += drivers/dri2/platform_android.c
 endif