summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-09-17 02:02:23 +0200
committerBruno Haible <bruno@clisp.org>2010-09-17 02:07:24 +0200
commit6dcf524e1f4e344cc0256b3b7efb53babc452a62 (patch)
tree837b10e21ac6a63d37b6d979e2e25deb9def6d82
parent9ea0943bfd68afa3412a139fa1a29d9b6c046916 (diff)
downloadgnulib-6dcf524e1f4e344cc0256b3b7efb53babc452a62.tar.gz
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.
-rw-r--r--ChangeLog8
-rw-r--r--doc/posix-headers/termios.texi2
-rw-r--r--lib/termios.in.h34
-rw-r--r--m4/termios_h.m427
-rw-r--r--modules/termios37
5 files changed, 107 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 328f8dadac..26b8505127 100644
--- 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
diff --git a/doc/posix-headers/termios.texi b/doc/posix-headers/termios.texi
index 85d26163df..5b00ee7de1 100644
--- 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
diff --git a/lib/termios.in.h b/lib/termios.in.h
new file mode 100644
index 0000000000..2873bfe3b9
--- /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 */
diff --git a/m4/termios_h.m4 b/m4/termios_h.m4
new file mode 100644
index 0000000000..762151a29a
--- /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],
+[
+])
diff --git a/modules/termios b/modules/termios
new file mode 100644
index 0000000000..e2deddbd87
--- /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