#already in hardware/arm/gpu/lib
ifeq ($(MALI_LIB_PREBUILT),true)
-LOCAL_PATH:=$(call my-dir)
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
TARGET:=$(GPU_TYPE)
TARGET?=mali400
TARGET:=$(TARGET)_ion
GPU_TARGET_PLATFORM ?= default_7a
-#$(error TARGET=$(TARGET) USING_ION=$(USING_ION))
-include $(CLEAR_VARS)
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23 && echo OK),OK)
+LOCAL_ANDROID_VERSION_NUM:=m
+else
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 22 && echo OK),OK)
+LOCAL_ANDROID_VERSION_NUM:=l
+else
+LOCAL_ANDROID_VERSION_NUM:=k
+endif
+endif
LOCAL_MODULE := libGLES_mali
LOCAL_MULTILIB := both
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
LOCAL_MODULE_PATH_32 := $(TARGET_OUT)/lib/egl
LOCAL_MODULE_PATH_64 := $(TARGET_OUT)/lib64/egl
-LOCAL_SRC_FILES_arm := $(TARGET)/libGLES_mali_$(GPU_TARGET_PLATFORM)_32.so
-LOCAL_SRC_FILES_arm64 := $(TARGET)/libGLES_mali_$(GPU_TARGET_PLATFORM)_64.so
-#$(info src file is $(LOCAL_SRC_FILES_arm))
-#$(info src file is $(LOCAL_SRC_FILES_arm64))
+LOCAL_SRC_FILES := $(TARGET)/libGLES_mali_$(GPU_TARGET_PLATFORM)_32-$(LOCAL_ANDROID_VERSION_NUM).so
+LOCAL_SRC_FILES_arm := $(TARGET)/libGLES_mali_$(GPU_TARGET_PLATFORM)_32-$(LOCAL_ANDROID_VERSION_NUM).so
+LOCAL_SRC_FILES_arm64 := $(TARGET)/libGLES_mali_$(GPU_TARGET_PLATFORM)_64-$(LOCAL_ANDROID_VERSION_NUM).so
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)