changeset 15470:ec68f7252504

dup2: Move AC_LIBOBJ invocation to module description. * m4/dup2.m4 (gl_REPLACE_DUP2): Remove macro. (gl_FUNC_DUP2): Instead of gl_REPLACE_DUP2, just set REPLACE_DUP2 to 1. Don't invoke AC_LIBOBJ. * modules/dup2 (configure.ac): Invoke AC_LIBOBJ.
author Bruno Haible <bruno@clisp.org>
date Tue, 26 Jul 2011 00:28:07 +0200
parents 7340707eeaf8
children b905eedbf4f8
files ChangeLog m4/dup2.m4 modules/dup2
diffstat 3 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-07-25  Bruno Haible  <bruno@clisp.org>
 
+	dup2: Move AC_LIBOBJ invocation to module description.
+	* m4/dup2.m4 (gl_REPLACE_DUP2): Remove macro.
+	(gl_FUNC_DUP2): Instead of gl_REPLACE_DUP2, just set REPLACE_DUP2 to 1.
+	Don't invoke AC_LIBOBJ.
+	* modules/dup2 (configure.ac): Invoke AC_LIBOBJ.
+
 	dup2: Remove call-in from fchdir.m4.
 	* m4/dup2.m4 (gl_FUNC_DUP2): Conditionally invoke gl_TEST_FCHDIR.
 	* m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't invoke gl_REPLACE_DUP2.
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -12,7 +12,6 @@
     AC_CHECK_FUNCS_ONCE([dup2])
     if test $ac_cv_func_dup2 = no; then
       HAVE_DUP2=0
-      AC_LIBOBJ([dup2])
     fi
   ], [
     AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
@@ -60,7 +59,7 @@
          esac])
       ])
     if test "$gl_cv_func_dup2_works" = no; then
-      gl_REPLACE_DUP2
+      REPLACE_DUP2=1
     fi
   fi
   dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
@@ -68,17 +67,7 @@
   m4_ifdef([gl_FUNC_FCHDIR], [
     gl_TEST_FCHDIR
     if test $HAVE_FCHDIR = 0; then
-      gl_REPLACE_DUP2
+      REPLACE_DUP2=1
     fi
   ])
 ])
-
-AC_DEFUN([gl_REPLACE_DUP2],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([dup2])
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
-  fi
-  AC_LIBOBJ([dup2])
-])
--- a/modules/dup2
+++ b/modules/dup2
@@ -11,6 +11,9 @@
 
 configure.ac:
 gl_FUNC_DUP2
+if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+  AC_LIBOBJ([dup2])
+fi
 gl_UNISTD_MODULE_INDICATOR([dup2])
 
 Makefile.am: