@@ -93,6 +93,10 @@ conf_data.set('_GNU_SOURCE', 1)
9393# APIs. Unstable APIs may be changed or removed without a notice.
9494conf_data.set(' VIRGL_RENDERER_UNSTABLE_APIS' , 1 )
9595
96+ ## Android
97+ have = cc.get_id().contains(' clang' ) and cc.has_header(' android/log.h' )
98+ conf_data.set10(' IS_BIONIC' , have)
99+
96100drm_renderers = get_option (' drm-renderers' )
97101
98102with_drm_msm = drm_renderers.contains(' msm' )
@@ -116,7 +120,12 @@ if with_drm_renderers
116120 conf_data.set(' ENABLE_DRM' , 1 )
117121endif
118122
119- libdrm_dep = dependency (' libdrm' , version : ' >=2.4.50' , required : with_drm_renderers or get_option (' video' ))
123+ if conf_data.get(' IS_BIONIC' ) == true
124+ libdrm_dep = dependency (' libdrm' , required : false )
125+ liblog_dep = cc.find_library (' log' , required : true )
126+ else
127+ libdrm_dep = dependency (' libdrm' , version : ' >=2.4.50' , required : with_drm_renderers or get_option (' video' ))
128+ endif
120129libdrm_amdgpu_dep = dependency (' libdrm_amdgpu' , version : ' >=2.4.121' , required : with_drm_amdgpu)
121130conf_data.set(' ENABLE_LIBDRM' , libdrm_dep.found())
122131drm_uapi_dep = declare_dependency (
@@ -172,6 +181,7 @@ endif
172181
173182with_host_windows = host_machine .system() == ' windows'
174183with_host_darwin = host_machine .system() == ' darwin'
184+ with_target_android = target_machine .system() == ' android'
175185
176186if thread_dep.found() and not with_host_windows
177187 conf_data.set(' HAVE_PTHREAD' , 1 )
@@ -279,7 +289,7 @@ have_glx = false
279289
280290if with_egl
281291 if cc.has_header(' epoxy/egl.h' , dependencies : epoxy_dep) and epoxy_dep.get_variable (pkgconfig : ' epoxy_has_egl' ) == ' 1'
282- if with_host_windows or with_host_darwin
292+ if with_host_windows or with_host_darwin or with_target_android
283293 have_egl = true
284294 else
285295 if libdrm_dep.found()
0 commit comments