dzprintf-gnu: Add tests.
[gnulib.git] / m4 / faccessat.m4
blobc5f40e52900c4a06bd25fb3582470d779842ff1f
1 # faccessat.m4
2 # serial 12
3 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 # See if we need to provide faccessat replacement.
10 # Written by Eric Blake.
12 AC_DEFUN([gl_FUNC_FACCESSAT],
14   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
15   AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
17   dnl Persuade glibc <unistd.h> to declare faccessat().
18   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
20   gl_CHECK_FUNCS_ANDROID([faccessat], [[#include <unistd.h>]])
21   if test $ac_cv_func_faccessat = no; then
22     HAVE_FACCESSAT=0
23     case "$gl_cv_onwards_func_faccessat" in
24       future*) REPLACE_FACCESSAT=1 ;;
25     esac
26   else
27     case $gl_cv_func_lstat_dereferences_slashed_symlink in
28       *yes) ;;
29       *)    REPLACE_FACCESSAT=1 ;;
30     esac
31   fi
34 # Prerequisites of lib/faccessat.c.
35 AC_DEFUN([gl_PREREQ_FACCESSAT],
37   AC_CHECK_FUNCS([access])