New module 'termios'.
authorBruno Haible <bruno@clisp.org>
Fri, 17 Sep 2010 00:02:23 +0000 (02:02 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 17 Sep 2010 00:07:24 +0000 (02:07 +0200)
* 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.

ChangeLog
doc/posix-headers/termios.texi
lib/termios.in.h [new file with mode: 0644]
m4/termios_h.m4 [new file with mode: 0644]
modules/termios [new file with mode: 0644]

index 328f8da..26b8505 100644 (file)
--- 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
index 85d2616..5b00ee7 100644 (file)
@@ -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
diff --git a/lib/termios.in.h b/lib/termios.in.h
new file mode 100644 (file)
index 0000000..2873bfe
--- /dev/null
@@ -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 */
diff --git a/m4/termios_h.m4 b/m4/termios_h.m4
new file mode 100644 (file)
index 0000000..762151a
--- /dev/null
@@ -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],
+[
+])
diff --git a/modules/termios b/modules/termios
new file mode 100644 (file)
index 0000000..e2deddb
--- /dev/null
@@ -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