diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-08-07 08:47:36 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-08-07 08:47:36 +0000 |
commit | f7364d5833f700eefd7919326bfa5724da1461c3 (patch) | |
tree | 1cff97a630c09c8545fc850c474f1152f5f0d8b2 /include/llvm/Config/config.h.in | |
parent | f76e118cf879a90145aebbdc39fdd7feb9bf3e51 (diff) | |
download | llvm-f7364d5833f700eefd7919326bfa5724da1461c3.tar.gz llvm-f7364d5833f700eefd7919326bfa5724da1461c3.tar.bz2 llvm-f7364d5833f700eefd7919326bfa5724da1461c3.tar.xz |
Add support for linking against a curses library when available and
using it to detect whether or not a terminal supports colors. This
replaces a particularly egregious hack that merely compared the TERM
environment variable to "dumb". That doesn't really translate to
a reasonable experience for users that have actually ensured their
terminal's capabilities are accurately reflected.
This makes testing a terminal for color support somewhat more expensive,
but it is called very rarely anyways. The important fast path when the
output is being piped somewhere is already in place.
The global lock may seem excessive, but the spec for calling into curses
is *terrible*. The whole library is terrible, and I spent quite a bit of
time looking for a better way of doing this before convincing myself
that this was the fundamentally correct way to behave. The damage of the
curses library is very narrowly confined, and we continue to use raw
escape codes for actually manipulating the colors which is a much sane
system than directly using curses here (IMO).
If this causes trouble for folks, please let me know. I've tested it on
Linux and will watch the bots carefully. I've also worked to account for
the variances of curses interfaces that I could finde documentation for,
but that may not have been sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Config/config.h.in')
-rw-r--r-- | include/llvm/Config/config.h.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 74b7829d3b..7bb1caad41 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -69,6 +69,12 @@ /* can use __crashreporter_info__ */ #undef HAVE_CRASHREPORTER_INFO +/* Define if curses provides the has_color() function on this platform. */ +#undef HAVE_CURSES + +/* Define to 1 if you have the <curses.h> header file. */ +#undef HAVE_CURSES_H + /* Define to 1 if you have the <cxxabi.h> header file. */ #undef HAVE_CXXABI_H @@ -282,6 +288,18 @@ /* Define if mmap() can map files into memory */ #undef HAVE_MMAP_FILE +/* Define to 1 if you have the <ncursesw/curses.h> header file. */ +#undef HAVE_NCURSESW_CURSES_H + +/* Define to 1 if you have the <ncursesw.h> header file. */ +#undef HAVE_NCURSESW_H + +/* Define to 1 if you have the <ncurses/curses.h> header file. */ +#undef HAVE_NCURSES_CURSES_H + +/* Define to 1 if you have the <ncurses.h> header file. */ +#undef HAVE_NCURSES_H + /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ #undef HAVE_NDIR_H |