Skip to content

Commit

Permalink
meson: Check for shadow password symbols, GitHub #1777
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 23, 2024
1 parent 332311e commit fa917c4
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
#include <stdio.h>
#include <shadow.h>
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

Expand Down

0 comments on commit fa917c4

Please sign in to comment.