* 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-19 Bruno Haible <bruno@clisp.org>
+
+ 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 <bruno@clisp.org>
once: Fix pthread-rwlock crashes with clang (regr. 2024-08-07).
@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
@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}
--- /dev/null
+/* 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 <https://www.gnu.org/licenses/>. */
+
+#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 */
--- /dev/null
+# 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 <mntent.h> wrapper only if the system already has
+ dnl a <mntent.h>.
+ 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.
+])
--- /dev/null
+Description:
+<mntent.h> 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 <mntent.h> 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
+<mntent.h>
+#endif
+
+License:
+LGPLv2+
+
+Maintainer:
+all
locale.h \
malloc.h \
math.h \
+ mntent.h \
monetary.h \
net/if.h \
netdb.h \