Subject: bug#7067: [PATCH] build: use gnulib's new termios module

From: Jim Meyering <[email-masked]>
Date: Sat, 18 Sep 2010 21:26:42 +0200

Updating to the latest gnulib would have provoked this new syntax-check
failure in coreutils:

  src/ls.c:42:#if HAVE_TERMIOS_H
  src/stty.c:39:#if HAVE_TERMIOS_H
  maint.mk: do not test the above HAVE_<header>_H symbol(s);\n  with the corresponding gnulib module, they are always true
  make[3]: *** [sc_prohibit_always_true_header_tests] Error 1

That is easy to fix, along with the stray "\n" in the diagnostic.
Here's the coreutils fix:
I'll post the gnulib fix for maint.mk and a few unexpanded \n's
to bug-gnulib separately.

>From c53eabf7090121b62cd49b0379727e9602fe8aa9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Sat, 18 Sep 2010 20:24:41 +0200
Subject: [PATCH] build: use gnulib's new termios module

With it, we can remove the two sole tests of HAVE_TERMIOS_H.
* bootstrap.conf (gnulib_modules): Add termios.
* src/ls.c: Don't test HAVE_TERMIOS_H.
* src/stty.c: Likewise.
* m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove configure-time
test for termios.h.
---
 bootstrap.conf  |    1 +
 m4/jm-macros.m4 |    3 +--
 src/ls.c        |    4 +---
 src/stty.c      |    4 +---
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index e84424a..920fe63 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -207,6 +207,7 @@ gnulib_modules="
   sys_ioctl
   sys_stat
   sys_wait
+  termios
   timespec
   tzset
   uname
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 20b9af9..6faf08a 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -1,4 +1,4 @@
-#serial 109   -*- autoconf -*-
+#serial 110   -*- autoconf -*-

 dnl Misc type-related macros for coreutils.

@@ -176,7 +176,6 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS],
     sys/resource.h \
     sys/systeminfo.h \
     syslog.h \
-    termios.h \
   )
   AC_CHECK_HEADERS([sys/sysctl.h], [], [],
     [AC_INCLUDES_DEFAULT
diff --git a/src/ls.c b/src/ls.c
index 6e3e836..f861df9 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -39,9 +39,7 @@
 #include <config.h>
 #include <sys/types.h>

-#if HAVE_TERMIOS_H
-# include <termios.h>
-#endif
+#include <termios.h>
 #if HAVE_STROPTS_H
 # include <stropts.h>
 #endif
diff --git a/src/stty.c b/src/stty.c
index 71045c2..5d9d4f0 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -36,9 +36,7 @@
 #include <stdio.h>
 #include <sys/types.h>

-#if HAVE_TERMIOS_H
-# include <termios.h>
-#endif
+#include <termios.h>
 #if HAVE_STROPTS_H
 # include <stropts.h>
 #endif
--
1.7.3.rc2.225.g4a2a