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