On Wed, 2011-10-12 at 00:05 +0200, Eli Zaretskii wrote: > > Date: Tue, 11 Oct 2011 22:11:23 +0200 > > From: Sebastian Pipping <sebast...@pipping.org> > > > > > * The implementation is clean and portable and doesn't add lots of > > > complexity to the code. Does everything support the color codes > > > you're using? I don't want to have to link with ncurses or > > > something to get portable colorization. > > > > No plans on using ncurses here. I suppose if we do what grep does were > > safe enough portability-wise? I'll check what I can learn from there. > > Please don't assume that writing some special character sequences to > stdout is all that's needed. This is so on Posix platforms, but not > Windows or DOS. To be truly portable, there should be an API that > accepts a string and the information how to color it, and then a > platform-specific backend actually produces the colored output and > writes it to the screen.
Right. It's OK to look at how GNU grep does it, but GNU make is actually far more portable than GNU grep, which is really a POSIX tool and more tightly tied to POSIX systems. GNU make, in addition to POSIX systems, also runs on Windows, DOS, Amiga/OS, even OpenVMS. Plus not all POSIX systems use the same colorization models; really colorization depends on the terminal type not the OS (at least for POSIX systems). vtxxx, pcansi, and xterm terminals may use very different colorization codes than some other terminal type. Anyway, it's not necessarily the case that a feature implemented only on a subset of supported platforms will be rejected. But, it needs to be implemented in such a way that it doesn't break on unsupported platforms and that it's easy and clean to extend to work on other platforms if someone wants to do so. -- ------------------------------------------------------------------------------- Paul D. Smith <psm...@gnu.org> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make