Make netgroup support optional

On at least Linux/musl and Linux/uclibc, netgroup support is not
available.  PolKit fails to compile on these systems for that reason.

This change makes netgroup support conditional on the presence of the
setnetgrent(3) function which is required for the support to work.  If
that function is not available on the system, an error will be returned
to the administrator if unix-netgroup: is specified in configuration.

(sam: rebased for Meson and Duktape.)

Closes: polkit/polkit#14
Closes: polkit/polkit#163
Closes: polkit/polkit!52
Signed-off-by: A. Wilcox <>
1 job for musl in 2 minutes (queued for 1 second)