Android.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. LOCAL_PATH:= $(call my-dir)
  2. ###############################################################################
  3. # Build META EGL library
  4. #
  5. egl.cfg_config_module :=
  6. # OpenGL drivers config file
  7. ifneq ($(BOARD_EGL_CFG),)
  8. include $(CLEAR_VARS)
  9. LOCAL_MODULE := egl.cfg
  10. LOCAL_MODULE_TAGS := optional
  11. LOCAL_MODULE_CLASS := ETC
  12. LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
  13. LOCAL_SRC_FILES := ../../../../$(BOARD_EGL_CFG)
  14. include $(BUILD_PREBUILT)
  15. egl.cfg_config_module := $(LOCAL_MODULE)
  16. endif
  17. include $(CLEAR_VARS)
  18. LOCAL_SRC_FILES:= \
  19. EGL/egl_tls.cpp \
  20. EGL/egl_cache.cpp \
  21. EGL/egl_display.cpp \
  22. EGL/egl_object.cpp \
  23. EGL/egl.cpp \
  24. EGL/eglApi.cpp \
  25. EGL/trace.cpp \
  26. EGL/getProcAddress.cpp.arm \
  27. EGL/Loader.cpp \
  28. #
  29. LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libGLES_trace
  30. LOCAL_MODULE:= libEGL
  31. LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
  32. LOCAL_SHARED_LIBRARIES += libdl
  33. # we need to access the private Bionic header <bionic_tls.h>
  34. LOCAL_C_INCLUDES += bionic/libc/private
  35. LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
  36. LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
  37. LOCAL_CFLAGS += -fvisibility=hidden
  38. LOCAL_CFLAGS += -DEGL_TRACE=1
  39. ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true)
  40. LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION
  41. endif
  42. ifeq ($(BOARD_EGL_WORKAROUND_BUG_10194508),true)
  43. LOCAL_CFLAGS += -DWORKAROUND_BUG_10194508=1
  44. endif
  45. ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
  46. LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
  47. endif
  48. ifneq ($(MAX_EGL_CACHE_KEY_SIZE),)
  49. LOCAL_CFLAGS += -DMAX_EGL_CACHE_KEY_SIZE=$(MAX_EGL_CACHE_KEY_SIZE)
  50. endif
  51. ifneq ($(MAX_EGL_CACHE_SIZE),)
  52. LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
  53. endif
  54. ifeq ($(BOARD_USE_BGRA_8888), true)
  55. LOCAL_CFLAGS += -DUSE_BGRA_8888
  56. endif
  57. LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module)
  58. egl.cfg_config_module :=
  59. include $(BUILD_SHARED_LIBRARY)
  60. ###############################################################################
  61. # Build the wrapper OpenGL ES 1.x library
  62. #
  63. include $(CLEAR_VARS)
  64. LOCAL_SRC_FILES:= \
  65. GLES_CM/gl.cpp.arm \
  66. #
  67. LOCAL_CLANG := false
  68. LOCAL_SHARED_LIBRARIES += libcutils liblog libEGL
  69. LOCAL_MODULE:= libGLESv1_CM
  70. LOCAL_SHARED_LIBRARIES += libdl
  71. # we need to access the private Bionic header <bionic_tls.h>
  72. LOCAL_C_INCLUDES += bionic/libc/private
  73. LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv1\"
  74. LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
  75. LOCAL_CFLAGS += -fvisibility=hidden
  76. # TODO: This is to work around b/20093774. Remove after root cause is fixed
  77. LOCAL_LDFLAGS_arm += -Wl,--hash-style,both
  78. include $(BUILD_SHARED_LIBRARY)
  79. ###############################################################################
  80. # Build the wrapper OpenGL ES 2.x library
  81. #
  82. include $(CLEAR_VARS)
  83. LOCAL_SRC_FILES:= \
  84. GLES2/gl2.cpp.arm \
  85. #
  86. LOCAL_CLANG := false
  87. LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libEGL
  88. LOCAL_MODULE:= libGLESv2
  89. LOCAL_SHARED_LIBRARIES += libdl
  90. # we need to access the private Bionic header <bionic_tls.h>
  91. LOCAL_C_INCLUDES += bionic/libc/private
  92. LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv2\"
  93. LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
  94. LOCAL_CFLAGS += -fvisibility=hidden
  95. # TODO: This is to work around b/20093774. Remove after root cause is fixed
  96. LOCAL_LDFLAGS_arm += -Wl,--hash-style,both
  97. # Symlink libGLESv3.so -> libGLESv2.so
  98. # Platform modules should link against libGLESv2.so (-lGLESv2), but NDK apps
  99. # will be linked against libGLESv3.so.
  100. # Note we defer the evaluation of the LOCAL_POST_INSTALL_CMD,
  101. # so $(LOCAL_INSTALLED_MODULE) will be expanded to correct value,
  102. # even for both 32-bit and 64-bit installed files in multilib build.
  103. LOCAL_POST_INSTALL_CMD = \
  104. $(hide) ln -sf $(notdir $(LOCAL_INSTALLED_MODULE)) $(dir $(LOCAL_INSTALLED_MODULE))libGLESv3.so
  105. include $(BUILD_SHARED_LIBRARY)
  106. ###############################################################################
  107. # Build the ETC1 host static library
  108. #
  109. include $(CLEAR_VARS)
  110. LOCAL_SRC_FILES:= \
  111. ETC1/etc1.cpp \
  112. #
  113. LOCAL_MODULE:= libETC1
  114. include $(BUILD_HOST_STATIC_LIBRARY)
  115. ###############################################################################
  116. # Build the ETC1 device library
  117. #
  118. include $(CLEAR_VARS)
  119. LOCAL_SRC_FILES:= \
  120. ETC1/etc1.cpp \
  121. #
  122. LOCAL_MODULE:= libETC1
  123. include $(BUILD_SHARED_LIBRARY)
  124. include $(call all-makefiles-under,$(LOCAL_PATH))