changeset 14963:1f9e45501579

gethostname: Move AC_LIBOBJ invocations to module description. * m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): Move AC_LIBOBJ and gl_PREREQ_GETHOSTNAME invocations from here... * modules/gethostname (configure.ac): ... to here.
author Bruno Haible <bruno@clisp.org>
date Sun, 08 May 2011 11:48:45 +0200
parents e64f06363f01
children 0c2fbeeeb9c9
files ChangeLog m4/gethostname.m4 modules/gethostname
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-08  Bruno Haible  <bruno@clisp.org>
+
+	gethostname: Move AC_LIBOBJ invocations to module description.
+	* m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): Move AC_LIBOBJ and
+	gl_PREREQ_GETHOSTNAME invocations from here...
+	* modules/gethostname (configure.ac): ... to here.
+
 2011-05-08  Bruno Haible  <bruno@clisp.org>
 
 	getgroups: Move AC_LIBOBJ invocations to module description.
--- a/m4/gethostname.m4
+++ b/m4/gethostname.m4
@@ -1,4 +1,4 @@
-# gethostname.m4 serial 11
+# gethostname.m4 serial 12
 dnl Copyright (C) 2002, 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,9 +37,7 @@
   AC_SUBST([GETHOSTNAME_LIB])
 
   if test "$ac_cv_func_gethostname" = no; then
-    AC_LIBOBJ([gethostname])
     HAVE_GETHOSTNAME=0
-    gl_PREREQ_GETHOSTNAME
   fi
 
   dnl Also provide HOST_NAME_MAX when <limits.h> lacks it.
--- a/modules/gethostname
+++ b/modules/gethostname
@@ -14,6 +14,10 @@
 
 configure.ac:
 gl_FUNC_GETHOSTNAME
+if test $HAVE_GETHOSTNAME = 0; then
+  AC_LIBOBJ([gethostname])
+  gl_PREREQ_GETHOSTNAME
+fi
 gl_UNISTD_MODULE_INDICATOR([gethostname])
 
 Makefile.am: