android: static link with libexpat with Android O+
authorKishore Kadiyala <kishore.kadiyala@intel.com>
Mon, 11 Mar 2019 09:23:03 +0000 (11:23 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 25 Mar 2019 08:11:57 +0000 (10:11 +0200)
In Android O, MESA needs to statically link libexpat so that
it's in same VNDK namespace.

v2: apply change also to anv driver (Tapani)
v3: use += in anv change (Eric Engestrom)

Change-Id: I82b0be5c817c21e734dfdf5bfb6a9aa1d414ab33
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/gallium/targets/dri/Android.mk
src/intel/Android.common.mk
src/intel/Android.vulkan.mk
src/mesa/drivers/dri/Android.mk
src/util/Android.mk

index 7638a67b26f4258d85b4cdadb6d75e4f831d8952..6134251b5ca092c7e1fd4741cb817b98a6a6f188 100644 (file)
@@ -42,9 +42,17 @@ LOCAL_LDFLAGS := \
 LOCAL_SHARED_LIBRARIES := \
        libdl \
        libglapi \
-       libexpat \
        libz
 
+# If Android version >=8 MESA should static link libexpat else should dynamic link
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
+LOCAL_STATIC_LIBRARIES := \
+       libexpat
+else
+LOCAL_SHARED_LIBRARIES += \
+       libexpat
+endif
+
 ifeq ($(USE_LIBBACKTRACE),true)
        LOCAL_SHARED_LIBRARIES += libbacktrace
 endif
index faec6b3ea4e6f810092048a0b5fe936b53ba7f2d..79d9f1284a0f2e9a28f3ef4c66f245b8f093d6e5 100644 (file)
@@ -38,7 +38,17 @@ LOCAL_C_INCLUDES := \
        $(MESA_TOP)/src/mapi \
        $(MESA_TOP)/src/mesa
 
-LOCAL_SHARED_LIBRARIES := libexpat libz liblog
+LOCAL_SHARED_LIBRARIES := libz liblog
+
+# If Android version >=8 MESA should static link libexpat else should dynamic link
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
+LOCAL_STATIC_LIBRARIES := \
+       libexpat
+else
+LOCAL_SHARED_LIBRARIES += \
+       libexpat
+endif
+
 
 LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml
 
index f38decbf3084d9a073f646351a768b1f48668a54..05922afdbe08c1e6bd7ffb1de84fbd8e98d8d456 100644 (file)
@@ -337,8 +337,17 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
        libmesa_intel_compiler \
        libmesa_anv_entrypoints
 
-LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) libexpat libz libsync liblog
+LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) libz libsync liblog
 LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES)
 
+# If Android version >=8 MESA should static link libexpat else should dynamic link
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
+LOCAL_STATIC_LIBRARIES := \
+       libexpat
+else
+ LOCAL_SHARED_LIBRARIES += \
+        libexpat
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
index 53ff4b4f632c727295305a611c2f20aab8959e87..60c8476a38a7b6955bf7583ab338f35990077104 100644 (file)
@@ -49,11 +49,19 @@ MESA_DRI_WHOLE_STATIC_LIBRARIES := \
 MESA_DRI_SHARED_LIBRARIES := \
        libcutils \
        libdl \
-       libexpat \
        libglapi \
        liblog \
        libz
 
+# If Android version >=8 MESA should static link libexpat else should dynamic link
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
+MESA_DRI_WHOLE_STATIC_LIBRARIES += \
+       libexpat
+else
+MESA_DRI_SHARED_LIBRARIES += \
+       libexpat
+endif
+
 #-----------------------------------------------
 # Build drivers and libmesa_dri_common
 
index 2d59e1ae15e8fbc6535bfeb98588504c27fcefac..6d770ca95756aebe52b1116ab0c97923cefe1f69 100644 (file)
@@ -41,8 +41,14 @@ LOCAL_C_INCLUDES := \
        $(MESA_TOP)/src/gallium/include \
        $(MESA_TOP)/src/gallium/auxiliary
 
+# If Android version >=8 MESA should static link libexpat else should dynamic link
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27; echo $$?), 0)
+LOCAL_STATIC_LIBRARIES := \
+       libexpat
+else
 LOCAL_SHARED_LIBRARIES := \
        libexpat
+endif
 
 LOCAL_MODULE := libmesa_util