termios: fix compilation on mingw
authorEric Blake <eblake@redhat.com>
Wed, 13 Oct 2010 20:54:00 +0000 (14:54 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 13 Oct 2010 21:19:17 +0000 (15:19 -0600)
* m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Set default.
(gl_TERMIOS_H): Adjust it on mingw.
* modules/termios (Makefile.am): Substitute new key.
* lib/termios.in.h (includes): Make include_next conditional.
* doc/posix-headers/termios.texi (termios.h): Update
documentation.
Reported by Daniel P. Berrange.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/posix-headers/termios.texi
lib/termios.in.h
m4/termios_h.m4
modules/termios

index 9a4ed578f11f043e7281819e91eed62ee2736e6b..acb19348cd87bbdf22c165fc677a29535e04cfd7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-13  Eric Blake  <eblake@redhat.com>
+
+       termios: fix compilation on mingw
+       * m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Set default.
+       (gl_TERMIOS_H): Adjust it on mingw.
+       * modules/termios (Makefile.am): Substitute new key.
+       * lib/termios.in.h (includes): Make include_next conditional.
+       * doc/posix-headers/termios.texi (termios.h): Update
+       documentation.
+       Reported by Daniel P. Berrange.
+
 2010-10-13  Jim Meyering  <meyering@redhat.com>
 
        git-version-gen: don't require that .git/ be in the current dir
index cf9c24bdb8e317a308507625336fb91d7a46d789..7f5b67098dbaf8e8c485573f422a37321ca99488 100644 (file)
@@ -7,11 +7,11 @@ Gnulib module: termios
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This header file is missing on some platforms:
+mingw.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
-@item
-This header file is missing on some platforms:
-mingw.
 @end itemize
index 5728ab691a5b44d1a65d907e6f252991c5c075d9..10ef3e7accb0bbd678cf2e5ca342947627e991a0 100644 (file)
@@ -23,7 +23,9 @@
 @PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
-#@INCLUDE_NEXT@ @NEXT_TERMIOS_H@
+#if @HAVE_TERMIOS_H@
+# @INCLUDE_NEXT@ @NEXT_TERMIOS_H@
+#endif
 
 #ifndef _GL_TERMIOS_H
 #define _GL_TERMIOS_H
index d6b3c062e51962b73e8814c020576d87522482b2..151cc4fc968b49a696cbb1a4a90929ac15278e80 100644 (file)
@@ -12,6 +12,11 @@ AC_DEFUN([gl_TERMIOS_H],
 
   gl_CHECK_NEXT_HEADERS([termios.h])
 
+  AC_CHECK_HEADERS_ONCE([termios.h])
+  if test $ac_cv_header_termios_h != yes; then
+    HAVE_TERMIOS_H=0
+  fi
+
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
   dnl guaranteed by C89.
@@ -33,4 +38,5 @@ AC_DEFUN([gl_TERMIOS_H_DEFAULTS],
   GNULIB_TCGETSID=0;      AC_SUBST([GNULIB_TCGETSID])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_TCGETSID=1;        AC_SUBST([HAVE_TCGETSID])
+  HAVE_TERMIOS_H=1;       AC_SUBST([HAVE_TERMIOS_H])
 ])
index 2930c1a1b73eef86d1a7f405da5e3b8e55fc7c41..8c9ceba1da66693078918b9f2ba05f4b102b7382 100644 (file)
@@ -27,6 +27,7 @@ termios.h: termios.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
              -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \
              -e 's|@''GNULIB_TCGETSID''@|$(GNULIB_TCGETSID)|g' \
              -e 's|@''HAVE_TCGETSID''@|$(HAVE_TCGETSID)|g' \
+             -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
            < $(srcdir)/termios.in.h; \