summaryrefslogtreecommitdiff
path: root/m4/dup2.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-28 09:35:19 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-28 09:35:19 -0700
commit5402029425ceee114d7ed071ac981227f0d1fc38 (patch)
tree20451e9445b32b2a447d7e0d022d490aac3838aa /m4/dup2.m4
parent70c2e72ae5368e39277de78a414c9d42292886c5 (diff)
downloademacs-5402029425ceee114d7ed071ac981227f0d1fc38.tar.gz
Merge from gnulib.
Diffstat (limited to 'm4/dup2.m4')
-rw-r--r--m4/dup2.m423
1 files changed, 10 insertions, 13 deletions
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index 8d7f62c8876..5c2cc9674c1 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,4 +1,4 @@
-#serial 13
+#serial 14
dnl Copyright (C) 2002, 2005, 2007, 2009-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,
@@ -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,17 +59,15 @@ AC_DEFUN([gl_FUNC_DUP2],
esac])
])
if test "$gl_cv_func_dup2_works" = no; then
- gl_REPLACE_DUP2
+ REPLACE_DUP2=1
fi
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])
+ dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_DUP2=1
+ fi
+ ])
])