File: acinclude.m4

package info (click to toggle)
nickle 2.47-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,112 kB
  • ctags: 3,255
  • sloc: ansic: 30,401; yacc: 1,843; sh: 865; lex: 838; makefile: 202
file content (38 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
dnl Check for readline and get termcap lib as well
AC_DEFUN([AC_LIB_READLINE],[
  doit=yes
  AC_ARG_WITH(readline,
  [  --with-readline=DIR     GNU readline library in DIR],
  doit=$with_readline)
  case $doit in
  no)
    ;;
  *)
    readline_header="readline"
    readline_libdir=""
    case $doit in
    yes)
      ;;
    *)
      readline_libdir="-L$doit/lib -R$doit/lib"
      readline_incdir="-I$doit/include"
      ;;
    esac
    AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
      AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
    saved_LIBS="$LIBS"
    LIBS="$LIBS $TERMLIB"
    saved_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $readline_libdir"
    saved_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $readline_incdir"
    AC_CHECK_LIB(readline,readline,
      [ AC_CHECK_HEADER(readline/readline.h,
          LIBS="$saved_LIBS -lreadline $TERMLIB"
          AC_DEFINE(HAVE_LIBREADLINE,1,
            [support fancy command line editing])) ],
      [ AC_MSG_RESULT([Cannot find readline.  Build with --without-readline or set the readline path appropriately.])
        exit 1 ])
      ;;
  esac
])