emulator opengl: add GLESv2 support to driver + renderer

Added GLESv2 library to system.
Made fixes to the host libOpenGLRender to
compile and support GLESv2 (defined WITH_GLES2).
Other fixes required to make GLESv2 to work.

Change-Id: I9eb198e6092e7fa3550342c50929dd1714282cb3
diff --git a/tools/emulator/opengl/Android.mk b/tools/emulator/opengl/Android.mk
index ba9f93a..c7f7b70 100644
--- a/tools/emulator/opengl/Android.mk
+++ b/tools/emulator/opengl/Android.mk
@@ -18,6 +18,12 @@
 #
 EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/include/libOpenglRender
 
+# common cflags used by several modules
+# This is always set to a module's LOCAL_CFLAGS
+# See the definition of emugl-begin-module in common.mk
+#
+EMUGL_COMMON_CFLAGS := -DWITH_GLES2
+
 # Include common definitions used by all the modules included later
 # in this build file. This contains the definition of all useful
 # emugl-xxxx functions.
@@ -55,6 +61,7 @@
 
 # System shared libraries
 include $(EMUGL_PATH)/system/GLESv1/Android.mk
+include $(EMUGL_PATH)/system/GLESv2/Android.mk
 include $(EMUGL_PATH)/system/egl/Android.mk
 include $(EMUGL_PATH)/tests/gles_android_wrapper/Android.mk