1--- a/source/configure.in
2+++ b/source/configure.in
3@@ -1388,31 +1388,40 @@
4 #
5 case "$host_os" in
6     *linux*)
7-       # glibc <= 2.3.2 has a broken getgrouplist
8-       AC_TRY_RUN([
9+
10+AC_CACHE_CHECK([for a broken Linux getgrouplist API],
11+             linux_getgrouplist_ok,
12+             [
13+                 AC_TRY_RUN([
14 #include <unistd.h>
15 #include <sys/utsname.h>
16-main() {
17-       /* glibc up to 2.3 has a broken getgrouplist */
18+
19+                     int main() {
20+                            /* glibc up to 2.3 has a broken
21+getgrouplist */
22 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
23-       int libc_major = __GLIBC__;
24-       int libc_minor = __GLIBC_MINOR__;
25+                            int libc_major = __GLIBC__;
26+                            int libc_minor = __GLIBC_MINOR__;
27
28-       if (libc_major < 2)
29-              exit(1);
30-       if ((libc_major == 2) && (libc_minor <= 3))
31-              exit(1);
32+                            if (libc_major < 2)
33+                                   return 1;
34+                            if ((libc_major == 2) && (libc_minor <= 3))
35+                                   return 1;
36 #endif
37-       exit(0);
38-}
39-], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no])
40-       if test x"$linux_getgrouplist_ok" = x"yes"; then
41-          AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist])
42-       fi
43-       ;;
44-    *)
45-       AC_CHECK_FUNCS(getgrouplist)
46-       ;;
47+                            return 0;
48+                     }
49+
50+                 ],
51+                 [linux_getgrouplist_ok=yes],
52+                 [linux_getgrouplist_ok=no],
53+                 [linux_getgrouplist_ok=cross])
54+        ])
55+
56+        if test x"$linux_getgrouplist_ok" = x"yes"; then
57+           AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist])
58+        fi
59+
60+
61 esac
62
63 #
64