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 2db99d3
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
#include <stdio.h>
#include <shadow.h>
int main(void) {
struct spwd *sp;
getspnam("bork");
return 0;
}
''',
)
else
have_shadow = cc.compiles(
'''
#include <stdlib.h>
#include <stdio.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')
warning('Shadow password support requested but required symbols not found')
endif
endif

Expand Down Expand Up @@ -2434,6 +2459,7 @@ if have_quota
}
endif
summary_info += {
' Shadow passwords': have_shadow,
' Spotlight': have_spotlight,
' TCP wrapper': have_tcpwrap,
' Zeroconf': have_zeroconf,
Expand Down

0 comments on commit 2db99d3

Please sign in to comment.