Modernize checks for non-POSIX getpwnam_r
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 24 Feb 2011 15:45:48 +0000 (15:45 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 24 Feb 2011 15:45:48 +0000 (15:45 +0000)
Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
configure.ac

index d895c3b42096539214ffda1680e8d22bf6714631..fadb0c31c08233687a9b361c685451412cba93e3 100644 (file)
@@ -587,11 +587,10 @@ if test "$ac_cv_func_posix_getpwnam_r" = yes; then
 else
         AC_CACHE_CHECK([for nonposix getpwnam_r],
                 ac_cv_func_nonposix_getpwnam_r,
-                [AC_TRY_LINK([#include <pwd.h>],
-                        [char buffer[10000];
+                [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[char buffer[10000];
                         struct passwd pwd;
                         getpwnam_r ("", &pwd, buffer,
-                                        sizeof (buffer));],
+                                        sizeof (buffer));]])],
                         [ac_cv_func_nonposix_getpwnam_r=yes],
                         [ac_cv_func_nonposix_getpwnam_r=no])])
                 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then