[Mesa-dev] [PATCH 2/2] Android: move libdrm settings to top-level Android.common.mk

Rob Herring robh at kernel.org
Tue Jun 7 23:27:34 UTC 2016


Fix warnings like these due to HAVE_LIBDRM being inconsistently defined:

external/libdrm/include/drm/drm.h:839:30: warning: redefinition of typedef 'drm_clip_rect_t' is a C11 feature [-Wtypedef-redefinition]
typedef struct drm_clip_rect drm_clip_rect_t;

HAVE_LIBDRM needs to be set project wide to fix this. This change also
harmlessly links libdrm with everything, but simplifies the makefiles a
bit.

Signed-off-by: Rob Herring <robh at kernel.org>
---
 Android.common.mk                            | 6 ++++++
 src/egl/Android.mk                           | 6 ------
 src/gallium/auxiliary/pipe-loader/Android.mk | 3 ---
 src/gallium/drivers/freedreno/Android.mk     | 2 +-
 src/gallium/drivers/nouveau/Android.mk       | 2 +-
 src/gallium/drivers/r300/Android.mk          | 2 +-
 src/gallium/drivers/r600/Android.mk          | 2 +-
 src/gallium/drivers/radeon/Android.mk        | 2 +-
 src/gallium/drivers/radeonsi/Android.mk      | 2 +-
 src/gallium/drivers/vc4/Android.mk           | 1 -
 src/gallium/drivers/virgl/Android.mk         | 1 -
 src/gallium/state_trackers/dri/Android.mk    | 1 -
 src/gallium/targets/dri/Android.mk           | 5 -----
 src/gallium/winsys/amdgpu/drm/Android.mk     | 2 +-
 src/gallium/winsys/freedreno/drm/Android.mk  | 2 +-
 src/gallium/winsys/i915/drm/Android.mk       | 2 +-
 src/gallium/winsys/intel/drm/Android.mk      | 2 +-
 src/gallium/winsys/nouveau/drm/Android.mk    | 2 +-
 src/gallium/winsys/radeon/drm/Android.mk     | 2 +-
 src/gallium/winsys/svga/drm/Android.mk       | 1 -
 src/gallium/winsys/vc4/drm/Android.mk        | 1 -
 src/gallium/winsys/virgl/drm/Android.mk      | 1 -
 src/gbm/Android.mk                           | 1 -
 src/loader/Android.mk                        | 5 -----
 src/mesa/drivers/dri/Android.mk              | 1 -
 25 files changed, 18 insertions(+), 39 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index 831cbe5..dee22da 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -82,6 +82,12 @@ LOCAL_CFLAGS += \
 	-D__STDC_LIMIT_MACROS
 endif
 
+# add libdrm if there are hardware drivers
+ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
+LOCAL_CFLAGS += -DHAVE_LIBDRM
+LOCAL_SHARED_LIBRARIES += libdrm
+endif
+
 LOCAL_CPPFLAGS += \
 	$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \
 	-Wno-error=non-virtual-dtor \
diff --git a/src/egl/Android.mk b/src/egl/Android.mk
index 3c68452..b7738f9 100644
--- a/src/egl/Android.mk
+++ b/src/egl/Android.mk
@@ -61,12 +61,6 @@ ifeq ($(shell echo "$(MESA_ANDROID_VERSION) >= 4.2" | bc),1)
 LOCAL_SHARED_LIBRARIES += libsync
 endif
 
-# add libdrm if there are hardware drivers
-ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
-LOCAL_CFLAGS += -DHAVE_LIBDRM
-LOCAL_SHARED_LIBRARIES += libdrm
-endif
-
 ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
 # require i915_dri and/or i965_dri
 LOCAL_REQUIRED_MODULES += \
diff --git a/src/gallium/auxiliary/pipe-loader/Android.mk b/src/gallium/auxiliary/pipe-loader/Android.mk
index 2789313..006bb0e 100644
--- a/src/gallium/auxiliary/pipe-loader/Android.mk
+++ b/src/gallium/auxiliary/pipe-loader/Android.mk
@@ -38,10 +38,7 @@ LOCAL_SRC_FILES := $(COMMON_SOURCES)
 LOCAL_MODULE := libmesa_pipe_loader
 
 ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
-LOCAL_CFLAGS += -DHAVE_LIBDRM
 LOCAL_SRC_FILES += $(DRM_SOURCES)
-
-LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_STATIC_LIBRARIES := libmesa_loader
 endif
 
diff --git a/src/gallium/drivers/freedreno/Android.mk b/src/gallium/drivers/freedreno/Android.mk
index f630dc1..e901b36 100644
--- a/src/gallium/drivers/freedreno/Android.mk
+++ b/src/gallium/drivers/freedreno/Android.mk
@@ -40,7 +40,7 @@ LOCAL_C_INCLUDES := \
 
 LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_freedreno
+LOCAL_SHARED_LIBRARIES := libdrm_freedreno
 LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
 LOCAL_MODULE := libmesa_pipe_freedreno
 
