]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
fts: Generate fts_.h.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 11 May 2025 00:39:26 +0000 (17:39 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Mon, 12 May 2025 02:37:23 +0000 (19:37 -0700)
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.

ChangeLog
lib/fts.in.h [moved from lib/fts_.h with 99% similarity]
m4/fts.m4
modules/fts

index 4910d5a264a645f866e8a89cab08ef366a6803e1..2b951317bac42418807c3f29cb399a7439e72cdd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2025-05-11  Collin Funk  <collin.funk1@gmail.com>
+
+       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.
+
 2025-05-11  Bruno Haible  <bruno@clisp.org>
 
        string-h, wchar-h: Fix some g++ -Wsystem-headers warnings.
similarity index 99%
rename from lib/fts_.h
rename to lib/fts.in.h
index aa5b88f19cf6d546e3e254d8e53b6d7780f52be7..9acc445039e1ab9757ecbdbde4ef44fa468f1e25 100644 (file)
@@ -62,7 +62,7 @@
 #   define __FLEXIBLE_ARRAY_MEMBER
 #  endif
 # else
-#  if HAVE_SYS_CDEFS_H
+#  if @HAVE_SYS_CDEFS_H@
 #   include <sys/cdefs.h>
 #  endif
 #  define __FLEXIBLE_ARRAY_MEMBER FLEXIBLE_ARRAY_MEMBER
index 1d3a32f52e1472d6c6640ddbffd221c1467c967f..c5bdc6eac90a2fe7ef584fa149e6a390201d6cd7 100644 (file)
--- 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
index a50bd958b990a85bf1b3f5bed8b93e3d704db080..80e1dae2bcc9f22e90fb85ef2f086174d0d88ff0 100644 (file)
@@ -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"