aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-06-03 11:15:26 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-25 10:54:10 +0200
commit05e391ae4056e122fd78b694607ccd2e5a943dab (patch)
tree2253a3a96e14bc4e7770a2df9ef7695df4050b7a /meson.build
parentba7ed407e67589167ef582ac1f17a38f09fbd327 (diff)
configure, meson: convert pam detection to meson
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build31
1 files changed, 26 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index d4ce2ca57b..d3025e05fc 100644
--- a/meson.build
+++ b/meson.build
@@ -325,10 +325,6 @@ if have_system or have_tools
pixman = dependency('pixman-1', required: have_system, version:'>=0.21.8',
method: 'pkg-config', kwargs: static_kwargs)
endif
-pam = not_found
-if 'CONFIG_AUTH_PAM' in config_host
- pam = cc.find_library('pam')
-endif
libaio = cc.find_library('aio', required: false)
zlib = dependency('zlib', required: true, kwargs: static_kwargs)
linux_io_uring = not_found
@@ -907,6 +903,31 @@ if get_option('vnc').enabled()
endif
endif
+pam = not_found
+if not get_option('auth_pam').auto() or have_system
+ pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],
+ required: get_option('auth_pam'),
+ kwargs: static_kwargs)
+endif
+if pam.found() and not cc.links('''
+ #include <stddef.h>
+ #include <security/pam_appl.h>
+ int main(void) {
+ const char *service_name = "qemu";
+ const char *user = "frank";
+ const struct pam_conv pam_conv = { 0 };
+ pam_handle_t *pamh = NULL;
+ pam_start(service_name, user, &pam_conv, &pamh);
+ return 0;
+ }''', dependencies: pam)
+ pam = not_found
+ if get_option('auth_pam').enabled()
+ error('could not link libpam')
+ else
+ warning('could not link libpam, disabling')
+ endif
+endif
+
snappy = not_found
if not get_option('snappy').auto() or have_system
snappy = cc.find_library('snappy', has_headers: ['snappy-c.h'],
@@ -2729,7 +2750,7 @@ summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
# TODO: add back version
summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt}
summary_info += {'libtasn1': tasn1.found()}
-summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
+summary_info += {'PAM': pam.found()}
summary_info += {'iconv support': iconv.found()}
summary_info += {'curses support': curses.found()}
# TODO: add back version