1LOCAL_PATH:= $(call my-dir)
2
3###############################################################################
4# Build META EGL library
5#
6
7egl.cfg_config_module :=
8# OpenGL drivers config file
9ifneq ($(BOARD_EGL_CFG),)
10
11include $(CLEAR_VARS)
12LOCAL_MODULE := egl.cfg
13LOCAL_MODULE_TAGS := optional
14LOCAL_MODULE_CLASS := ETC
15LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
16LOCAL_SRC_FILES := ../../../../$(BOARD_EGL_CFG)
17include $(BUILD_PREBUILT)
18egl.cfg_config_module := $(LOCAL_MODULE)
19endif
20
21include $(CLEAR_VARS)
22
23LOCAL_SRC_FILES:= 	       \
24	EGL/egl_tls.cpp        \
25	EGL/egl_cache.cpp      \
26	EGL/egl_display.cpp    \
27	EGL/egl_object.cpp     \
28	EGL/egl.cpp 	       \
29	EGL/eglApi.cpp 	       \
30	EGL/getProcAddress.cpp.arm \
31	EGL/Loader.cpp 	       \
32#
33
34LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libui
35LOCAL_MODULE:= libEGL
36LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
37LOCAL_SHARED_LIBRARIES += libdl
38# we need to access the private Bionic header <bionic_tls.h>
39LOCAL_C_INCLUDES += bionic/libc/private
40
41LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
42LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
43LOCAL_CFLAGS += -fvisibility=hidden
44
45ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true)
46  LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION
47endif
48ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
49  LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
50endif
51
52ifneq ($(MAX_EGL_CACHE_KEY_SIZE),)
53  LOCAL_CFLAGS += -DMAX_EGL_CACHE_KEY_SIZE=$(MAX_EGL_CACHE_KEY_SIZE)
54endif
55
56ifneq ($(MAX_EGL_CACHE_SIZE),)
57  LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
58endif
59
60ifneq ($(filter address,$(SANITIZE_TARGET)),)
61  LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\"
62  LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\"
63endif
64
65LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module)
66egl.cfg_config_module :=
67
68include $(BUILD_SHARED_LIBRARY)
69
70###############################################################################
71# Build the wrapper OpenGL ES 1.x library
72#
73
74include $(CLEAR_VARS)
75
76LOCAL_SRC_FILES:= 		\
77	GLES_CM/gl.cpp.arm 	\
78#
79
80LOCAL_CLANG := false
81LOCAL_SHARED_LIBRARIES += libcutils liblog libEGL
82LOCAL_MODULE:= libGLESv1_CM
83
84LOCAL_SHARED_LIBRARIES += libdl
85# we need to access the private Bionic header <bionic_tls.h>
86LOCAL_C_INCLUDES += bionic/libc/private
87
88LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv1\"
89LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
90LOCAL_CFLAGS += -fvisibility=hidden
91
92# TODO: This is to work around b/20093774. Remove after root cause is fixed
93LOCAL_LDFLAGS_arm += -Wl,--hash-style,both
94
95include $(BUILD_SHARED_LIBRARY)
96
97
98###############################################################################
99# Build the wrapper OpenGL ES 2.x library
100#
101
102include $(CLEAR_VARS)
103
104LOCAL_SRC_FILES:= \
105	GLES2/gl2.cpp   \
106#
107
108LOCAL_CLANG := false
109LOCAL_ARM_MODE := arm
110LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libEGL
111LOCAL_MODULE:= libGLESv2
112
113LOCAL_SHARED_LIBRARIES += libdl
114# we need to access the private Bionic header <bionic_tls.h>
115LOCAL_C_INCLUDES += bionic/libc/private
116
117LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv2\"
118LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
119LOCAL_CFLAGS += -fvisibility=hidden
120
121# TODO: This is to work around b/20093774. Remove after root cause is fixed
122LOCAL_LDFLAGS_arm += -Wl,--hash-style,both
123
124include $(BUILD_SHARED_LIBRARY)
125
126###############################################################################
127# Build the wrapper OpenGL ES 3.x library (this is just different name for v2)
128#
129
130include $(CLEAR_VARS)
131
132LOCAL_SRC_FILES:= \
133	GLES2/gl2.cpp   \
134#
135
136LOCAL_CLANG := false
137LOCAL_ARM_MODE := arm
138LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libEGL
139LOCAL_MODULE:= libGLESv3
140LOCAL_SHARED_LIBRARIES += libdl
141# we need to access the private Bionic header <bionic_tls.h>
142LOCAL_C_INCLUDES += bionic/libc/private
143
144LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv3\"
145LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
146LOCAL_CFLAGS += -fvisibility=hidden
147
148# TODO: This is to work around b/20093774. Remove after root cause is fixed
149LOCAL_LDFLAGS_arm += -Wl,--hash-style,both
150
151include $(BUILD_SHARED_LIBRARY)
152
153###############################################################################
154# Build the ETC1 host static library
155#
156
157include $(CLEAR_VARS)
158
159LOCAL_SRC_FILES:= 		\
160	ETC1/etc1.cpp 	\
161#
162
163LOCAL_MODULE:= libETC1
164LOCAL_MODULE_HOST_OS := darwin linux windows
165
166include $(BUILD_HOST_STATIC_LIBRARY)
167
168###############################################################################
169# Build the ETC1 device library
170#
171
172include $(CLEAR_VARS)
173
174LOCAL_SRC_FILES:= 		\
175	ETC1/etc1.cpp 	\
176#
177
178LOCAL_MODULE:= libETC1
179
180include $(BUILD_SHARED_LIBRARY)
181
182include $(call all-makefiles-under,$(LOCAL_PATH))
183