changeset 14971:4102aeabca72

getpass: Move AC_LIBOBJ invocations to module description. * m4/getpass.m4 (gl_FUNC_GETPASS): Set HAVE_GETPASS. Move AC_LIBOBJ and gl_PREREQ_GETPASS invocations from here... * modules/getpass (configure.ac): ... to here.
author Bruno Haible <bruno@clisp.org>
date Sun, 08 May 2011 13:18:21 +0200
parents 3c854f4a4670
children b15151b8de0d
files ChangeLog m4/getpass.m4 modules/getpass
diffstat 3 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-08  Bruno Haible  <bruno@clisp.org>
+
+	getpass: Move AC_LIBOBJ invocations to module description.
+	* m4/getpass.m4 (gl_FUNC_GETPASS): Set HAVE_GETPASS. Move AC_LIBOBJ and
+	gl_PREREQ_GETPASS invocations from here...
+	* modules/getpass (configure.ac): ... to here.
+
 2011-05-08  Bruno Haible  <bruno@clisp.org>
 
 	getpagesize: Move AC_LIBOBJ invocations to module description.
--- a/m4/getpass.m4
+++ b/m4/getpass.m4
@@ -1,4 +1,4 @@
-# getpass.m4 serial 12
+# 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
@@ -11,10 +11,12 @@
   dnl Persuade Solaris <unistd.h> and <stdlib.h> to declare getpass().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
-  AC_REPLACE_FUNCS([getpass])
+  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
 ])
 
--- a/modules/getpass
+++ b/modules/getpass
@@ -15,6 +15,10 @@
 
 configure.ac:
 gl_FUNC_GETPASS
+if test $HAVE_GETPASS = 0; then
+  AC_LIBOBJ([getpass])
+  gl_PREREQ_GETPASS
+fi
 
 Makefile.am: