Dear all, söndag den 19 februari 2012 klockan 21:42 skrev Mats Erik Andersson detta: > söndag den 19 februari 2012 klockan 19:24 skrev Simon Josefsson detta: > > Mats Erik Andersson <[email protected]> writes: > > > > > What I would like to see is an FTP client that compiles against > > > "libreadline/libedit", should either be available, and otherwise > > > the client should fall back to the rudimental editing capabilities > > > provided by said Gnulib module. What circumstances are speaking > > > against this remedy? > > > > I don't know -- I think that approach seems like the right one.
The patch set reproduced below, is able to use the update to "gnulib/m4/readline.m4" which I proposed on "[email protected]" two days ago. The outcome is GNU Inetutils source that is able to build our FTP client with native readline support, or Gnulib fall-back readline support, on Debian 6.0 Squeeze, OpenBSD 4.6, and NetBSD 5.1. Without update to the Gnulib module, NetBSD can never be targeted. Due to the fact that "bootstrap" is not able to have any local m4 macro file overriding "gnulib/m4/readline.m4", no action on our part can rescue the situation if the module "readline" is to be activated at all. Until "bootstrap" changes, our "am/readline.m4" is dead weight while the module is being invoked. Best regards, Mats diff --git a/bootstrap.conf b/bootstrap.conf index 98a8637..14215dd 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -73,6 +73,7 @@ obstack poll progname read-file +readline readutmp realloc-gnu regex diff --git a/configure.ac b/configure.ac index 017d0ac..1fa67ba 100644 --- a/configure.ac +++ b/configure.ac @@ -148,14 +148,6 @@ AC_CHECK_LIB(socket, getpeername) # See if a termcap library is available (under one of several names) IU_LIB_TERMCAP -# Find libreadline -- disable the ftp client if not found. -gl_FUNC_READLINE -if test "$gl_cv_lib_readline" = no; then - enable_ftp=no - ftp_BUILD='' - ftp_INSTALL_HOOK='' -fi - dnl See if there's a separate libcrypt (many systems put crypt there) AC_CHECK_LIB(crypt, crypt, LIBCRYPT=-lcrypt) AC_SUBST(LIBCRYPT) diff --git a/ftp/cmds.c b/ftp/cmds.c index 07a8252..ee2fded 100644 --- a/ftp/cmds.c +++ b/ftp/cmds.c @@ -77,8 +77,11 @@ system headers on some platforms. */ #include <glob.h> -#include <readline/readline.h> -#include <readline/history.h> +#include <readline.h> + +#if defined HAVE_READLINE && defined HAVE_READLINE_HISTORY_H +# include <readline/history.h> +#endif #include "ftp_var.h" #include "unused-parameter.h" @@ -151,8 +154,10 @@ another (int *pargc, char ***pargv, const char *prompt) arg = readline (buffer); free (buffer); +#if defined HAVE_READLINE && defined HAVE_READLINE_HISTORY_H if (fromatty && arg && *arg) add_history (arg); +#endif if (!arg) intr (0); diff --git a/ftp/main.c b/ftp/main.c index 2b6e92a..bba3e48 100644 --- a/ftp/main.c +++ b/ftp/main.c @@ -77,8 +77,11 @@ #include "libinetutils.h" #include "unused-parameter.h" -#include <readline/readline.h> -#include <readline/history.h> +#include <readline.h> + +#if defined HAVE_READLINE && defined HAVE_READLINE_HISTORY_H +# include <readline/history.h> +#endif #define DEFAULT_PROMPT "ftp> " @@ -339,8 +342,10 @@ cmdscanner (int top) break; } +#if defined HAVE_READLINE && defined HAVE_READLINE_HISTORY_H if (fromatty && line && *line) add_history (line); +#endif if (l == 0) break;
