diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-08-12 09:49:17 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-08-12 09:49:17 +0000 |
commit | 8d8bdff6d7eccb05bf16e18141263ee72ea8296b (patch) | |
tree | 6433ea896c6e1bf5d2996bb770920fb1cd9d1682 /autoconf | |
parent | 6a4e44f0de6e59d4458e3795c765a9001ba1b87f (diff) | |
download | external_llvm-8d8bdff6d7eccb05bf16e18141263ee72ea8296b.zip external_llvm-8d8bdff6d7eccb05bf16e18141263ee72ea8296b.tar.gz external_llvm-8d8bdff6d7eccb05bf16e18141263ee72ea8296b.tar.bz2 |
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
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 30481ea..127eb6f 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1072,16 +1072,16 @@ AC_ARG_WITH(bug-report-url, AC_DEFINE_UNQUOTED(BUG_REPORT_URL,"$withval", [Bug report URL.]) -dnl --enable-curses: check whether the user wants to control use of curses: -AC_ARG_ENABLE(curses,AS_HELP_STRING( - [--enable-curses], - [Use curses for querying terminal infomation if available (default is YES)]), +dnl --enable-terminfo: check whether the user wants to control use of terminfo: +AC_ARG_ENABLE(terminfo,AS_HELP_STRING( + [--enable-terminfo], + [Query the terminfo database if available (default is YES)]), [case "$enableval" in - yes) llvm_cv_enable_curses="yes" ;; - no) llvm_cv_enable_curses="no" ;; - *) AC_MSG_ERROR([Invalid setting for --enable-curses. Use "yes" or "no"]) ;; + yes) llvm_cv_enable_terminfo="yes" ;; + no) llvm_cv_enable_terminfo="no" ;; + *) AC_MSG_ERROR([Invalid setting for --enable-terminfo. Use "yes" or "no"]) ;; esac], - llvm_cv_enable_curses="yes") + llvm_cv_enable_terminfo="yes") dnl --enable-libffi : check whether the user wants to turn off libffi: AC_ARG_ENABLE(libffi,AS_HELP_STRING( @@ -1390,11 +1390,11 @@ dnl right libraries to link with. AC_SEARCH_LIBS(clock_gettime,rt) dnl The curses library is optional; used for querying terminal info -if test "$llvm_cv_enable_curses" = "yes" ; then +if test "$llvm_cv_enable_terminfo" = "yes" ; then dnl We need the has_color functionality in curses for it to be useful. - AC_SEARCH_LIBS(has_colors,curses ncurses ncursesw, - AC_DEFINE([HAVE_CURSES],[1], - [Define if curses provides the has_color() function on this platform.])) + AC_SEARCH_LIBS(setupterm,tinfo curses ncurses ncursesw, + AC_DEFINE([HAVE_TERMINFO],[1], + [Define if the setupterm() function is supported this platform.])) fi dnl libffi is optional; used to call external functions from the interpreter @@ -1574,8 +1574,8 @@ else fi dnl Try to find a suitable curses header. -if test "$llvm_cv_enable_curses" = "yes" ; then - AC_CHECK_HEADERS([curses.h ncurses.h ncursesw.h ncurses/curses.h ncursesw/curses.h]) +if test "$llvm_cv_enable_terminfo" = "yes" ; then + AC_CHECK_HEADERS([term.h curses.h ncurses.h ncursesw.h ncurses/curses.h ncursesw/curses.h]) fi dnl Try to find ffi.h. |