Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable xmlconfig on Android #8

Open
wants to merge 1 commit into
base: lineage-18.1-mesa-23.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ MESA_VK_LIB_SUFFIX_swrast := lvp

include $(CLEAR_VARS)

LOCAL_SHARED_LIBRARIES := libc libdl libdrm libm liblog libcutils libz libc++ libnativewindow libsync libhardware
LOCAL_SHARED_LIBRARIES := libc libdl libdrm libm liblog libcutils libz libc++ libnativewindow libsync libhardware libxml2
LOCAL_STATIC_LIBRARIES := libexpat libarect libelf
LOCAL_HEADER_LIBRARIES := libnativebase_headers hwvulkan_headers
MESON_GEN_PKGCONFIGS := cutils expat hardware libdrm:$(LIBDRM_VERSION) nativewindow sync zlib:1.2.11 libelf
MESON_GEN_PKGCONFIGS := cutils expat hardware libdrm:$(LIBDRM_VERSION) nativewindow sync zlib:1.2.11 libelf libxml2
LOCAL_CFLAGS += $(BOARD_MESA3D_CFLAGS)

ifneq ($(filter swrast,$(BOARD_MESA3D_GALLIUM_DRIVERS) $(BOARD_MESA3D_VULKAN_DRIVERS)),)
Expand Down
1 change: 1 addition & 0 deletions android/mesa3d_cross.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ MESON_GEN_NINJA := \
-Dandroid-libbacktrace=disabled \
-Dallow-kcmp=enabled \
-Dintel-xe-kmd=enabled \
-Dxmlconfig=enabled \

MESON_BUILD := PATH=/usr/bin:/bin:/sbin:$$PATH ninja -C $(MESON_OUT_DIR)/build

Expand Down
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ if dep_thread.found()
endif

with_expat = get_option('expat') \
.disable_auto_if(with_platform_android or with_platform_windows)
.disable_auto_if(with_platform_windows)

if host_machine.system() == 'darwin'
dep_expat = meson.get_compiler('c').find_library('expat', required : with_expat)
Expand All @@ -1553,8 +1553,8 @@ endif

# We don't require expat on Android or Windows
use_xmlconfig = get_option('xmlconfig') \
.require(not (with_platform_android or with_platform_windows),
error_message : 'xmlconfig not available on Android or Windows') \
.require(not (with_platform_windows),
error_message : 'xmlconfig not available on Windows') \
.require(dep_expat.found(),
error_message : 'requires expat') \
.allowed()
Expand Down
7 changes: 7 additions & 0 deletions src/util/xmlconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,11 @@ initOptionCache(driOptionCache *cache, const driOptionCache *info)
}
}

#ifdef __ANDROID__
#define SYSCONFDIR "/vendor/etc"
#define DATADIR "/data/vendor"
#else

#ifndef SYSCONFDIR
#define SYSCONFDIR "/etc"
#endif
Expand All @@ -1173,6 +1178,8 @@ initOptionCache(driOptionCache *cache, const driOptionCache *info)
#define DATADIR "/usr/share"
#endif

#endif /* __ANDROID__ */

static const char *execname;

void
Expand Down