Only use termcap xor [n]curses, depending on what readline needs. Solaris

has problems when linking with both.
This commit is contained in:
Peter Eisentraut 2001-02-06 19:20:16 +00:00
parent 659a1d65c6
commit 5610b6d9cb
3 changed files with 346 additions and 462 deletions

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.2 2000/10/26 16:28:00 petere Exp $ # $Header: /cvsroot/pgsql/config/programs.m4,v 1.3 2001/02/06 19:20:16 petere Exp $
# PGAC_PATH_FLEX # PGAC_PATH_FLEX
@ -70,3 +70,35 @@ fi
AC_SUBST(FLEX) AC_SUBST(FLEX)
AC_SUBST(FLEXFLAGS) AC_SUBST(FLEXFLAGS)
])# PGAC_PATH_FLEX ])# PGAC_PATH_FLEX
# PGAC_CHECK_READLINE
# -------------------
# Check for the readline library and dependent libraries, either
# termcap or curses. Also try libedit, since NetBSD's is compatible.
# Add the required flags to LIBS, define HAVE_LIBREADLINE.
AC_DEFUN([PGAC_CHECK_READLINE],
[AC_MSG_CHECKING([for readline])
AC_CACHE_VAL([pgac_cv_check_readline],
[pgac_cv_check_readline=no
for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
for pgac_rllib in -lreadline -ledit ; do
pgac_save_LIBS=$LIBS
LIBS="${pgac_rllib}${pgac_lib} $LIBS"
AC_TRY_LINK_FUNC([readline], [pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"; break 2])
LIBS=$pgac_save_LIBS
done
done
LIBS=$pgac_save_LIBS
])[]dnl AC_CACHE_VAL
if test "$pgac_cv_check_readline" != no ; then
AC_DEFINE(HAVE_LIBREADLINE)
LIBS="$pgac_cv_check_readline $LIBS"
AC_MSG_RESULT([yes ($pgac_cv_check_readline)])
else
AC_MSG_RESULT(no)
fi])# PGAC_CHECK_READLINE

770
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -654,9 +654,7 @@ fi
## ##
AC_CHECK_LIB(sfio, main) AC_CHECK_LIB(sfio, main)
AC_CHECK_LIB(ncurses, main, [], [AC_CHECK_LIB(curses, main)]) PGAC_CHECK_READLINE
AC_CHECK_LIB(termcap, main)
AC_SEARCH_LIBS(readline, [readline edit], [AC_DEFINE(HAVE_LIBREADLINE)])
AC_SEARCH_LIBS(using_history, history, [AC_DEFINE(HAVE_HISTORY_FUNCTIONS)]) AC_SEARCH_LIBS(using_history, history, [AC_DEFINE(HAVE_HISTORY_FUNCTIONS)])
if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha" if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"