Mesa (master): egl: Use pkg-config for Android NDK build

Emil Velikov evelikov at kemper.freedesktop.org
Tue Nov 15 16:11:09 UTC 2016


Module: Mesa
Branch: master
Commit: 0639e253a5fe796e0815ada86086f6e64d1a701a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0639e253a5fe796e0815ada86086f6e64d1a701a

Author: Gurchetan Singh <gurchetansingh at chromium.org>
Date:   Thu Nov 10 12:14:47 2016 -0800

egl: Use pkg-config for Android NDK build

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 at collabora.com>

---

 configure.ac        | 1 +
 src/egl/Makefile.am | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 3f21cd5..9d62b90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2059,6 +2059,7 @@ for plat in $egl_platforms; do
 		;;
 
 	android)
+		PKG_CHECK_MODULES([ANDROID], [cutils hardware sync])
 		;;
 
 	*)
diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index 304b0d3..7c5abd2 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -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
 




More information about the mesa-commit mailing list