5ea4c73058
The platform has a unified GLES2/GLES3 wrapper in libGLESv2.so, which is what bundled binaries should link against. The NDK will have separate GLES2 and GLES3 libraries so that applications will get a link error if they accidentally use GLES3 entry points in a GLES2 application. This symlink allows GLES3 NDK apps to load using the unified wrapper. Change-Id: Ic344ef63c334047fccebb55b7cb2fb23a4c2d61b
195 lines
4.8 KiB
Makefile
195 lines
4.8 KiB
Makefile
LOCAL_PATH:= $(call my-dir)
|
|
|
|
###############################################################################
|
|
# Build META EGL library
|
|
#
|
|
|
|
egl.cfg_config_module :=
|
|
# OpenGL drivers config file
|
|
ifneq ($(BOARD_EGL_CFG),)
|
|
|
|
include $(CLEAR_VARS)
|
|
LOCAL_MODULE := egl.cfg
|
|
LOCAL_MODULE_TAGS := optional
|
|
LOCAL_MODULE_CLASS := ETC
|
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
|
|
LOCAL_SRC_FILES := ../../../../$(BOARD_EGL_CFG)
|
|
include $(BUILD_PREBUILT)
|
|
egl.cfg_config_module := $(LOCAL_MODULE)
|
|
endif
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
EGL/egl_tls.cpp \
|
|
EGL/egl_cache.cpp \
|
|
EGL/egl_display.cpp \
|
|
EGL/egl_object.cpp \
|
|
EGL/egl.cpp \
|
|
EGL/eglApi.cpp \
|
|
EGL/trace.cpp \
|
|
EGL/getProcAddress.cpp.arm \
|
|
EGL/Loader.cpp \
|
|
#
|
|
|
|
LOCAL_SHARED_LIBRARIES += libcutils libutils libGLES_trace
|
|
LOCAL_LDLIBS := -lpthread -ldl
|
|
LOCAL_MODULE:= libEGL
|
|
LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
|
|
LOCAL_SHARED_LIBRARIES += libdl
|
|
# Bionic's private TLS header relies on the ARCH_ARM_HAVE_TLS_REGISTER to
|
|
# select the appropriate TLS codepath
|
|
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
|
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
|
|
endif
|
|
# we need to access the private Bionic header <bionic_tls.h>
|
|
LOCAL_C_INCLUDES += bionic/libc/private
|
|
|
|
LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
|
|
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
|
|
LOCAL_CFLAGS += -fvisibility=hidden
|
|
LOCAL_CFLAGS += -DEGL_TRACE=1
|
|
|
|
ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true)
|
|
LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION
|
|
endif
|
|
|
|
ifeq ($(TARGET_BOARD_PLATFORM),msm7k)
|
|
LOCAL_CFLAGS += -DADRENO130=1
|
|
endif
|
|
|
|
ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
|
|
# see Loader.cpp for details
|
|
LOCAL_CFLAGS += -DSYSTEMUI_PBSIZE_HACK=1
|
|
endif
|
|
|
|
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
|
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
|
|
endif
|
|
|
|
ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
|
|
LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
|
|
endif
|
|
|
|
ifneq ($(MAX_EGL_CACHE_KEY_SIZE),)
|
|
LOCAL_CFLAGS += -DMAX_EGL_CACHE_KEY_SIZE=$(MAX_EGL_CACHE_KEY_SIZE)
|
|
endif
|
|
|
|
ifneq ($(MAX_EGL_CACHE_SIZE),)
|
|
LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
|
|
endif
|
|
|
|
LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module)
|
|
egl.cfg_config_module :=
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
###############################################################################
|
|
# Build the wrapper OpenGL ES 1.x library
|
|
#
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
GLES_CM/gl.cpp.arm \
|
|
#
|
|
|
|
LOCAL_SHARED_LIBRARIES += libcutils libEGL
|
|
LOCAL_LDLIBS := -lpthread -ldl
|
|
LOCAL_MODULE:= libGLESv1_CM
|
|
|
|
LOCAL_SHARED_LIBRARIES += libdl
|
|
# we need to access the private Bionic header <bionic_tls.h>
|
|
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
|
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
|
|
endif
|
|
LOCAL_C_INCLUDES += bionic/libc/private
|
|
|
|
LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv1\"
|
|
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
|
|
LOCAL_CFLAGS += -fvisibility=hidden
|
|
|
|
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
|
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
|
|
endif
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
|
|
###############################################################################
|
|
# Build the wrapper OpenGL ES 2.x library
|
|
#
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
GLES2/gl2.cpp.arm \
|
|
#
|
|
|
|
LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL
|
|
LOCAL_LDLIBS := -lpthread -ldl
|
|
LOCAL_MODULE:= libGLESv2
|
|
|
|
LOCAL_SHARED_LIBRARIES += libdl
|
|
# we need to access the private Bionic header <bionic_tls.h>
|
|
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
|
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
|
|
endif
|
|
LOCAL_C_INCLUDES += bionic/libc/private
|
|
|
|
LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv2\"
|
|
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
|
|
LOCAL_CFLAGS += -fvisibility=hidden
|
|
|
|
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
|
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
|
|
endif
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
# Symlink libGLESv3.so -> libGLESv2.so
|
|
# Platform modules should link against libGLESv2.so (-lGLESv2), but NDK apps
|
|
# will be linked against libGLESv3.so.
|
|
LIBGLESV2 := $(LOCAL_INSTALLED_MODULE)
|
|
LIBGLESV3 := $(subst libGLESv2,libGLESv3,$(LIBGLESV2))
|
|
$(LIBGLESV3): $(LIBGLESV2)
|
|
@echo "Symlink: $@ -> $(notdir $<)"
|
|
@mkdir -p $(dir $@)
|
|
$(hide) ln -sf $(notdir $<) $@
|
|
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
|
|
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(LIBGLESV3)
|
|
LIBGLESV2 :=
|
|
LIBGLESV3 :=
|
|
|
|
###############################################################################
|
|
# Build the ETC1 host static library
|
|
#
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
ETC1/etc1.cpp \
|
|
#
|
|
|
|
LOCAL_LDLIBS := -lpthread -ldl
|
|
LOCAL_MODULE:= libETC1
|
|
|
|
include $(BUILD_HOST_STATIC_LIBRARY)
|
|
|
|
###############################################################################
|
|
# Build the ETC1 device library
|
|
#
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
ETC1/etc1.cpp \
|
|
#
|
|
|
|
LOCAL_LDLIBS := -lpthread -ldl
|
|
LOCAL_MODULE:= libETC1
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|