]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_FUNC_GETGROUPS: always define $ac_cv_func_getgroups_works
authorJim Meyering <meyering@redhat.com>
Wed, 22 Oct 2008 15:25:46 +0000 (17:25 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 23 Oct 2008 08:06:15 +0000 (10:06 +0200)
* 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>.

ChangeLog
lib/autoconf/functions.m4

index bdc32445ea4e74a70779df7558009b0fc7267d49..e0f3f265ac1eda39c386d3929d22d63b11090f8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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>
 
index 14fe31550d86e5bc619cff4e96028dd3279ae899..399913420a9fd7a9092fd714bb9c714e2adad7cd 100644 (file)
@@ -619,6 +619,7 @@ if test $ac_cv_func_getgroups = no; then
   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
@@ -626,9 +627,7 @@ 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,