Add Android backend

The Android backend provides basic EGL/GLES2 graphics, where everything
is always composited. Overlays are not used. Input is stubbed, therefore
there is no input yet.

This adds the first C++ source file into Weston compositor. The Android
gralloc and fb HAL glue code to the Android EGL library is in C++, and
there is no way to access it from plain C. We have a simple wrapper to
the required C++ class API. Android forces the C++ file name extension
to .cpp.

The android backend is compiled by default. However, all Android
specific calls are protected with #ifdef ANDROID, so it will build also
without Android headers. The binary produced without the Android build
system is useless, but allows build-testing generic Weston changes.
Therefore the android backend is not installed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/configure.ac b/configure.ac
index ad8a44a..d8865f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,7 @@
 
 # Check for programs
 AC_PROG_CC
+AC_PROG_CXX
 
 # Initialize libtool
 LT_PREREQ([2.2])
@@ -95,6 +96,17 @@
   PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
 fi
 
+
+AC_ARG_ENABLE(android-compositor,
+	      AS_HELP_STRING([--disable-android-compositor],
+	                     [do not build-test the Android 4.0 backend]),,
+	      enable_android_compositor=yes)
+AM_CONDITIONAL(ENABLE_ANDROID_COMPOSITOR, test x$enable_android_compositor = xyes)
+if test x$enable_android_compositor = xyes; then
+  AC_DEFINE([BUILD_ANDROID_COMPOSITOR], [1], [Build the compositor for Android 4.0])
+fi
+
+
 AC_ARG_WITH(cairo-glesv2, AS_HELP_STRING([--with-cairo-glesv2],
               [Use GLESv2 cairo instead of full GL]),
               [cairo_modules="cairo-glesv2"],