X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fgetlogin_r.m4;h=5d6f1b2e7f5336aa76cbea2c8479cf7ff8165191;hb=f4c549fab688ce822556eadcf60fdda5042ade11;hp=8e5a2a3c58c4c4155fc868d5d939cf3368ccc17a;hpb=d52c5b93a562113d859c264bbb92f5c0b8c5ae77;p=gnulib.git diff --git a/m4/getlogin_r.m4 b/m4/getlogin_r.m4 index 8e5a2a3c5..5d6f1b2e7 100644 --- a/m4/getlogin_r.m4 +++ b/m4/getlogin_r.m4 @@ -1,6 +1,6 @@ -#serial 4 +#serial 7 -# Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,16 +11,21 @@ dnl dnl Provide getlogin_r when the system lacks it. dnl -AC_DEFUN([gl_GETLOGIN_R], +AC_DEFUN([gl_FUNC_GETLOGIN_R], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + dnl Persuade glibc to declare getlogin_r(). + dnl Persuade Solaris to provide the POSIX compliant declaration of + dnl getlogin_r(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([getlogin_r]) if test $ac_cv_func_getlogin_r = no; then AC_LIBOBJ([getlogin_r]) gl_PREREQ_GETLOGIN_R - if test $ac_cv_have_decl_getlogin_r = yes; then - HAVE_DECL_GETLOGIN_R=1 - else + AC_CHECK_DECLS_ONCE([getlogin_r]) + if test $ac_cv_have_decl_getlogin_r = no; then HAVE_DECL_GETLOGIN_R=0 fi fi @@ -29,5 +34,4 @@ AC_DEFUN([gl_GETLOGIN_R], AC_DEFUN([gl_PREREQ_GETLOGIN_R], [ AC_CHECK_DECLS_ONCE([getlogin]) - AC_CHECK_DECLS_ONCE([getlogin_r]) ])