fix bug in pam build tests

This commit is contained in:
William Hubbs 2021-10-08 16:39:21 -05:00
parent 2085f31d9c
commit 1033909f0e

View File

@ -42,9 +42,9 @@ else
os = option_os os = option_os
endif endif
pam_dep = dependency('pam', required : get_option('pam')) pam_dep = dependency('pam', required: false)
if not pam_dep.found() if not pam_dep.found()
pam_dep = cc.find_library('pam', required : get_option('pam')) pam_dep = cc.find_library('pam', required: false)
endif endif
if pam_dep.found() if pam_dep.found()
cc_pam_flags = '-DHAVE_PAM' cc_pam_flags = '-DHAVE_PAM'
@ -52,6 +52,10 @@ else
cc_pam_flags = [] cc_pam_flags = []
endif endif
if not pam_dep.found() and get_option('pam')
error('Pam was requested but could not be located')
endif
option_pkg_prefix = get_option('pkg_prefix') option_pkg_prefix = get_option('pkg_prefix')
if option_pkg_prefix == '' if option_pkg_prefix == ''
if os == 'Dragonfly' or os == 'FreeBSD' if os == 'Dragonfly' or os == 'FreeBSD'
@ -92,10 +96,13 @@ sbindir = rootprefix / get_option('sbindir')
selinux_dep = dependency('libselinux', required : get_option('selinux')) selinux_dep = dependency('libselinux', required : get_option('selinux'))
if selinux_dep.found() if selinux_dep.found()
cc_selinux_flags = '-DHAVE_SELINUX' cc_selinux_flags = '-DHAVE_SELINUX'
if pam_dep.found() if pam_dep.found() and get_option('pam')
pam_misc_dep = dependency('pam_misc', required : get_option('pam')) pam_misc_dep = dependency('pam_misc', required: false)
if not pam_misc_dep.found() if not pam_misc_dep.found()
pam_misc_dep = cc.find_library('pam_misc', required : get_option('pam')) pam_misc_dep = cc.find_library('pam_misc', required: false)
endif
if not pam_misc_dep.found() and get_option('pam')
error('Pam was requested but could not be located')
endif endif
endif endif
else else