dup2: Move AC_LIBOBJ invocation to module description.
authorBruno Haible <bruno@clisp.org>
Mon, 25 Jul 2011 22:28:07 +0000 (00:28 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 25 Jul 2011 22:28:07 +0000 (00:28 +0200)
* 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.

ChangeLog
m4/dup2.m4
modules/dup2

index 056717e..74c1158 100644 (file)
--- 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.
index b4a2219..5c2cc96 100644 (file)
@@ -12,7 +12,6 @@ AC_DEFUN([gl_FUNC_DUP2],
     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 @@ AC_DEFUN([gl_FUNC_DUP2],
          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 @@ AC_DEFUN([gl_FUNC_DUP2],
   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])
-])
index 17cafd1..f9a1ee3 100644 (file)
@@ -11,6 +11,9 @@ dup2-obsolete
 
 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: