File: readline.m4

package info (click to toggle)
fityk 0.4.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,472 kB
  • ctags: 2,617
  • sloc: cpp: 19,705; sh: 5,965; xml: 2,325; yacc: 356; makefile: 183; lex: 178
file content (47 lines) | stat: -rw-r--r-- 1,746 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47

AC_DEFUN(READLINE_STUFF, 
[
 dnl GNU readline and the required terminal library check
 AC_SUBST(READLINE_LIBS)
 AC_SUBST(NO_READLINE)
 if test "x$with_readline" != "xno" ; then
     dnl check for terminal library
     dnl this is a very cool solution from octave's configure.in
     gp_tcap=""
     for termlib in ncurses curses termcap terminfo termlib; do
         AC_CHECK_LIB(${termlib}, tputs, [gp_tcap="${gp_tcap} -l${termlib}"])
         case "${gp_tcap}" in
             *-l${termlib}*)
             AC_MSG_RESULT([using ${gp_tcap} with readline])
             break
             ;;
         esac
     done
 
     if test "x$with_readline" = "xyes"; then
         AC_CHECK_LIB(readline, readline, READLINE_LIBS="-lreadline $gp_tcap",
                      AC_MSG_ERROR([Can't find -lreadline in a standard path -- specify its location using --with-readline=/path/to/libreadline.a]), 
 		     ${gp_tcap}) dnl readline
     else
       if test ! -f $with_readline ; then
         if test ! -f ${with_readline}/lib/libreadline.a ; then
           if test ! -f ${with_readline}/libreadline.a ; then
             AC_MSG_ERROR([GNU readline library not found])
           else
             AC_MSG_RESULT([using ${with_readline}/libreadline.a])
             READLINE_LIBS="${with_readline}/libreadline.a $gp_tcap"
           fi
         else
           AC_MSG_RESULT([using ${with_readline}/lib/libreadline.a])
           READLINE_LIBS="${with_readline}/lib/libreadline.a $gp_tcap"
         fi
       else
         AC_MSG_RESULT([using ${with_readline}])
         READLINE_LIBS="$with_readline $gp_tcap"
       fi
     fi
 else
     AC_DEFINE(NO_READLINE, 1,
        [Define if you do not want to use or do not have readline library.])
 fi
])