* 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.
2011-07-25 Bruno Haible <bruno@clisp.org>
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.
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.
AC_CHECK_FUNCS_ONCE([dup2])
if test $ac_cv_func_dup2 = no; then
HAVE_DUP2=0
AC_CHECK_FUNCS_ONCE([dup2])
if test $ac_cv_func_dup2 = no; then
HAVE_DUP2=0
fi
], [
AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
fi
], [
AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
esac])
])
if test "$gl_cv_func_dup2_works" = no; then
esac])
])
if test "$gl_cv_func_dup2_works" = no; then
fi
fi
dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
fi
fi
dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
m4_ifdef([gl_FUNC_FCHDIR], [
gl_TEST_FCHDIR
if test $HAVE_FCHDIR = 0; then
m4_ifdef([gl_FUNC_FCHDIR], [
gl_TEST_FCHDIR
if test $HAVE_FCHDIR = 0; then
-
-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])
-])
configure.ac:
gl_FUNC_DUP2
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:
gl_UNISTD_MODULE_INDICATOR([dup2])
Makefile.am: