diff --git a/meson.build b/meson.build index 3da111dae4..0a77a86743 100644 --- a/meson.build +++ b/meson.build @@ -1730,17 +1730,31 @@ endif # enable_shadow = get_option('with-shadow') - -if not enable_shadow - have_shadow = false -else - have_shadow = (cc.has_header('shadow.h')) +have_shadow = false + +if enable_shadow + if cc.has_header('shadow.h') + cdata.set('HAVE_SHADOW_H', 1) + have_shadow = cc.compiles( + ''' + #include + #include + #include + int main(void) { + struct spwd *sp; + getspnam("bork"); + return 0; + } + ''', + ) + endif if have_shadow cdata.set('SHADOWPW', 1) uams_options += 'shadow' else have_shadow = false - warning('Shadow password support requested but required header not found') + uams_options += 'passwd' + warning('Shadow password support requested but required symbols not found') endif endif