@@ -266,7 +266,19 @@ if add_languages('cpp', required : want_oss_fuzz)
266266 add_project_arguments (cxx.get_supported_arguments(basic_disabled_warnings), language : ' cpp' )
267267endif
268268
269+ ## Android
270+ have = cc.get_id().contains(' clang' ) and cc.has_header(' android/log.h' )
271+ srcconf.set10(' IS_BIONIC' , have)
272+
269273# Feature detection
274+ ## Android Log System.
275+ if want_android_log
276+ liblog = cc.find_library (' log' , required : true )
277+ pkgconfig_libs += liblog
278+ liblxc_dependencies += liblog
279+ srcconf.set10(' USE_ANDROID_LOG' , liblog.found())
280+ endif
281+
270282## I/O uring.
271283if want_io_uring
272284 liburing = dependency (' liburing' )
@@ -428,7 +440,7 @@ if want_capabilities
428440 code = '''
429441int main(int argc, char *argv[]) { return 0; };
430442'''
431- if libcap_static.found()
443+ if libcap_static.found() and not IS_BIONIC
432444 libcap_static_linkable = cc.links(code, args : ' -static' , dependencies : libcap_static)
433445 else
434446 libcap_static_linkable = false
@@ -461,15 +473,6 @@ pkgconfig_libs += pam
461473have = cc.has_function(' fmemopen' , prefix : ' #include <stdio.h>' , args : ' -D_GNU_SOURCE' )
462474srcconf.set10(' HAVE_FMEMOPEN' , have)
463475
464- ## Android
465- have = cc.get_id().contains(' clang' ) and cc.has_header(' android/log.h' )
466- srcconf.set10(' IS_BIONIC' , have)
467- if want_android_log
468- liblog = cc.find_library (' log' )
469- liblxc_dependencies += liblog
470- srcconf.set10(' USE_ANDROID_LOG' , liblog.found())
471- endif
472-
473476have = cc.has_function(' openpty' , dependencies : libutil, prefix : ' #include <pty.h>' )
474477srcconf.set10(' HAVE_OPENPTY' , have)
475478if have
0 commit comments