@@ -14,5 +14,3 @@ LOCAL_CFLAGS += \
# Quiet down the build system and remove any .h files from the sources
LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH)
-
-LOCAL_PROPRIETARY_MODULE := true
@@ -21,6 +21,10 @@
# IN THE SOFTWARE.
#
+# Two identical libs are defined here.
+# libdrm: for vendors. installed to /vendor/lib. libdrm_<vendor> uses this.
+# libdrm_platform: for platform modules (such as libminui). installed to /system/lib
+
LIBDRM_COMMON_MK := $(call my-dir)/Android.common.mk
LOCAL_PATH := $(call my-dir)
@@ -33,7 +37,41 @@ include $(LOCAL_PATH)/Makefile.sources
#static library for the device (recovery)
include $(CLEAR_VARS)
+
+LOCAL_MODULE := libdrm_platform
+
+LOCAL_SRC_FILES := $(LIBDRM_FILES)
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH) \
+ $(LOCAL_PATH)/include/drm
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/include/drm
+
+include $(LIBDRM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# Dynamic library for the device
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libdrm_platform
+
+LOCAL_SRC_FILES := $(LIBDRM_FILES)
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH) \
+ $(LOCAL_PATH)/include/drm
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/include/drm
+
+include $(LIBDRM_COMMON_MK)
+include $(BUILD_SHARED_LIBRARY)
+
+# Static library for the device (recovery)
+include $(CLEAR_VARS)
+
LOCAL_MODULE := libdrm
+LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := $(LIBDRM_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := \
@@ -49,6 +87,7 @@ include $(BUILD_STATIC_LIBRARY)
# Shared library for the device
include $(CLEAR_VARS)
LOCAL_MODULE := libdrm
+LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := $(LIBDRM_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := \
@@ -5,7 +5,7 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_amdgpu
-
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_etnaviv
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libdrm
@@ -5,7 +5,7 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_freedreno
-
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
@@ -28,6 +28,7 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_intel
+LOCAL_VENDOR_MODULE := true
LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
@@ -45,6 +45,7 @@ LOCAL_SRC_FILES += $(LIBKMS_RADEON_FILES)
endif
LOCAL_MODULE := libkms
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libdrm
include $(LIBDRM_COMMON_MK)
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_nouveau
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libdrm
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_radeon
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libdrm
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := $(MODETEST_FILES)
LOCAL_MODULE := modetest
-LOCAL_SHARED_LIBRARIES := libdrm
+LOCAL_SHARED_LIBRARIES := libdrm_platform
LOCAL_STATIC_LIBRARIES := libdrm_util
include $(LIBDRM_COMMON_MK)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := $(PROPTEST_FILES)
LOCAL_MODULE := proptest
-LOCAL_SHARED_LIBRARIES := libdrm
+LOCAL_SHARED_LIBRARIES := libdrm_platform
LOCAL_STATIC_LIBRARIES := libdrm_util
include $(LIBDRM_COMMON_MK)
@@ -28,7 +28,7 @@ include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_util
-LOCAL_SHARED_LIBRARIES := libdrm
+LOCAL_SHARED_LIBRARIES := libdrm_platform
LOCAL_SRC_FILES := $(UTIL_FILES)
libdrm_<vendor>.so are moved to the vendor partition (/vendor/lib or /system/vendor/lib if there is no dedicated vendor partition), since they are vendor-specific extension that must not be in the system partition which should be generic. libdrm.so (which is generic) is built/installed twice: once to /vendor/lib to satisfy the dependency for the libdrm_<vendor>.so libs and once to /system/lib for platform clients such as the recovery executable. The platform variant of libdrm is named as libdrm_platform.so since in Android.mk we can't have two different shared libs having same soname. In the near future, this will be fixed by converting these Android.mk files to Android.bp and mark the module libdrm as 'vendor_available: true'. (See https://android-review.googlesource.com/c/368372/ for further detail on the property) Signed-off-by: Jiyong Park <jiyong@google.com> --- Android.common.mk | 2 -- Android.mk | 39 +++++++++++++++++++++++++++++++++++++++ amdgpu/Android.mk | 2 +- etnaviv/Android.mk | 1 + freedreno/Android.mk | 2 +- intel/Android.mk | 1 + libkms/Android.mk | 1 + nouveau/Android.mk | 1 + radeon/Android.mk | 1 + tests/modetest/Android.mk | 2 +- tests/proptest/Android.mk | 2 +- tests/util/Android.mk | 2 +- 12 files changed, 49 insertions(+), 7 deletions(-)