Import GNU Readline 8.1
[deliverable/binutils-gdb.git] / readline / readline / examples / autoconf / BASH_CHECK_LIB_TERMCAP
1 AC_DEFUN([BASH_CHECK_LIB_TERMCAP],
2 [
3 if test "X$bash_cv_termcap_lib" = "X"; then
4 _bash_needmsg=yes
5 else
6 AC_MSG_CHECKING(which library has the termcap functions)
7 _bash_needmsg=
8 fi
9 AC_CACHE_VAL(bash_cv_termcap_lib,
10 [AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc,
11 [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
12 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
13 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
14 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
15 [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw,
16 bash_cv_termcap_lib=gnutermcap)])])])])])])
17 if test "X$_bash_needmsg" = "Xyes"; then
18 AC_MSG_CHECKING(which library has the termcap functions)
19 fi
20 AC_MSG_RESULT(using $bash_cv_termcap_lib)
21 if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
22 LDFLAGS="$LDFLAGS -L./lib/termcap"
23 TERMCAP_LIB="./lib/termcap/libtermcap.a"
24 TERMCAP_DEP="./lib/termcap/libtermcap.a"
25 elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
26 TERMCAP_LIB=-ltermcap
27 TERMCAP_DEP=
28 elif test $bash_cv_termcap_lib = libtinfo; then
29 TERMCAP_LIB=-ltinfo
30 TERMCAP_DEP=
31 elif test $bash_cv_termcap_lib = libncurses; then
32 TERMCAP_LIB=-lncurses
33 TERMCAP_DEP=
34 elif test $bash_cv_termcap_lib = libc; then
35 TERMCAP_LIB=
36 TERMCAP_DEP=
37 else
38 TERMCAP_LIB=-lcurses
39 TERMCAP_DEP=
40 fi
41 ])
This page took 0.030751 seconds and 4 git commands to generate.