"Oskar Liljeblad" <[EMAIL PROTECTED]> writes:
> I don't know if the readline module covers this, but on recent
> Fedora/RedHat systems you'll need to link with ncurses or some
> other library providing certain termcap (or was it terminfo?)
> functions... You don't need to do this with Debian.
This appears to be the case, I have access to one such system, so I
can try M4 magic on it. I have no idea how to solve this without a
lot of code though (i.e., if AC_TRY_LINK fail, try the exact same
AC_TRY_LINK again but with -ltermcap in LIBS too). Relevant current
code below.
Thoughts?
AC_CACHE_CHECK(for readline, gl_cv_lib_readline, [
gl_cv_lib_readline=no
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBREADLINE"
AC_TRY_LINK([#include <stdio.h>
#include <readline/readline.h>],
[readline((char*)0);],
gl_cv_lib_readline=yes)
LIBS="$am_save_LIBS"
])
if test "$gl_cv_lib_readline" = yes; then
AC_DEFINE(HAVE_READLINE, 1, [Define if you have the readline() library.])
fi
if test "$gl_cv_lib_readline" = yes; then
AC_MSG_CHECKING([how to link with libreadline])
AC_MSG_RESULT([$LIBREADLINE])
else
dnl If $LIBREADLINE didn't lead to a usable library, we don't need
$INCREADLINE
dnl either.
CPPFLAGS="$am_save_CPPFLAGS"
LIBREADLINE=
LTLIBREADLINE=
fi
AC_SUBST(LIBREADLINE)
AC_SUBST(LTLIBREADLINE)
AC_CHECK_HEADERS(readline/readline.h)
if test $gl_cv_lib_readline = no; then
AC_LIBOBJ(readline)
gl_PREREQ_READLINE
fi
_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib