automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 06/17] [ng] check: move definition of console color


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 06/17] [ng] check: move definition of console colors in its own '.am' fragment
Date: Tue, 22 May 2012 22:48:44 +0200

This is only meant to simplify future changes.  No semantic change is
intended.

* lib/am/check.am: Include ...
* lib/am/check.am (am__tty_colors, am__tty_colors_dummy): Move out to ...
* lib/am/color-tests.am: ... this new file.
* Makefile.am (dist_am_DATA): Adjust.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 Makefile.am           |    1 +
 lib/am/check.am       |   30 +-----------------------------
 lib/am/color-tests.am |   45 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 29 deletions(-)
 create mode 100644 lib/am/color-tests.am

diff --git a/Makefile.am b/Makefile.am
index 39cde85..0da444a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -225,6 +225,7 @@ EXTRA_DIST += lib/Automake/Config.in
 dist_am_DATA = \
   lib/am/check.am \
   lib/am/check2.am \
+  lib/am/color-tests.am \
   lib/am/clean-hdr.am \
   lib/am/clean.am \
   lib/am/compile.am \
diff --git a/lib/am/check.am b/lib/am/check.am
index 782fdd6..5a3cff2 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -14,35 +14,7 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-am__tty_colors_dummy = \
-  mgn= red= grn= lgn= blu= brg= std=; \
-  am__color_tests=no
-if %?COLOR%
-am__tty_colors = { \
-  $(am__tty_colors_dummy); \
-  if test "X$(AM_COLOR_TESTS)" = Xno; then \
-    am__color_tests=no; \
-  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
-    am__color_tests=yes; \
-## If stdout is a non-dumb tty, use colors.  If test -t is not supported,
-## then this check fails; a conservative approach.  Of course do not
-## redirect stdout here, just stderr.
-  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
-    am__color_tests=yes; \
-  fi; \
-  if test $$am__color_tests = yes; then \
-    red=''; \
-    grn=''; \
-    lgn=''; \
-    blu=''; \
-    mgn=''; \
-    brg=''; \
-    std=''; \
-  fi; \
-}
-else !%?COLOR%
-am__tty_colors = $(am__tty_colors_dummy)
-endif !%?COLOR%
+include color-tests.am
 
 .PHONY: check-TESTS
 
diff --git a/lib/am/color-tests.am b/lib/am/color-tests.am
new file mode 100644
index 0000000..db91049
--- /dev/null
+++ b/lib/am/color-tests.am
@@ -0,0 +1,45 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 2001-2012 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, see <http://www.gnu.org/licenses/>.
+
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+if %?COLOR%
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+## If stdout is a non-dumb tty, use colors.  If test -t is not supported,
+## then this check fails; a conservative approach.  Of course do not
+## redirect stdout here, just stderr.
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+else !%?COLOR%
+am__tty_colors = $(am__tty_colors_dummy)
+endif !%?COLOR%
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]