From: Collin Funk Date: Sun, 11 May 2025 00:39:26 +0000 (-0700) Subject: fts: Generate fts_.h. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e75d0af1ab449840da0d04a1ca1ac13264c9c5f;p=thirdparty%2Fgnulib.git fts: Generate fts_.h. Suggested by Bruno Haible in . * 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. --- diff --git a/ChangeLog b/ChangeLog index 4910d5a264..2b951317ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2025-05-11 Collin Funk + + fts: Generate fts_.h. + Suggested by Bruno Haible in + . + * 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. + 2025-05-11 Bruno Haible string-h, wchar-h: Fix some g++ -Wsystem-headers warnings. diff --git a/lib/fts_.h b/lib/fts.in.h similarity index 99% rename from lib/fts_.h rename to lib/fts.in.h index aa5b88f19c..9acc445039 100644 --- a/lib/fts_.h +++ b/lib/fts.in.h @@ -62,7 +62,7 @@ # define __FLEXIBLE_ARRAY_MEMBER # endif # else -# if HAVE_SYS_CDEFS_H +# if @HAVE_SYS_CDEFS_H@ # include # endif # define __FLEXIBLE_ARRAY_MEMBER FLEXIBLE_ARRAY_MEMBER diff --git a/m4/fts.m4 b/m4/fts.m4 index 1d3a32f52e..c5bdc6eac9 100644 --- a/m4/fts.m4 +++ b/m4/fts.m4 @@ -1,5 +1,5 @@ # fts.m4 -# serial 25 +# 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, @@ -15,7 +15,7 @@ AC_DEFUN([gl_FUNC_FTS_CORE], [ dnl Prerequisites of lib/fts.c. gl_FUNC_OPENAT - AC_CHECK_HEADERS_ONCE([sys/cdefs.h]) + gl_CHECK_HEADER_SYS_CDEFS_H AC_CHECK_FUNCS_ONCE([fstatfs]) AC_CHECK_HEADERS_ONCE([sys/param.h sys/vfs.h])dnl diff --git a/modules/fts b/modules/fts index a50bd958b9..80e1dae2bc 100644 --- a/modules/fts +++ b/modules/fts @@ -2,12 +2,14 @@ Description: Traverse a file hierarchy. Files: -lib/fts_.h +lib/fts.in.h lib/fts.c lib/fts-cycle.c m4/fts.m4 +m4/sys_cdefs_h.m4 Depends-on: +gen-header alignasof attribute c99 @@ -45,10 +47,19 @@ dnl NetBSD versions have bugs and/or unnecessary limitations. gl_CONDITIONAL([GL_COND_OBJ_FTS], [true]) Makefile.am: +BUILT_SOURCES += fts_.h if GL_COND_OBJ_FTS lib_SOURCES += fts.c endif +fts_.h: fts.in.h +@NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%' + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + $(srcdir)/fts.in.h > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += fts_.h fts_.h-t + Include: "fts_.h"