From 1a86c594b0d0e5c65899f1bbe1cca36d501ca5d3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 25 Jul 2011 23:23:14 +0200 Subject: [PATCH] fchdir: Start to remove gl_REPLACE_* idiom. * m4/fchdir.m4 (gl_TEST_FCHDIR): New macro. (gl_FUNC_FCHDIR): Invoke it. --- ChangeLog | 6 ++++++ m4/fchdir.m4 | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f999c04552..5e27329692 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-25 Bruno Haible + + fchdir: Start to remove gl_REPLACE_* idiom. + * m4/fchdir.m4 (gl_TEST_FCHDIR): New macro. + (gl_FUNC_FCHDIR): Invoke it. + 2011-07-25 Paul Eggert * lib/ftell.c (ftell): Comment out cast. diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 index 829373a707..92d0f538a8 100644 --- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,4 +1,4 @@ -# fchdir.m4 serial 16 +# fchdir.m4 serial 17 dnl Copyright (C) 2006-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, @@ -15,9 +15,8 @@ AC_DEFUN([gl_FUNC_FCHDIR], HAVE_DECL_FCHDIR=0 fi - AC_CHECK_FUNCS_ONCE([fchdir]) - if test $ac_cv_func_fchdir = no; then - HAVE_FCHDIR=0 + AC_REQUIRE([gl_TEST_FCHDIR]) + if test $HAVE_FCHDIR = 0; then AC_LIBOBJ([fchdir]) gl_PREREQ_FCHDIR AC_DEFINE([REPLACE_FCHDIR], [1], @@ -48,5 +47,15 @@ work around the inability to open a directory.]) fi ]) +# Determine whether to use the overrides in lib/fchdir.c. +AC_DEFUN([gl_TEST_FCHDIR], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([fchdir]) + if test $ac_cv_func_fchdir = no; then + HAVE_FCHDIR=0 + fi +]) + # Prerequisites of lib/fchdir.c. AC_DEFUN([gl_PREREQ_FCHDIR], [:]) -- 2.30.2