From 5fc9e0f4acbb0647b6564d091257340b4ce800f1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 10:56:12 +0200 Subject: Merging upstream version 1.24.5. Signed-off-by: Daniel Baumann --- m4/fchdir.m4 | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'm4/fchdir.m4') diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 index b587e0e..fc0ed33 100644 --- a/m4/fchdir.m4 +++ b/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