From: Bruno Haible Date: Mon, 19 Aug 2024 11:46:02 +0000 (+0200) Subject: mntent: New module. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=662fd337dbb0b85b7ff69a9a12e5b43bad063c57;p=gnulib.git mntent: New module. * lib/mntent.in.h: New file. * m4/mntent_h.m4: New file. * modules/mntent: New file. * doc/glibc-headers/mntent.texi: Mention the new module. * top/maint.mk (gl_prefer_angle_bracket_headers_): Add mntent.h. * doc/gnulib-tool.texi (Style of #include statements): Add mntent.h to the list. --- diff --git a/ChangeLog b/ChangeLog index 7486fb8047..390733f163 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-08-19 Bruno Haible + + mntent: New module. + * lib/mntent.in.h: New file. + * m4/mntent_h.m4: New file. + * modules/mntent: New file. + * doc/glibc-headers/mntent.texi: Mention the new module. + * top/maint.mk (gl_prefer_angle_bracket_headers_): Add mntent.h. + * doc/gnulib-tool.texi (Style of #include statements): Add mntent.h to + the list. + 2024-08-17 Bruno Haible once: Fix pthread-rwlock crashes with clang (regr. 2024-08-07). diff --git a/doc/glibc-headers/mntent.texi b/doc/glibc-headers/mntent.texi index cbaf805453..b6fc955fc8 100644 --- a/doc/glibc-headers/mntent.texi +++ b/doc/glibc-headers/mntent.texi @@ -19,7 +19,7 @@ Documentation: @uref{https://www.kernel.org/doc/man-pages/online/pages/man3/setmntent.3.html,,man setmntent}. @end itemize -Gnulib module: --- +Gnulib module: mntent Portability problems fixed by Gnulib: @itemize diff --git a/doc/gnulib-tool.texi b/doc/gnulib-tool.texi index e26380cd24..41eccb3019 100644 --- a/doc/gnulib-tool.texi +++ b/doc/gnulib-tool.texi @@ -625,6 +625,7 @@ but are not standardized: @item @code{error.h} @item @code{getopt.h} @item @code{malloc.h} +@item @code{mntent.h} @item @code{omp.h} @item @code{pty.h} @item @code{selinux/selinux.h} diff --git a/lib/mntent.in.h b/lib/mntent.in.h new file mode 100644 index 0000000000..4da9d85314 --- /dev/null +++ b/lib/mntent.in.h @@ -0,0 +1,41 @@ +/* Provide a more complete mntent.h. + + Copyright (C) 2024 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#ifndef _@GUARD_PREFIX@_MNTENT_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_MNTENT_H@ + +#ifndef _@GUARD_PREFIX@_MNTENT_H +#define _@GUARD_PREFIX@_MNTENT_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _@GUARD_PREFIX@_MNTENT_H */ +#endif /* _@GUARD_PREFIX@_MNTENT_H */ diff --git a/m4/mntent_h.m4 b/m4/mntent_h.m4 new file mode 100644 index 0000000000..f067cd0293 --- /dev/null +++ b/m4/mntent_h.m4 @@ -0,0 +1,52 @@ +# mntent_h.m4 +# serial 1 +dnl Copyright (C) 2024 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. + +AC_DEFUN_ONCE([gl_MNTENT_H], +[ + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. + AC_REQUIRE([gl_MNTENT_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([mntent.h]) + dnl For now, we provide a wrapper only if the system already has + dnl a . + if test $ac_cv_header_mntent_h = yes; then + GL_GENERATE_MNTENT_H=true + gl_CHECK_NEXT_HEADERS([mntent.h]) + else + GL_GENERATE_MNTENT_H=false + fi +]) + +# gl_MNTENT_MODULE_INDICATOR([modulename]) +# sets the shell variable that indicates the presence of the given module +# to a C preprocessor expression that will evaluate to 1. +# This macro invocation must not occur in macros that are AC_REQUIREd. +AC_DEFUN([gl_MNTENT_MODULE_INDICATOR], +[ + dnl Ensure to expand the default settings once only. + gl_MNTENT_H_REQUIRE_DEFAULTS + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +# Initializes the default values for AC_SUBSTed shell variables. +# This macro must not be AC_REQUIREd. It must only be invoked, and only +# outside of macros or in macros that are not AC_REQUIREd. +AC_DEFUN([gl_MNTENT_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_MNTENT_H_MODULE_INDICATOR_DEFAULTS], [ + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_MNTENT_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_MNTENT_H_DEFAULTS]) +]) + +AC_DEFUN([gl_MNTENT_H_DEFAULTS], +[ + dnl Assume proper GNU behavior unless another module says otherwise. +]) diff --git a/modules/mntent b/modules/mntent new file mode 100644 index 0000000000..eb30116fad --- /dev/null +++ b/modules/mntent @@ -0,0 +1,47 @@ +Description: + with more declarations. + +Files: +lib/mntent.in.h +m4/mntent_h.m4 + +Depends-on: +gen-header +include_next + +configure.ac: +gl_MNTENT_H +gl_CONDITIONAL_HEADER([mntent.h]) +AC_PROG_MKDIR_P + +Makefile.am: +BUILT_SOURCES += $(MNTENT_H) + +# We need the following in order to create when desired. +if GL_GENERATE_MNTENT_H +mntent.h: mntent.in.h $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) '%reldir%' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_MNTENT_H''@|$(NEXT_MNTENT_H)|g' \ + $(srcdir)/mntent.in.h > $@-t + $(AM_V_at)mv $@-t $@ +else +mntent.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += mntent.h mntent.h-t + +Include: +#if HAVE_MNTENT_H + +#endif + +License: +LGPLv2+ + +Maintainer: +all diff --git a/top/maint.mk b/top/maint.mk index 37f6889b06..39372f99f4 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -565,6 +565,7 @@ gl_prefer_angle_bracket_headers_ ?= \ locale.h \ malloc.h \ math.h \ + mntent.h \ monetary.h \ net/if.h \ netdb.h \