libarchive-util: several cleanups

- use loop for checking existence of functions,
- rename HAVE_LIBARCHIVE_XYZ -> HAVE_ARCHIVE_XYZ to make them match with
  the function name,
- do not conditionally include user-util.h in libarchive-util.h,
- sort library function symbols.
This commit is contained in:
Yu Watanabe
2025-11-09 08:44:25 +09:00
parent 3519b73b70
commit 0213b68969
3 changed files with 42 additions and 31 deletions

View File

@@ -1427,10 +1427,16 @@ libarchive = dependency('libarchive',
required : get_option('libarchive'))
libarchive_cflags = libarchive.partial_dependency(includes: true, compile_args: true)
conf.set10('HAVE_LIBARCHIVE', libarchive.found())
conf.set10('HAVE_LIBARCHIVE_UID_IS_SET',
libarchive.found() and cc.has_function('archive_entry_uid_is_set', dependencies : libarchive))
conf.set10('HAVE_LIBARCHIVE_HARDLINK_IS_SET',
libarchive.found() and cc.has_function('archive_entry_hardlink_is_set', dependencies : libarchive))
foreach ident : [
'archive_entry_gid_is_set', # since 3.7.3
'archive_entry_uid_is_set', # since 3.7.3
'archive_entry_hardlink_is_set', # since 3.7.5
]
have = libarchive.found() and cc.has_function(ident, dependencies : libarchive)
conf.set10('HAVE_' + ident.to_upper(), have)
endforeach
libxkbcommon = dependency('xkbcommon',
version : '>= 0.3.0',