From f5b6b735a731901f09d7f3cc153c1d869269ee83 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:38:57 +0200 Subject: Adding upstream version 2.12.1. Signed-off-by: Daniel Baumann --- gl/m4/fchdir.m4 | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'gl/m4/fchdir.m4') diff --git a/gl/m4/fchdir.m4 b/gl/m4/fchdir.m4 index b587e0e..fc0ed33 100644 --- a/gl/m4/fchdir.m4 +++ b/gl/m4/fchdir.m4 @@ -1,5 +1,5 @@ -# fchdir.m4 serial 28 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +# fchdir.m4 serial 32 +dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,7 +16,15 @@ AC_DEFUN([gl_FUNC_FCHDIR], fi AC_REQUIRE([gl_TEST_FCHDIR]) - if test $HAVE_FCHDIR = 0; then + if test $HAVE_FCHDIR = 1; then + AC_REQUIRE([gl_DIRENT_DIR]) + if test $DIR_HAS_FD_MEMBER = 0; then + dnl fchdir() should be replaced if dirfd() does not work. + REPLACE_FCHDIR=1 + fi + fi + + if test $HAVE_FCHDIR = 0 || test $REPLACE_FCHDIR = 1; then AC_DEFINE([REPLACE_FCHDIR], [1], [Define to 1 if gnulib's fchdir() replacement is used.]) dnl We must also replace anything that can manipulate a directory fd, @@ -32,16 +40,16 @@ AC_DEFUN([gl_FUNC_FCHDIR], [gl_cv_func_open_directory_works=yes], [gl_cv_func_open_directory_works=no], [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; - # Guess yes on systems that emulate the Linux system calls. - midipix*) gl_cv_func_open_directory_works="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_open_directory_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess yes on systems that emulate the Linux system calls. + midipix*) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_open_directory_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; esac ])]) case "$gl_cv_func_open_directory_works" in -- cgit v1.2.3