X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fgetpass.m4;h=64cee1ea87462ffbc71e0f440040c68c206d80d4;hb=0f247f994ecf88c40563c2d264536a1aa7634b33;hp=3b55ee48ec8d3c9b46ae3a6d3f841ff57d3822a3;hpb=42d1eda5dcce2d68deab7a642e7f29bcd7144a0d;p=gnulib.git diff --git a/m4/getpass.m4 b/m4/getpass.m4 index 3b55ee48e..64cee1ea8 100644 --- a/m4/getpass.m4 +++ b/m4/getpass.m4 @@ -1,5 +1,6 @@ -# getpass.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009 Free Software Foundation, Inc. +# getpass.m4 serial 13 +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,10 +8,15 @@ dnl with or without modifications, as long as this notice is preserved. # Provide a getpass() function if the system doesn't have it. AC_DEFUN([gl_FUNC_GETPASS], [ - AC_REPLACE_FUNCS([getpass]) + dnl Persuade Solaris and to declare getpass(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_FUNCS([getpass]) AC_CHECK_DECLS_ONCE([getpass]) - if test $ac_cv_func_getpass = no; then - gl_PREREQ_GETPASS + if test $ac_cv_func_getpass = yes; then + HAVE_GETPASS=1 + else + HAVE_GETPASS=0 fi ]) @@ -18,15 +24,20 @@ AC_DEFUN([gl_FUNC_GETPASS], # arbitrary length (not just 8 bytes as on HP-UX). AC_DEFUN([gl_FUNC_GETPASS_GNU], [ + dnl Persuade Solaris and to declare getpass(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS_ONCE([getpass]) dnl TODO: Detect when GNU getpass() is already found in glibc. - AC_LIBOBJ([getpass]) - gl_PREREQ_GETPASS - dnl We must choose a different name for our function, since on ELF systems - dnl an unusable getpass() in libc.so would override our getpass() if it is - dnl compiled into a shared library. - AC_DEFINE([getpass], [gnu_getpass], - [Define to a replacement function name for getpass().]) + REPLACE_GETPASS=1 + + if test $REPLACE_GETPASS = 1; then + dnl We must choose a different name for our function, since on ELF systems + dnl an unusable getpass() in libc.so would override our getpass() if it is + dnl compiled into a shared library. + AC_DEFINE([getpass], [gnu_getpass], + [Define to a replacement function name for getpass().]) + fi ]) # Prerequisites of lib/getpass.c.