summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2016-04-28 18:41:38 +0800
committerEmil Velikov <emil.l.velikov@gmail.com>2016-05-23 13:23:39 +0100
commit27d713a004da1918d1c5699b077734eceb0ebd75 (patch)
treeabd33456d5f08ddbdd50f3b2764d3042bd6ec3c1 /configure.ac
parent960d854a9866be4e335dd20465342026f660fc78 (diff)
configure.ac: Add support for Android builds
Add support for EGL android platform. Also, detect when --host finishes with -android. In that case, we do not set _GNU_SOURCE, and define autoconf symbol HAVE_ANDROID, so that Android-specific workarounds can be applied. Signed-off-by: Nicolas Boichat <drinkcat@google.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> [Emil Velikov: Rebase on top of HAVE_EGL_PLATFORM_NULL removal] Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 070bae20dc2..47c138a6277 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,7 +255,11 @@ _SAVE_CPPFLAGS="$CPPFLAGS"
dnl Compiler macros
DEFINES="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
AC_SUBST([DEFINES])
+android=no
case "$host_os" in
+*-android)
+ android=yes
+ ;;
linux*|*-gnu*|gnu*)
DEFINES="$DEFINES -D_GNU_SOURCE"
;;
@@ -267,6 +271,8 @@ cygwin*)
;;
esac
+AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes)
+
dnl Add flags for gcc and g++
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -Wall"
@@ -1986,6 +1992,9 @@ for plat in $egl_platforms; do
AC_MSG_ERROR([EGL platform surfaceless requires libdrm >= $LIBDRM_REQUIRED])
;;
+ android)
+ ;;
+
*)
AC_MSG_ERROR([EGL platform '$plat' does not exist])
;;
@@ -2010,6 +2019,7 @@ AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
AM_CONDITIONAL(HAVE_EGL_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless')
+AM_CONDITIONAL(HAVE_EGL_PLATFORM_ANDROID, echo "$egl_platforms" | grep -q 'android')
AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")