aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2021-10-08 16:39:21 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-10-08 16:39:21 -0500
commit1033909f0e80b7627b5cb0d18d1d9c4e7762ba9e (patch)
treebf229bd60bdd713c69ae80522aae88ae3f175051 /meson.build
parent2085f31d9c41bd2c50c80ed8a38e3e31bad8730b (diff)
fix bug in pam build tests
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build17
1 files changed, 12 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 00c4f2d9..d074946e 100644
--- a/meson.build
+++ b/meson.build
@@ -42,9 +42,9 @@ else
os = option_os
endif
-pam_dep = dependency('pam', required : get_option('pam'))
+pam_dep = dependency('pam', required: false)
if not pam_dep.found()
- pam_dep = cc.find_library('pam', required : get_option('pam'))
+ pam_dep = cc.find_library('pam', required: false)
endif
if pam_dep.found()
cc_pam_flags = '-DHAVE_PAM'
@@ -52,6 +52,10 @@ else
cc_pam_flags = []
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')
if option_pkg_prefix == ''
if os == 'Dragonfly' or os == 'FreeBSD'
@@ -92,10 +96,13 @@ sbindir = rootprefix / get_option('sbindir')
selinux_dep = dependency('libselinux', required : get_option('selinux'))
if selinux_dep.found()
cc_selinux_flags = '-DHAVE_SELINUX'
- if pam_dep.found()
- pam_misc_dep = dependency('pam_misc', required : get_option('pam'))
+ if pam_dep.found() and get_option('pam')
+ pam_misc_dep = dependency('pam_misc', required: false)
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
else