From 9a2451af0bc086635d9ad16468a3d30de4f5e86f Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 15 Sep 2014 09:30:40 -0400 Subject: * main.c, NEWS, doc/make.text: Rename MAKE_TTY* to MAKE_TERM* --- NEWS | 5 +++-- doc/make.texi | 10 +++++----- main.c | 10 ++++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index c394850..e826623 100644 --- a/NEWS +++ b/NEWS @@ -15,8 +15,9 @@ A complete list of bugs fixed in this version is available here: http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom -* New variables: $(MAKE_TTYOUT) and $(MAKE_TTYERR) are set if stdout or - stderr, respectively, are believed to be writing to a terminal. +* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set if stdout or + stderr, respectively, are believed to be writing to a terminal. These + variables are exported by default. * Allow a no-text-argument form of the $(file ...) function. Without a text argument nothing is written to the file: it is simply opened in the diff --git a/doc/make.texi b/doc/make.texi index 3a873d7..15da9ba 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -6321,13 +6321,13 @@ will contain the number of times this instance has restarted. Note this is not the same as recursion (counted by the @code{MAKELEVEL} variable). You should not set, modify, or export this variable. -@vindex MAKE_TTYOUT @r{(whether stdout is a terminal)} -@vindex MAKE_TTYERR @r{(whether stderr is a terminal)} -@item MAKE_TTYOUT -@itemx MAKE_TTYERR +@vindex MAKE_TERMOUT @r{(whether stdout is a terminal)} +@vindex MAKE_TERMERR @r{(whether stderr is a terminal)} +@item MAKE_TERMOUT +@itemx MAKE_TERMERR When @code{make} starts it will check whether stdout and stderr will show their output on a terminal. If so, it will set -@code{MAKE_TTYOUT} and @code{MAKE_TTYERR}, respectively, to the name +@code{MAKE_TERMOUT} and @code{MAKE_TERMERR}, respectively, to the name of the terminal device (or @code{true} if this cannot be determined). If set these variables will be marked for export. These variables will not be changed by @code{make} and they will not be modified if diff --git a/main.c b/main.c index 4a79b60..09fb1fb 100644 --- a/main.c +++ b/main.c @@ -1400,12 +1400,14 @@ main (int argc, char **argv, char **envp) /* Set a variable specifying whether stdout/stdin is hooked to a TTY. */ #ifdef HAVE_ISATTY if (isatty (fileno (stdout))) - define_variable_cname ("MAKE_TTYOUT", TTYNAME (fileno (stdout)), - o_default, 0)->export = v_export; + if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT"))) + define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)), + o_default, 0)->export = v_export; if (isatty (fileno (stderr))) - define_variable_cname ("MAKE_TTYERR", TTYNAME (fileno (stderr)), - o_default, 0)->export = v_export; + if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR"))) + define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)), + o_default, 0)->export = v_export; #endif /* Reset in case the switches changed our minds. */ -- cgit v1.2.3