+2008-10-22 Jim Meyering <meyering@redhat.com>
+
+ AC_FUNC_GETGROUPS: always define $ac_cv_func_getgroups_works
+ * lib/autoconf/functions.m4 (AC_FUNC_GETGROUPS): Always define
+ the shell variable, $ac_cv_func_getgroups_works. Otherwise, if
+ it is set to "yes" in the environment and configure is run on
+ a system like mingw that lacks the getgroups function, it would
+ mistakenly define HAVE_GETGROUPS. Reported by Simon Josefsson in
+ <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/15354>.
+
2008-10-22 Paolo Bonzini <bonzini@gnu.org>
and Eric Blake <ebb9@byu.net>
AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd])
fi
+ac_cv_func_getgroups_works=no
# Run the program to test the functionality of the system-supplied
# getgroups function only if there is such a function.
if test $ac_cv_func_getgroups = yes; then
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[/* On Ultrix 4.3, getgroups (0, 0) always fails. */
return getgroups (0, 0) == -1;]])],
- [ac_cv_func_getgroups_works=yes],
- [ac_cv_func_getgroups_works=no],
- [ac_cv_func_getgroups_works=no])
+ [ac_cv_func_getgroups_works=yes])
])
if test $ac_cv_func_getgroups_works = yes; then
AC_DEFINE(HAVE_GETGROUPS, 1,