[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] termios: fix compilation on mingw
From: |
Eric Blake |
Subject: |
[PATCH] termios: fix compilation on mingw |
Date: |
Wed, 13 Oct 2010 15:20:39 -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 <address@hidden>
---
>> The gnulib replacement is doing an include_next<termios.h> but there
>> is no next one to include.
>Then that's a bug in the gnulib replacement. I'll probably be able to
>fix that today.
Tested this on a cygwin->mingw cross compile.
ChangeLog | 11 +++++++++++
doc/posix-headers/termios.texi | 6 +++---
lib/termios.in.h | 4 +++-
m4/termios_h.m4 | 6 ++++++
modules/termios | 1 +
5 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9a4ed57..acb1934 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-13 Eric Blake <address@hidden>
+
+ 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 <address@hidden>
git-version-gen: don't require that .git/ be in the current dir
diff --git a/doc/posix-headers/termios.texi b/doc/posix-headers/termios.texi
index cf9c24b..7f5b670 100644
--- a/doc/posix-headers/termios.texi
+++ b/doc/posix-headers/termios.texi
@@ -7,11 +7,11 @@ termios.h
Portability problems fixed by Gnulib:
@itemize
address@hidden
+This header file is missing on some platforms:
+mingw.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
address@hidden
-This header file is missing on some platforms:
-mingw.
@end itemize
diff --git a/lib/termios.in.h b/lib/termios.in.h
index 5728ab6..10ef3e7 100644
--- a/lib/termios.in.h
+++ b/lib/termios.in.h
@@ -23,7 +23,9 @@
@PRAGMA_COLUMNS@
/* The include_next requires a split double-inclusion guard. */
address@hidden@ @NEXT_TERMIOS_H@
+#if @HAVE_TERMIOS_H@
+# @INCLUDE_NEXT@ @NEXT_TERMIOS_H@
+#endif
#ifndef _GL_TERMIOS_H
#define _GL_TERMIOS_H
diff --git a/m4/termios_h.m4 b/m4/termios_h.m4
index d6b3c06..151cc4f 100644
--- a/m4/termios_h.m4
+++ b/m4/termios_h.m4
@@ -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])
])
diff --git a/modules/termios b/modules/termios
index 2930c1a..8c9ceba 100644
--- a/modules/termios
+++ b/modules/termios
@@ -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; \
--
1.7.2.3