copy-file: Add functions for copying non-confidential files.
[gnulib.git] / m4 / fts.m4
blob18f88c4900bfa1bb247c51767e721fd588cb2a53
1 # fts.m4
2 # serial 24
3 dnl Copyright (C) 2005-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 AC_DEFUN([gl_FUNC_FTS],
10   gl_FUNC_FTS_CORE
13 AC_DEFUN([gl_FUNC_FTS_CORE],
15   dnl Prerequisites of lib/fts.c.
16   gl_FUNC_OPENAT
18   AC_CHECK_FUNCS_ONCE([fstatfs])
19   AC_CHECK_HEADERS_ONCE([sys/param.h sys/vfs.h])dnl
20   if test "$ac_cv_func_fstatfs,$ac_cv_header_sys_vfs_h" = yes,yes; then
21     AC_CHECK_MEMBERS([struct statfs.f_type], [], [],
22       [[$ac_includes_default
23         #include <sys/vfs.h>
24       ]])
25     if test "$ac_cv_member_struct_statfs_f_type" = yes; then
26       AC_CHECK_TYPES([__fsword_t], [], [],
27         [[$ac_includes_default
28           #include <sys/vfs.h>
29         ]])
30     fi
31   fi
33   gl_CHECK_FUNCS_ANDROID([fts_open], [[#include <fts.h>]])
34   if case "$gl_cv_onwards_func_fts_open" in \
35        yes | future*) true ;; \
36        *) false ;; \
37      esac; then
38     dnl The system already has the symbols fts_open, etc. or will have them
39     dnl in a future version.
40     dnl Avoid conflicts between these symbols and ours at the linker level.
41     AC_DEFINE([fts_open], [rpl_fts_open],
42       [Define to the overridden function name])
43     AC_DEFINE([fts_close], [rpl_fts_close],
44       [Define to the overridden function name])
45     AC_DEFINE([fts_read], [rpl_fts_read],
46       [Define to the overridden function name])
47     AC_DEFINE([fts_set], [rpl_fts_set],
48       [Define to the overridden function name])
49     AC_DEFINE([fts_children], [rpl_fts_children],
50       [Define to the overridden function name])
51     AC_DEFINE([fts_cross_check], [rpl_fts_cross_check],
52       [Define to the overridden function name])
53   fi