1 # This is the top-level build file for the Android HW OpenGL ES emulation
4 # You must define BUILD_EMULATOR_OPENGL to 'true' in your environment to
5 # build the following files.
7 # Also define BUILD_EMULATOR_OPENGL_DRIVER to 'true' to build the gralloc
10 ifeq (true,$(BUILD_EMULATOR_OPENGL))
12 # Top-level for all modules
13 EMUGL_PATH := $(call my-dir)
15 # Directory containing common headers used by several modules
16 # This is always set to a module's LOCAL_C_INCLUDES
17 # See the definition of emugl-begin-module in common.mk
19 EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/include/libOpenglRender $(EMUGL_PATH)/system/include
21 # common cflags used by several modules
22 # This is always set to a module's LOCAL_CFLAGS
23 # See the definition of emugl-begin-module in common.mk
25 EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
27 ifeq (O, $(PLATFORM_VERSION_CODENAME))
28 EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC
31 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25 && echo isApi26OrHigher),isApi26OrHigher)
32 EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC
35 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 18 && echo PreJellyBeanMr2),PreJellyBeanMr2)
36 ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
37 EMUGL_COMMON_CFLAGS += -DHAVE_ARM_TLS_REGISTER
40 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 16 && echo PreJellyBean),PreJellyBean)
41 EMUGL_COMMON_CFLAGS += -DALOG_ASSERT=LOG_ASSERT
42 EMUGL_COMMON_CFLAGS += -DALOGE=LOGE
43 EMUGL_COMMON_CFLAGS += -DALOGW=LOGW
44 EMUGL_COMMON_CFLAGS += -DALOGD=LOGD
45 EMUGL_COMMON_CFLAGS += -DALOGV=LOGV
48 # Uncomment the following line if you want to enable debug traces
49 # in the GLES emulation libraries.
50 # EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1
52 # Include common definitions used by all the modules included later
53 # in this build file. This contains the definition of all useful
54 # emugl-xxxx functions.
56 include $(EMUGL_PATH)/common.mk
58 # IMPORTANT: ORDER IS CRUCIAL HERE
60 # For the import/export feature to work properly, you must include
61 # modules below in correct order. That is, if module B depends on
62 # module A, then it must be included after module A below.
64 # This ensures that anything exported by module A will be correctly
65 # be imported by module B when it is declared.
67 # Note that the build system will complain if you try to import a
68 # module that hasn't been declared yet anyway.
71 include $(EMUGL_PATH)/shared/OpenglCodecCommon/Android.mk
73 # System static libraries
74 include $(EMUGL_PATH)/system/GLESv1_enc/Android.mk
75 include $(EMUGL_PATH)/system/GLESv2_enc/Android.mk
76 include $(EMUGL_PATH)/system/renderControl_enc/Android.mk
77 include $(EMUGL_PATH)/system/OpenglSystemCommon/Android.mk
79 # System shared libraries
80 include $(EMUGL_PATH)/system/GLESv1/Android.mk
81 include $(EMUGL_PATH)/system/GLESv2/Android.mk
83 include $(EMUGL_PATH)/system/gralloc/Android.mk
84 include $(EMUGL_PATH)/system/surfaceInterface/Android.mk
85 include $(EMUGL_PATH)/system/egl/Android.mk
87 endif # BUILD_EMULATOR_OPENGL == true