Re: Enhance isatty() for GCC for use with GNU make?

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

 



On 09/10/14 20:31, Paul Smith wrote:
Hi all.  In GNU make 4.0+ a new capability was introduced which allows
GNU make to separate output for individual jobs when run in parallel, to
avoid corrupted output with multiple commands writing to stdout at the
same time.

In order to make this work, of course, GNU make must capture the output
of the commands it invokes then dump them out after ensuring it has sole
write access to the terminal.  This means that when this feature is
enabled the isatty() function will always return false, _even if_ the
output will really be sent to a TTY eventually.  This causes all
utilities that make invokes that check for terminal settings to behave
incorrectly (as if they were not printing to the terminal).

GNU make 4.1+ will set an environment variable MAKE_TERMOUT to a
non-empty value if it (make) believes that the output it finds will
eventually be sent to a terminal
(...)

but this is actually not a very robust solution (how does a user turn it
off?), and it doesn't change things like terminal width (number of
columns) computation, etc.

It would be nice if this were handled automagically, although I agree it
introduces a bit of (unseemly?) chumminess between GCC and GNU make.
Wouldn't be preferible for make to preload such fake isatty() to those programs? Or even better, create a pseudoterminal in which to run the child processes. You
would only need as many pts as jobs, which seems reasonable.






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux