summaryrefslogtreecommitdiffstats
path: root/m4/access.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:56:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:56:12 +0000
commit5fc9e0f4acbb0647b6564d091257340b4ce800f1 (patch)
tree7c2ae9ffc1d5f93f36444e153ddaed2434612f9e /m4/access.m4
parentReleasing progress-linux version 1.21.4-1~progress7.99u1. (diff)
downloadwget-5fc9e0f4acbb0647b6564d091257340b4ce800f1.tar.xz
wget-5fc9e0f4acbb0647b6564d091257340b4ce800f1.zip
Merging upstream version 1.24.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/access.m4')
-rw-r--r--m4/access.m455
1 files changed, 52 insertions, 3 deletions
diff --git a/m4/access.m4 b/m4/access.m4
index 0c8064f..c2c347f 100644
--- a/m4/access.m4
+++ b/m4/access.m4
@@ -1,5 +1,5 @@
-# access.m4 serial 1
-dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+# access.m4 serial 3
+dnl Copyright (C) 2019-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.
@@ -11,6 +11,55 @@ AC_DEFUN([gl_FUNC_ACCESS],
dnl On native Windows, access (= _access) does not support the X_OK mode.
dnl It works by chance on some versions of mingw.
case "$host_os" in
- mingw*) REPLACE_ACCESS=1 ;;
+ mingw* | windows*)
+ REPLACE_ACCESS=1
+ ;;
+ *)
+ dnl Mac OS X 10.5 mistakenly allows access("link-to-file/",amode).
+ AC_CHECK_FUNCS_ONCE([lstat])
+ AC_CACHE_CHECK([whether access honors trailing slash],
+ [gl_cv_func_access_slash_works],
+ [# Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ rm -rf conftest.f conftest.lnk
+ touch conftest.f || AC_MSG_ERROR([cannot create temporary files])
+ ln -s conftest.f conftest.lnk
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <unistd.h>
+ ]],
+ [[int result = 0;
+ if (access ("conftest.lnk/", R_OK) == 0)
+ result |= 1;
+ return result;
+ ]])],
+ [gl_cv_func_access_slash_works=yes],
+ [gl_cv_func_access_slash_works=no],
+ dnl When crosscompiling, assume access is broken.
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_access_slash_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_access_slash_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_access_slash_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_access_slash_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.f conftest.lnk
+ else
+ gl_cv_func_access_slash_works="guessing yes"
+ fi
+ ])
+ case "$gl_cv_func_access_slash_works" in
+ *yes) ;;
+ *)
+ REPLACE_ACCESS=1
+ AC_DEFINE([ACCESS_TRAILING_SLASH_BUG], [1],
+ [Define if access does not correctly handle trailing slashes.])
+ ;;
+ esac
+ ;;
esac
])