Commit Graph

779 Commits

Author SHA1 Message Date
Joerg Sonnenberger
5b8cd15092 Recognize aarch64_be as valid architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219168 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 23:05:04 +00:00
Peter Collingbourne
d6b988a347 Remove unused ALL_BINDINGS configuration variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219035 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-03 23:03:01 +00:00
Rafael Espindola
1c9caced63 Delete support for AuroraUX.
auroraux.org is not resolving.

I will add this to the release notes as soon as I figure out where to put the
3.6 release notes :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215645 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-14 15:15:09 +00:00
NAKAMURA Takumi
7b3455878c [autoconf] Fixup s/3.5/3.6/. Clang's ident was 3.5.0svn in autoconf build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214167 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 08:35:03 +00:00
Hans Wennborg
0b783fc554 Update LLVM version: 3.5 => 3.6
We branched 3.5, it's now time to work on 3.6.

This is Sylvestre's patch from [1] plus regenerated configure
file by me, and minus the release notes reset, which Sean
pointed out [2] should happen later.

 1. http://reviews.llvm.org/D4660
 2. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140721/111137.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214131 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-28 22:10:52 +00:00
Alp Toker
3cf9f37312 Drop the udis86 wrapper from llvm::sys
This optional dependency on the udis86 library was added some time back to aid
JIT development, but doesn't make much sense to link into LLVM binaries these
days.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213300 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 20:05:29 +00:00
Alp Toker
49feabcce3 Track clang r213171
The clang rewriter is now a core facility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213173 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 16:50:34 +00:00
Rafael Espindola
07de13a9bc Remove path_tclsh.m4.
Looks like it was only used by dejagnu and is now dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 12:54:32 +00:00
Alp Toker
04de60e28f GraphWriter: detect graph viewer programs at runtime
Replace the crufty build-time configure checks for program paths with
equivalent runtime logic.

This lets users install graphing tools as needed without having to reconfigure
and rebuild LLVM, while eliminating a long chain of inappropriate compile
dependencies that included GUI programs and the windowing system.

Additional features:

 * Support the OS X 'open' command to view graphs generated by any of the
   Graphviz utilities. This is an alternative to the Graphviz OS X UI which is
   no longer available on Mountain Lion.

 * Produce informative log output upon failure to indicate which programs can
   be installed to view graphs.

Ping me if this doesn't work for your particular environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210001 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 01:40:04 +00:00
Joerg Sonnenberger
60aa82b5b6 Don't hard-code ld when extracting host linker version, use ${LD} if
it is set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-28 15:12:55 +00:00
Tim Northover
29f94c7201 AArch64/ARM64: move ARM64 into AArch64's place
This commit starts with a "git mv ARM64 AArch64" and continues out
from there, renaming the C++ classes, intrinsics, and other
target-local objects for consistency.

"ARM64" test directories are also moved, and tests that began their
life in ARM64 use an arm64 triple, those from AArch64 use an aarch64
triple. Both should be equivalent though.

This finishes the AArch64 merge, and everyone should feel free to
continue committing as normal now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209577 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-24 12:50:23 +00:00
Tim Northover
9105f66d6f AArch64/ARM64: remove AArch64 from tree prior to renaming ARM64.
I'm doing this in two phases for a better "git blame" record. This
commit removes the previous AArch64 backend and redirects all
functionality to ARM64. It also deduplicates test-lines and removes
orphaned AArch64 tests.

The next step will be "git mv ARM64 AArch64" and rewire most of the
tests.

Hopefully LLVM is still functional, though it would be even better if
no-one ever had to care because the rename happens straight
afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209576 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-24 12:42:26 +00:00
Tim Northover
7b837d8c75 ARM64: initial backend import
This adds a second implementation of the AArch64 architecture to LLVM,
accessible in parallel via the "arm64" triple. The plan over the
coming weeks & months is to merge the two into a single backend,
during which time thorough code review should naturally occur.

Everything will be easier with the target in-tree though, hence this
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 10:18:08 +00:00
Rafael Espindola
9802a6cbdc Remove projects/sample.
As an example that was not actually being used, it suffered from a slow bitrot.

The two main issues with it were that it had no cmake support and
included a copy of the autoconf directory. The reality is that
autoconf is not easily composable. The lack of composabilty is why we
have clang options in llvm's configure. Suggesting that users include
a copy of autoconf/ in their projects seems a bad idea.

We are also in the process of switching to cmake, so pushing autoconf
to new project is probably not what we want.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203728 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 22:40:22 +00:00
Rafael Espindola
bdb05aa392 Add a --enable-clang-plugin-support option to configure.
This will replace the now badly named CLANG_IS_PRODUCTION.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 16:58:35 +00:00
Rafael Espindola
c23e234908 Now that we don't use libtool, we don't need to upgrade it :-)
Thanks to Patrik Hägglund H for noticing it!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203019 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 22:45:14 +00:00
Eric Christopher
64da21dd5a Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202917 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 00:43:38 +00:00
Tom Stellard
db3064e438 Add patch level to llvm version in CMake and Autoconf
The shared library generated by autoconf will now be called
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX).so
and a symlink named
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX).so will
also be created in the install directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202720 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 15:22:00 +00:00
Chandler Carruth
f38b536b3d [C++11] Replace autoconf --enable-cxx11 with --enable-cxx1y. The
baseline is now C++11, and we unconditionally add -std=c++11 to the
flags.

This has the dim potential to break some non-GNU-compatible compiler (in
terms of -std flags) using the makefiles, but those makefiles are
littered with GNU-style compile flags so it would be very surprising to
me for it to actually happen in practice. As always, do let me know if
there is a toolchain you're using where this doesn't work, and I'll be
watching the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202569 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-01 03:33:08 +00:00
Chandler Carruth
2e7beea23c [C++11] Switch autoconf and make to use C++11 by default. Now both build
systems have the default as C++11, but retain the ability to build with
C++98.

Again, please restrain your enthusiasm a bit in case this needs to be
reverted. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202546 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 21:47:41 +00:00
Rafael Espindola
0164f27742 Drop libtool from llvm.
We were only using it so find the shared library extension and nm. There are
simpler ways to do those things :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202524 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 18:17:54 +00:00
Rafael Espindola
fc6cc0edd6 With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 16:16:51 +00:00
Renato Golin
06b8110f7a Add aarch64 to config.guess
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202125 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 09:30:54 +00:00
NAKAMURA Takumi
2fbf9e2fda Add version, arch, system libs, and targets to Makefile.config
Teach autoconf/configure.ac to AC_SUBST several additional values in
Makefile.config to make them available to Makefile code.  These will
be useful to generate CMake package modules from the Makefile build.

Contributed by Brad King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201052 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-09 16:36:42 +00:00
Todd Fiala
9cd9208565 Fix configure to find arc4random via header files.
ISSUE:

On Ubuntu 12.04 LTS, arc4random is provided by libbsd.so, which is a
transitive dependency of libedit. If a system had libedit on it that
was implemented in terms of libbsd.so, then the arc4random test,
previously implemented as a linker test, would succeed with -ledit.
However, on Ubuntu this would also require a #include <bsd/stdlib.h>.
This caused a build breakage on configure-based Ubuntu 12.04 with
libedit installed.

FIX:

This fix changes configure to test for arc4random by searching for it
in the standard header files. On Ubuntu 12.04, this test now properly
fails to find arc4random as it is not defined in the default header
locations. It also tweaks the #define names to match the output of the
header check command, which is slightly different than the linker
function check #defines.

I tested the following scenarios:

(1) Ubuntu 12.04 without the libedit package [did not find arc4random,
as expected]

(2) Ubuntu 12.04 with libedit package [properly did not find
arc4random, as expected]

(3) Ubuntu 12.04 with most recent libedit, custom built, and not
dependent on libbsd.so [properly did not find arc4random, as
expected].

(4) FreeBSD 10.0B1 [properly found arc4random, as expected]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200819 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-05 05:04:36 +00:00
Peter Collingbourne
cb6684b63b Introduce line editor library.
This library will be used by clang-query. I can imagine LLDB becoming another
client of this library, so I think LLVM is a sensible place for it to live.
It wraps libedit, and adds tab completion support.

The code is loosely based on the line editor bits in LLDB, with a few
improvements:

 - Polymorphism for retrieving the list of tab completions, based on
   the concept pattern from the new pass manager.

 - Tab completion doesn't corrupt terminal output if the input covers
   multiple lines. Unfortunately this can only be done in a truly horrible
   way, as far as I can tell. But since the alternative is to implement our
   own line editor (which I don't think LLVM should be in the business of
   doing, at least for now) I think it may be acceptable.

 - Includes a fallback for the case where the user doesn't have libedit
   installed.

Note that this uses C stdio, mainly because libedit also uses C stdio.

Differential Revision: http://llvm-reviews.chandlerc.com/D2200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 23:46:14 +00:00
Chandler Carruth
070764ee85 Use a heavier hammer when --enable-libcpp is passed to bypass the tests
which catch buggy versions of libstdc++. While libc++ would pass them,
we don't actually update the state in the configure script to use libc++
when we pass --enable-libcpp, the logic for that is in the
Makefiles. So just completely skip the library test when that configure
flag is passed.

Hopefully this will be enough to fix the darwin bots at last, and thanks
to Duncan Smith for getting things set up so I can watch the bots myself
on lab.llvm.org and see any failures!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199334 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 21:21:48 +00:00
Chandler Carruth
0893113a05 Sink the autoconf check for sufficiently modern host toolchain below the
enable flag that selects the C++ standard library to use with the host
toolchain. Otherwise we end up testing the wrong config.

I'm not really happy about this placement, but its pragmatic and should
unblock the Apple builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199325 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 19:19:13 +00:00
Chandler Carruth
9ac0e23865 Fix a bug in r199313 where I failed to restore CXXFLAGS. Doh! Not
*quite* ready to just slam C++11 on by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 10:34:30 +00:00
Chandler Carruth
9c62b5eabb Add a check to configure that the libstdc++ selected by Clang isn't
libstdc++v4.6. This is quite hard to test directly, so we test for it by
checking a known missing feature in that version that was added in v4.7.

This should prevent users from upgrading Clang but not GCC and hosting
with a too-old GCC's libstdc++ and getting strange and hard to debug
errors when we switch to C++11 by default.

Also, switch several of the macros I introduced to use AC_LANG_SOURCE
rather than AC_LANG_PROGRAM as we don't need configure's help writing
our main function (and we don't need such a function at all for most of
the tests).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199313 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 10:31:15 +00:00
Chandler Carruth
64aabee38e Remove the last weird subproject, 'privbracket'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 05:05:18 +00:00
Chandler Carruth
7ba06ede59 Add checks to configure for sufficiently modern host compilers. This
requires Clang 3.1 or GCC 4.7. If the compiler isn't Clang or GCC, we
don't try to do any sanity checking, but this give us at least
a reasonable baseline of modern compilers.

Also, I'm not claiming that this is the best way to do compiler version
tests. I'm happy for anyone to suggest better ways of doing this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199182 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 05:02:38 +00:00
Chandler Carruth
3f7ae00155 Ok, really, for the last time, llvm-gcc is dead Jim.
Also, so is stacker, llvm-tv, etc. Wow.

But will someone please fess up to what projects/privbracket is and why
our autoconf build supports it?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199179 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 04:01:01 +00:00
Chandler Carruth
5b45789afd llvm-gcc is dead. REALLY. IT'S DEAD JIM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199178 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 03:46:00 +00:00
Eric Christopher
b4857de1c9 Remove the test for endianness in configure.ac and regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198825 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-09 01:09:57 +00:00
NAKAMURA Takumi
0cc6c9b3d9 Update the copyright credits -- Happy new year 2014!
FIXME: Dragonegg may be updated at non-trivial changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198274 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-01 08:27:31 +00:00
Bill Wendling
85f3f61418 Update to reflect the next release.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195235 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20 10:10:50 +00:00
NAKAMURA Takumi
85dfb8d948 [autoconf] Prune "runtime" stuff in configure, corresponding to r191835.
config.status: executing runtime/Makefile commands
  autoconf/install-sh: runtime/Makefile does not exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194376 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 13:53:52 +00:00
Bill Wendling
d36e6444aa Update so that it uses the `-V' command line option and supports Python 3.x.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192527 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 08:42:59 +00:00
David Majnemer
6a971bb8f5 Revert "Revert "Windows: Add support for unicode command lines""
This reverts commit r192070 which reverted r192069, I forgot to
regenerate the configure scripts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192079 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 01:00:07 +00:00
David Majnemer
b262556c45 Revert "Windows: Add support for unicode command lines"
This is causing MinGW bots to fail.
This reverts commit r192069.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192070 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 20:44:34 +00:00
David Majnemer
5a1a1856a4 Windows: Add support for unicode command lines
Summary:
The MSVCRT deliberately sends main() code-page specific characters.
This isn't too useful to LLVM as we end up converting the arguments to
UTF-16 and subsequently attempt to use the result as, for example, a
file name.  Instead, we need to have the ability to access the Unicode
command line and transform it to UTF-8.

This has the distinct advantage over using the MSVC-specific wmain()
function as our entry point because:
 - It doesn't work on cygwin.
 - It only work on MinGW with caveats and only then on certain versions.
 - We get to keep our entry point as main(). :)

N.B.  This patch includes fixes to other parts of lib/Support/Windows
s.t. we would be able to take advantage of getting the Unicode paths.
E.G.  clang spawning clang -cc1 would want to give it Unicode arguments.

Reviewers: aaron.ballman, Bigcheese, rnk, ruiu

Reviewed By: rnk

CC: llvm-commits, ygao

Differential Revision: http://llvm-reviews.chandlerc.com/D1834

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192069 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 20:25:49 +00:00
Patrik Hagglund
d4bf7a3853 Remove error output from configure if CFLAGS is set (r174313).
This fixes PR16724.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191289 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 11:38:45 +00:00
Patrik Hagglund
6f74b140c4 Fix for executing AutoRegen.sh. Revert a part of r187209.
Since r187209, which modified ltdl.m4, I was unable to execute
AutoRegen.sh, getting:

  ../configure:10779: error: possibly undefined macro: AC_LTDL_FUNC_ARGZ

This commit re-adds AC_LTDL_FUNC_ARGZ to ltdl.m4, as a quick fix. For me, this
corresponds to the configure file currently checked in.

(However, the ltdl library seems to be unused since r74924 in 2009,
except for the use of the LTDL_SHLIB_EXT macro in
bugpoint(?). Therefore, the right solution seems to try to get rid of
the local ltdl.m4 file, specified by autoconf/README.TXT.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190677 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 10:29:42 +00:00
Daniel Dunbar
e179b31bfc [conf] Add config variable to disable crash related overrides.
- We do some nasty things w.r.t. installing or overriding signal handlers in
   order to improve our crash recovery support or interaction with crash
   reporting software, and those things are not necessarily appropriate when
   LLVM is being linked into a client application that has its own ideas about
   how to do things. This gives those clients a way to disable that handling at
   build time.

 - Currently, the code this guards is all Apple specific, but other platforms
   might have the same concerns so I went for a more generic configure
   name. Someone who is more familiar with library embedding on Windows can
   handle choosing which of the Windows/Signals.inc behaviors might make sense
   to go under this flag.

 - This also fixes the proper autoconf'ing of ENABLE_BACKTRACES. The code
   expects it to be undefined when disabled, but the autoconf check was just
   defining it to 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189694 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 20:39:21 +00:00
Jordan Rose
3e7f1a9901 Autoconf: The Clang ARC migrator now depends on the static analyzer.
I don't actually have a version of autoconf so I edited configure directly
as well. It's copy-pasted so I think there was little margin for error.

See also Clang-side dependency graph changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 15:49:53 +00:00
Joerg Sonnenberger
a915b410df Recognize NetBSD's terminfo implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188606 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-17 11:06:00 +00:00
Chandler Carruth
3729d7d62b Remove all checking for the various terminfo headers (term.h and
curses.h). Finding these headers is next to impossible. For example, on
Debian systems libtinfo-dev provides the terminfo reading library we
want, but *not* term.h. For the header, you have to use libncurses-dev.
And libncursesw-dev provides a *different* term.h in a different
location!

These headers aren't worth it. We want two functions the signatures of
which are clearly spec'ed in sys-v and other documentation. Just declare
them ourselves and call them. This should fix some debian builders and
provide better support for "minimal" debian systems that do want color
autodetection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188165 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 10:40:11 +00:00
Chandler Carruth
8d8bdff6d7 Target a minimal terminfo library rather than necessarily a full curses
library for color support detection. This still will use a curses
library if that is all we have available on the system. This change
tries to use a smaller subset of the curses library, specifically the
subset that is on some systems split off into a separate library. For
example, if you install ncurses configured --with-tinfo, a 'libtinfo' is
install that provides just the terminfo querying functionality. That
library is now used instead of curses when it is available.

This happens to fix a build error on systems with that library because
when we tried to link ncurses into the binary, we didn't pull tinfo in
as well. =]

It should also provide an easy path for supporting the NetBSD
libterminfo library, but as I don't have access to a NetBSD system I'm
leaving adding that support to those folks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 09:49:17 +00:00
Chandler Carruth
f7364d5833 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
2013-08-07 08:47:36 +00:00