Move the code from configure.in into this macro that resorts to looking for getgroups in -lbsd. Set new shell variable, GETGROUPS_LIB (that callers should check), if it is found there.