getgroups: don't expose GETGROUPS_T to user
[gnulib.git] / m4 / getgroups.m4
1 # serial 14
2
3 dnl From Jim Meyering.
4 dnl A wrapper around AC_FUNC_GETGROUPS.
5
6 # Copyright (C) 1996-1997, 1999-2004, 2008-2009 Free Software Foundation, Inc.
7 #
8 # This file is free software; the Free Software Foundation
9 # gives unlimited permission to copy and/or distribute it,
10 # with or without modifications, as long as this notice is preserved.
11
12 AC_DEFUN([gl_FUNC_GETGROUPS],
13 [
14   AC_REQUIRE([AC_FUNC_GETGROUPS])
15   AC_REQUIRE([AC_TYPE_GETGROUPS])
16   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
17   if test "$ac_cv_func_getgroups" != yes; then
18     AC_LIBOBJ([getgroups])
19     HAVE_GETGROUPS=0
20   elif test "$ac_cv_func_getgroups_works.$ac_cv_type_getgroups" != yes.gid_t
21   then
22     AC_LIBOBJ([getgroups])
23     REPLACE_GETGROUPS=1
24   fi
25   test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
26 ])