support older pam versions

Some distros are still using versions of pam which do not create
*.pc files, so we need fallback logic for that situation.
This commit is contained in:
William Hubbs 2021-10-08 10:46:42 -05:00
parent bb8334104b
commit 5a5ede3156

View File

@ -43,6 +43,9 @@ else
endif endif
pam_dep = dependency('pam', required : get_option('pam')) pam_dep = dependency('pam', required : get_option('pam'))
if not pam_dep.found()
pam_dep = cc.find_library('pam', required : get_option('pam'))
endif
if pam_dep.found() if pam_dep.found()
cc_pam_flags = '-DHAVE_PAM' cc_pam_flags = '-DHAVE_PAM'
else else
@ -91,6 +94,9 @@ if selinux_dep.found()
cc_selinux_flags = '-DHAVE_SELINUX' cc_selinux_flags = '-DHAVE_SELINUX'
if pam_dep.found() if pam_dep.found()
pam_misc_dep = dependency('pam_misc', required : get_option('pam')) pam_misc_dep = dependency('pam_misc', required : get_option('pam'))
if not pam_misc_dep.found()
pam_misc_dep = cc.find_library('pam_misc', required : get_option('pam'))
endif
endif endif
else else
cc_selinux_flags = [] cc_selinux_flags = []