Branch
Hash :
3e75d0af
Author :
Date :
2025-05-10T17:39:26
fts: Generate fts_.h. Suggested by Bruno Haible in <https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00134.html>. * lib/fts_.h: Remove file. * lib/fts.in.h: New file. * m4/fts.m4 (gl_FUNC_FTS_CORE): Use gl_CHECK_HEADER_SYS_CDEFS_H instead of AC_CHECK_HEADERS_ONCE. * modules/fts (Files): Remove lib/fts_.h. Add lib/fts.in.h and m4/sys_cdefs_h.m4. (Depends-on): Add gen-header. (Makefile.am): Add fts_.h to BUILT_SOURCES. Generate fts_.h using fts.in.h while replacing @HAVE_SYS_CDEFS_H@. Add fts_.h and fts_.h-t to MOSTLYCLEANFILES.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# fts.m4
# serial 26
dnl Copyright (C) 2005-2025 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.
dnl This file is offered as-is, without any warranty.
AC_DEFUN([gl_FUNC_FTS],
[
gl_FUNC_FTS_CORE
])
AC_DEFUN([gl_FUNC_FTS_CORE],
[
dnl Prerequisites of lib/fts.c.
gl_FUNC_OPENAT
gl_CHECK_HEADER_SYS_CDEFS_H
AC_CHECK_FUNCS_ONCE([fstatfs])
AC_CHECK_HEADERS_ONCE([sys/param.h sys/vfs.h])dnl
if test "$ac_cv_func_fstatfs,$ac_cv_header_sys_vfs_h" = yes,yes; then
AC_CHECK_MEMBERS([struct statfs.f_type], [], [],
[[$ac_includes_default
#include <sys/vfs.h>
]])
if test "$ac_cv_member_struct_statfs_f_type" = yes; then
AC_CHECK_TYPES([__fsword_t], [], [],
[[$ac_includes_default
#include <sys/vfs.h>
]])
fi
fi
gl_CHECK_FUNCS_ANDROID([fts_open], [[#include <fts.h>]])
if case "$gl_cv_onwards_func_fts_open" in \
yes | future*) true ;; \
*) false ;; \
esac; then
dnl The system already has the symbols fts_open, etc. or will have them
dnl in a future version.
dnl Avoid conflicts between these symbols and ours at the linker level.
AC_DEFINE([fts_open], [rpl_fts_open],
[Define to the overridden function name])
AC_DEFINE([fts_close], [rpl_fts_close],
[Define to the overridden function name])
AC_DEFINE([fts_read], [rpl_fts_read],
[Define to the overridden function name])
AC_DEFINE([fts_set], [rpl_fts_set],
[Define to the overridden function name])
AC_DEFINE([fts_children], [rpl_fts_children],
[Define to the overridden function name])
AC_DEFINE([fts_cross_check], [rpl_fts_cross_check],
[Define to the overridden function name])
fi
])