From 2db99d3bc0d3b4b7f59dde21aa4adfa6d6e808ef Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Sat, 23 Nov 2024 07:09:53 +0100 Subject: [PATCH] meson: Check for shadow password symbols, GitHub #1777 --- meson.build | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 3da111dae4..0c94aad203 100644 --- a/meson.build +++ b/meson.build @@ -1734,13 +1734,38 @@ enable_shadow = get_option('with-shadow') if not enable_shadow have_shadow = false else - have_shadow = (cc.has_header('shadow.h')) + if cc.has_header('shadow.h') + have_shadow = cc.compiles( + ''' + #include + #include + #include + int main(void) { + struct spwd *sp; + getspnam("bork"); + return 0; + } + ''', + ) + else + have_shadow = cc.compiles( + ''' + #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') + warning('Shadow password support requested but required symbols not found') endif endif @@ -2434,6 +2459,7 @@ if have_quota } endif summary_info += { + ' Shadow passwords': have_shadow, ' Spotlight': have_spotlight, ' TCP wrapper': have_tcpwrap, ' Zeroconf': have_zeroconf,