From: Bruno Haible Date: Mon, 25 Jul 2011 22:28:07 +0000 (+0200) Subject: dup2: Move AC_LIBOBJ invocation to module description. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59f778ae23f86ab0ff7a8cdd0fb6463233284a49;p=pspp 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. --- diff --git a/ChangeLog b/ChangeLog index 056717e29f..74c11589e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-07-25 Bruno Haible + 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. diff --git a/m4/dup2.m4 b/m4/dup2.m4 index b4a22199e4..5c2cc9674c 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 @@ -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]) -]) diff --git a/modules/dup2 b/modules/dup2 index 17cafd1c6a..f9a1ee3f37 100644 --- a/modules/dup2 +++ b/modules/dup2 @@ -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: