librt = cc.find_library('rt')
libm = cc.find_library('m')
libdl = cc.find_library('dl')
-libcrypt = cc.find_library('crypt')
+libcrypt = dependency('libcrypt')
+libcap = dependency('libcap')
# On some architectures, libatomic is required. But on some installations,
# it is found, but actual linking fails. So let's try to use it opportunistically.
conf.set10('HAVE_' + ident[0].to_upper(), have)
endforeach
-libcap = dependency('libcap', required : false)
-if not libcap.found()
- # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
- libcap = cc.find_library('cap')
-endif
-
want_bpf_framework = get_option('bpf-framework')
bpf_compiler = get_option('bpf-compiler')
bpf_framework_required = want_bpf_framework == 'true'
want_acl = get_option('acl')
if want_acl != 'false' and not skip_deps
- libacl = cc.find_library('acl', required : want_acl == 'true')
+ libacl = dependency('libacl', required : want_acl == 'true')
have = libacl.found()
else
have = false
want_pam = get_option('pam')
if want_pam != 'false' and not skip_deps
- libpam = cc.find_library('pam', required : want_pam == 'true')
- libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
+ libpam = dependency('pam', required : false)
+ if not libpam.found()
+ # Debian older than bookworm and Ubuntu older than 22.10 do not provide the .pc file.
+ libpam = cc.find_library('pam', required : want_pam == 'true')
+ endif
+ libpam_misc = dependency('pam_misc', required : false)
+ if not libpam_misc.found()
+ libpam_misc = cc.find_library('pam_misc', required : want_pam == 'true')
+ endif
have = libpam.found() and libpam_misc.found()
else
have = false
want_gcrypt = get_option('gcrypt')
if want_gcrypt != 'false' and not skip_deps
- libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
- libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
+ libgcrypt = dependency('libgcrypt', required : want_gcrypt == 'true')
+ libgpg_error = dependency('gpg-error', required : false)
+ if not libgpg_error.found()
+ # CentOS 8 does not provide the .pc file.
+ libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
+ endif
have = libgcrypt.found() and libgpg_error.found()
else
have = false
want_bzip2 = get_option('bzip2')
if want_bzip2 != 'false' and not skip_deps
- libbzip2 = cc.find_library('bz2',
- required : want_bzip2 == 'true')
+ libbzip2 = dependency('bzip2', required : false)
+ if not libbzip2.found()
+ # Debian and Ubuntu do not provide the .pc file.
+ libbzip2 = cc.find_library('bz2', required : want_bzip2 == 'true')
+ endif
have = libbzip2.found()
else
have = false