Mats Erik Andersson <[email protected]> writes: > diff --git a/am/readline.m4 b/am/readline.m4 > index b7ce9e4..354ab4d 100644 > --- a/am/readline.m4 > +++ b/am/readline.m4 > @@ -53,6 +53,21 @@ AC_DEFUN([gl_FUNC_READLINE], > LIBS="$am_save_LIBS" > ]) > > + dnl In case of failure, examine whether libedit can act > + dnl as replacement. Small NetBSD systems use editline > + dnl as wrapper for readline. > + if test "$gl_cv_lib_readline" = no; then > + am_save_LIBS="$LIBS" > + LIBREADLINE=-ledit > + LTLIBREADLINE=-ledit > + LIBS="$am_save_LIBS $LIBREADLINE" > + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> > +#include <readline/readline.h>]], > + [[readline((char*)0);]])], > + [gl_cv_lib_readline="yes"]) > + LIBS="$am_save_LIBS" > + fi > + > if test "$gl_cv_lib_readline" != no; then > AC_DEFINE([HAVE_READLINE], [1], [Define if you have the readline > library.]) > extra_lib=`echo "$gl_cv_lib_readline" | sed -n -e 's/yes, requires //p'`
This looks fine. I'm not sure it makes sense for gnulib though, but we could keep this as a separate InetUtils file. > +dnl Where is tgetent(3) declared? > +AC_MSG_CHECKING(tgetent in -lcurses) > +save_LIBS="$LIBS" > +LIBS="$save_LIBS -lcurses" > +AC_TRY_LINK([#include <curses.h> Maybe AC_LIB_HAVE_LINKFLAGS would have been simpler here? What about testing for ncurses? I understand from the readline.m4 comments that -lcurses is not working reliable on some systems, whereas -lncurses might. I'm not certain about this though, and I know next to nothing about curses vs ncurses vs termcap (and honestly, I don't want to know a lot more either :-)). > -#ifdef HAVE_READLINE > +#if defined HAVE_TGETENT_CURSES > # include <curses.h> > # include <term.h> > +#elif defined HAVE_TGETENT_TERMCAP > +# include <termcap.h> > #endif This seems great, the abuse of HAVE_READLINE for curses stuff has annoyed me. /Simon
