]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: move definition of console colors in its own '.am' fragment
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 May 2012 22:58:58 +0000 (00:58 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 11:44:53 +0000 (13: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 <stefano.lattarini@gmail.com>
Makefile.am
lib/am/check.am
lib/am/color-tests.am [new file with mode: 0644]

index 39cde859297603ba9db094d6dcf0858cc3138288..0da444a6c88984b29d93c4ef080c3985753035a6 100644 (file)
@@ -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 \
index 782fdd6ca84d329f6637468985a022b76ec25937..5a3cff24074f5962db2a5eacc623435735228fe4 100644 (file)
 ## 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='\e[0;31m'; \
-    grn='\e[0;32m'; \
-    lgn='\e[1;32m'; \
-    blu='\e[1;34m'; \
-    mgn='\e[0;35m'; \
-    brg='\e[1m'; \
-    std='\e[m'; \
-  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 (file)
index 0000000..db91049
--- /dev/null
@@ -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='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
+}
+else !%?COLOR%
+am__tty_colors = $(am__tty_colors_dummy)
+endif !%?COLOR%