diff --git a/src/gallium/drivers/nouveau/Android.mk b/src/gallium/drivers/nouveau/Android.mk
index daf3abd..839a389 100644
--- a/src/gallium/drivers/nouveau/Android.mk
+++ b/src/gallium/drivers/nouveau/Android.mk
@@ -36,7 +36,7 @@ LOCAL_SRC_FILES := \
 	$(NVC0_CODEGEN_SOURCES) \
 	$(NVC0_C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_nouveau
+LOCAL_SHARED_LIBRARIES := libdrm_nouveau
 LOCAL_MODULE := libmesa_pipe_nouveau
 
 ifeq ($(MESA_LOLLIPOP_BUILD),true)
diff --git a/src/gallium/drivers/r300/Android.mk b/src/gallium/drivers/r300/Android.mk
index bb31519..e2939ac 100644
--- a/src/gallium/drivers/r300/Android.mk
+++ b/src/gallium/drivers/r300/Android.mk
@@ -35,7 +35,7 @@ LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/mesa
 
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon
+LOCAL_SHARED_LIBRARIES := libdrm_radeon
 LOCAL_MODULE := libmesa_pipe_r300
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/drivers/r600/Android.mk b/src/gallium/drivers/r600/Android.mk
index bfe3987..6476091 100644
--- a/src/gallium/drivers/r600/Android.mk
+++ b/src/gallium/drivers/r600/Android.mk
@@ -30,7 +30,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon
+LOCAL_SHARED_LIBRARIES := libdrm_radeon
 LOCAL_MODULE := libmesa_pipe_r600
 
 ifeq ($(MESA_LOLLIPOP_BUILD),true)
diff --git a/src/gallium/drivers/radeon/Android.mk b/src/gallium/drivers/radeon/Android.mk
index 6997a6d..2f72f1f 100644
--- a/src/gallium/drivers/radeon/Android.mk
+++ b/src/gallium/drivers/radeon/Android.mk
@@ -34,7 +34,7 @@ ifeq ($(MESA_ENABLE_LLVM),true)
 LOCAL_SRC_FILES += $(LLVM_C_FILES)
 endif
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon
+LOCAL_SHARED_LIBRARIES := libdrm_radeon
 LOCAL_MODULE := libmesa_pipe_radeon
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/drivers/radeonsi/Android.mk b/src/gallium/drivers/radeonsi/Android.mk
index 7e5e54b..1a9e547 100644
--- a/src/gallium/drivers/radeonsi/Android.mk
+++ b/src/gallium/drivers/radeonsi/Android.mk
@@ -30,7 +30,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon
+LOCAL_SHARED_LIBRARIES := libdrm_radeon
 LOCAL_MODULE := libmesa_pipe_radeonsi
 
 # generate sources
diff --git a/src/gallium/drivers/vc4/Android.mk b/src/gallium/drivers/vc4/Android.mk
index 2efb472..de9d5e3 100644
--- a/src/gallium/drivers/vc4/Android.mk
+++ b/src/gallium/drivers/vc4/Android.mk
@@ -30,7 +30,6 @@ LOCAL_SRC_FILES := \
 
 LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
 
-LOCAL_SHARED_LIBRARIES := libdrm
 # We need libmesa_nir to get NIR's generated include directories.
 LOCAL_STATIC_LIBRARIES := libmesa_nir
 LOCAL_MODULE := libmesa_pipe_vc4
diff --git a/src/gallium/drivers/virgl/Android.mk b/src/gallium/drivers/virgl/Android.mk
index b8309e4..7c1ba42 100644
--- a/src/gallium/drivers/virgl/Android.mk
+++ b/src/gallium/drivers/virgl/Android.mk
@@ -28,7 +28,6 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
 	$(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_MODULE := libmesa_pipe_virgl
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/state_trackers/dri/Android.mk b/src/gallium/state_trackers/dri/Android.mk
index f0eb18d..4bdd136 100644
--- a/src/gallium/state_trackers/dri/Android.mk
+++ b/src/gallium/state_trackers/dri/Android.mk
@@ -46,7 +46,6 @@ endif
 
 ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
 LOCAL_SRC_FILES += $(dri2_SOURCES)
-LOCAL_SHARED_LIBRARIES := libdrm
 endif
 
 LOCAL_MODULE := libmesa_st_dri
diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk
index 7da0e8a..24c4bfa 100644
--- a/src/gallium/targets/dri/Android.mk
+++ b/src/gallium/targets/dri/Android.mk
@@ -43,11 +43,6 @@ LOCAL_SHARED_LIBRARIES := \
 	libglapi \
 	libexpat \
 
-ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
-LOCAL_CFLAGS += -DHAVE_LIBDRM
-LOCAL_SHARED_LIBRARIES += libdrm
-endif
-
 ifneq ($(filter freedreno,$(MESA_GPU_DRIVERS)),)
 LOCAL_CFLAGS += -DGALLIUM_FREEDRENO
 gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno
diff --git a/src/gallium/winsys/amdgpu/drm/Android.mk b/src/gallium/winsys/amdgpu/drm/Android.mk
index 5773234..0a26156 100644
--- a/src/gallium/winsys/amdgpu/drm/Android.mk
+++ b/src/gallium/winsys/amdgpu/drm/Android.mk
@@ -40,7 +40,7 @@ LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/addrlib/inc/chip/r800 \
 	$(LOCAL_PATH)/addrlib/r800/chip
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_amdgpu
+LOCAL_SHARED_LIBRARIES := libdrm_amdgpu
 LOCAL_MODULE := libmesa_winsys_amdgpu
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/freedreno/drm/Android.mk b/src/gallium/winsys/freedreno/drm/Android.mk
index b45d3d4..0a8e8f1 100644
--- a/src/gallium/winsys/freedreno/drm/Android.mk
+++ b/src/gallium/winsys/freedreno/drm/Android.mk
@@ -27,7 +27,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_freedreno
+LOCAL_SHARED_LIBRARIES := libdrm_freedreno
 LOCAL_MODULE := libmesa_winsys_freedreno
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/i915/drm/Android.mk b/src/gallium/winsys/i915/drm/Android.mk
index 5c9107b..b38bd8d 100644
--- a/src/gallium/winsys/i915/drm/Android.mk
+++ b/src/gallium/winsys/i915/drm/Android.mk
@@ -30,7 +30,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_intel
+LOCAL_SHARED_LIBRARIES := libdrm_intel
 LOCAL_MODULE := libmesa_winsys_i915
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/intel/drm/Android.mk b/src/gallium/winsys/intel/drm/Android.mk
index 463d315..64752f8 100644
--- a/src/gallium/winsys/intel/drm/Android.mk
+++ b/src/gallium/winsys/intel/drm/Android.mk
@@ -29,7 +29,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_intel
+LOCAL_SHARED_LIBRARIES := libdrm_intel
 LOCAL_MODULE := libmesa_winsys_intel
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/nouveau/drm/Android.mk b/src/gallium/winsys/nouveau/drm/Android.mk
index 2841080..b9b8812 100644
--- a/src/gallium/winsys/nouveau/drm/Android.mk
+++ b/src/gallium/winsys/nouveau/drm/Android.mk
@@ -30,7 +30,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_nouveau
+LOCAL_SHARED_LIBRARIES := libdrm_nouveau
 LOCAL_MODULE := libmesa_winsys_nouveau
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/radeon/drm/Android.mk b/src/gallium/winsys/radeon/drm/Android.mk
index eacb35f..2e0c40c 100644
--- a/src/gallium/winsys/radeon/drm/Android.mk
+++ b/src/gallium/winsys/radeon/drm/Android.mk
@@ -30,7 +30,7 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm libdrm_radeon
+LOCAL_SHARED_LIBRARIES := libdrm_radeon
 LOCAL_MODULE := libmesa_winsys_radeon
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/svga/drm/Android.mk b/src/gallium/winsys/svga/drm/Android.mk
index f57225e..67c9f4f 100644
--- a/src/gallium/winsys/svga/drm/Android.mk
+++ b/src/gallium/winsys/svga/drm/Android.mk
@@ -36,7 +36,6 @@ LOCAL_C_INCLUDES := \
 	$(GALLIUM_TOP)/drivers/svga \
 	$(GALLIUM_TOP)/drivers/svga/include
 
-LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_MODULE := libmesa_winsys_svga
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/vc4/drm/Android.mk b/src/gallium/winsys/vc4/drm/Android.mk
index 55edc17..af5813d 100644
--- a/src/gallium/winsys/vc4/drm/Android.mk
+++ b/src/gallium/winsys/vc4/drm/Android.mk
@@ -27,7 +27,6 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_MODULE := libmesa_winsys_vc4
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gallium/winsys/virgl/drm/Android.mk b/src/gallium/winsys/virgl/drm/Android.mk
index 8493503..4256f46 100644
--- a/src/gallium/winsys/virgl/drm/Android.mk
+++ b/src/gallium/winsys/virgl/drm/Android.mk
@@ -27,7 +27,6 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_MODULE := libmesa_winsys_virgl
 
 include $(GALLIUM_COMMON_MK)
diff --git a/src/gbm/Android.mk b/src/gbm/Android.mk
index 6dc422c..a3f8fbb 100644
--- a/src/gbm/Android.mk
+++ b/src/gbm/Android.mk
@@ -32,7 +32,6 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/main
 
-LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_STATIC_LIBRARIES := libmesa_loader
 LOCAL_MODULE := libgbm
 
diff --git a/src/loader/Android.mk b/src/loader/Android.mk
index 8690565..ca92188 100644
--- a/src/loader/Android.mk
+++ b/src/loader/Android.mk
@@ -33,11 +33,6 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
 	$(LOADER_C_FILES)
 
-ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
-LOCAL_CFLAGS += -DHAVE_LIBDRM
-LOCAL_SHARED_LIBRARIES := libdrm
-endif
-
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_MODULE := libmesa_loader
diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
index 7e7587b..72a5593 100644
--- a/src/mesa/drivers/dri/Android.mk
+++ b/src/mesa/drivers/dri/Android.mk
@@ -49,7 +49,6 @@ MESA_DRI_WHOLE_STATIC_LIBRARIES := \
 MESA_DRI_SHARED_LIBRARIES := \
 	libcutils \
 	libdl \
-	libdrm \
 	libexpat \
 	libglapi \
 	liblog
-- 
2.7.4



More information about the mesa-dev mailing list