- some platforms need -ltermcap to go with -lreadline

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@246 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2002-02-26 21:15:18 +00:00
parent f0cba186a9
commit 78d9c2060b
1 changed files with 14 additions and 2 deletions

View File

@ -315,9 +315,21 @@ AC_SUBST(LIBDL)
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
AC_SUBST(LIBREADLINE)
AC_CHECK_LIB(readline, readline, [LIBREADLINE="$LIBREADLINE -lreadline" ac_cv_func_readline_lreadline=yes], ac_cv_func_readline_lreadline=no)
# libreadline will also need libtermcap on some OSes
saved_LIBS="$LIBS"
for add in "" "-ltermcap"; do
if test "X$add" != "X"; then
AC_MSG_CHECKING([whether -lreadline requires $add])
fi
LIBS="$saved_LIBS $add"
unset ac_cv_lib_readline_readline
AC_CHECK_LIB(readline, readline, [
LIBREADLINE="-lreadline $add"
ac_cv_func_readline_lreadline=yes
], ac_cv_func_readline_lreadline=no)
test "$ac_cv_func_readline_lreadline" = yes && break
done
LIBS="$LIBS $LIBREADLINE"
AC_CHECK_FUNCS(readline)
LIBS="$saved_LIBS"