|
1 |
| -# $Header: /cvsroot/pgsql/config/programs.m4,v 1.2 2000/10/26 16:28:00 petere Exp $ |
| 1 | +# $Header: /cvsroot/pgsql/config/programs.m4,v 1.3 2001/02/06 19:20:16 petere Exp $ |
2 | 2 |
|
3 | 3 |
|
4 | 4 | # PGAC_PATH_FLEX
|
|
70 | 70 | AC_SUBST(FLEX)
|
71 | 71 | AC_SUBST(FLEXFLAGS)
|
72 | 72 | ])# PGAC_PATH_FLEX
|
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +# PGAC_CHECK_READLINE |
| 77 | +# ------------------- |
| 78 | +# Check for the readline library and dependent libraries, either |
| 79 | +# termcap or curses. Also try libedit, since NetBSD's is compatible. |
| 80 | +# Add the required flags to LIBS, define HAVE_LIBREADLINE. |
| 81 | + |
| 82 | +AC_DEFUN([PGAC_CHECK_READLINE], |
| 83 | +[AC_MSG_CHECKING([for readline]) |
| 84 | +
|
| 85 | +AC_CACHE_VAL([pgac_cv_check_readline], |
| 86 | +[pgac_cv_check_readline=no |
| 87 | +for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do |
| 88 | + for pgac_rllib in -lreadline -ledit ; do |
| 89 | + pgac_save_LIBS=$LIBS |
| 90 | + LIBS="${pgac_rllib}${pgac_lib} $LIBS" |
| 91 | +AC_TRY_LINK_FUNC([readline],[pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"; break 2]) |
| 92 | + LIBS=$pgac_save_LIBS |
| 93 | + done |
| 94 | +done |
| 95 | +LIBS=$pgac_save_LIBS |
| 96 | +])[]dnl AC_CACHE_VAL |
| 97 | +
|
| 98 | +if test "$pgac_cv_check_readline" != no ; then |
| 99 | +AC_DEFINE(HAVE_LIBREADLINE) |
| 100 | + LIBS="$pgac_cv_check_readline $LIBS" |
| 101 | +AC_MSG_RESULT([yes ($pgac_cv_check_readline)]) |
| 102 | +else |
| 103 | +AC_MSG_RESULT(no) |
| 104 | +fi])# PGAC_CHECK_READLINE |