changeset 13687:b3e909bb673a

New module 'termios'. * modules/termios: New file. * lib/termios.in.h: New file. * m4/termios_h.m4: New file. * doc/posix-headers/termios.texi: Mention the new module.
author Bruno Haible <bruno@clisp.org>
date Fri, 17 Sep 2010 02:02:23 +0200
parents f7caccc03505
children 045fc677dc80
files ChangeLog doc/posix-headers/termios.texi lib/termios.in.h m4/termios_h.m4 modules/termios
diffstat 5 files changed, 107 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-16  Bruno Haible  <bruno@clisp.org>
+
+	New module 'termios'.
+	* modules/termios: New file.
+	* lib/termios.in.h: New file.
+	* m4/termios_h.m4: New file.
+	* doc/posix-headers/termios.texi: Mention the new module.
+
 2010-09-16  Eric Blake  <eblake@redhat.com>
 
 	fdutimensat: add an atflag parameter
--- a/doc/posix-headers/termios.texi
+++ b/doc/posix-headers/termios.texi
@@ -3,7 +3,7 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/susv3xbd/termios.h.html}
 
-Gnulib module: ---
+Gnulib module: termios
 
 Portability problems fixed by Gnulib:
 @itemize
new file mode 100644
--- /dev/null
+++ b/lib/termios.in.h
@@ -0,0 +1,34 @@
+/* Substitute for and wrapper around <termios.h>.
+   Copyright (C) 2010 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program 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 General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_TERMIOS_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_TERMIOS_H@
+
+#ifndef _GL_TERMIOS_H
+#define _GL_TERMIOS_H
+
+
+/* Declare overridden functions.  */
+
+#endif /* _GL_TERMIOS_H */
+#endif /* _GL_TERMIOS_H */
new file mode 100644
--- /dev/null
+++ b/m4/termios_h.m4
@@ -0,0 +1,27 @@
+# termios_h.m4 serial 1
+dnl Copyright (C) 2010 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([gl_TERMIOS_H],
+[
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_TERMIOS_H_DEFAULTS])
+
+  gl_CHECK_NEXT_HEADERS([termios.h])
+])
+
+AC_DEFUN([gl_TERMIOS_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_TERMIOS_H_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])
+])
+
+AC_DEFUN([gl_TERMIOS_H_DEFAULTS],
+[
+])
new file mode 100644
--- /dev/null
+++ b/modules/termios
@@ -0,0 +1,37 @@
+Description:
+A <termios.h> that works around platform issues.
+
+Files:
+lib/termios.in.h
+m4/termios_h.m4
+
+Depends-on:
+include_next
+
+configure.ac:
+gl_TERMIOS_H
+
+Makefile.am:
+BUILT_SOURCES += termios.h
+
+# We need the following in order to create <termios.h> when the system
+# version does not have all declarations.
+termios.h: termios.in.h
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \
+	    < $(srcdir)/termios.in.h; \
+	} > $@-t && \
+	mv $@-t $@
+MOSTLYCLEANFILES += termios.h termios.h-t
+
+Include:
+<termios.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible