client: Rewrite readline configuration

AX_LIB_READLINE tries to cope with systems where readline lacks
history support, or lacks headers, or needs headers included in
unorthodox ways.  It puts six HAVE_ macros into config.h, and its
usage example takes 24 lines of code just to include two headers.

Way too complicated for my taste.  Replace with new MY_LIB_READLINE,
which succeeds only when you have a sane readline, and then defines
*one* macro: HAVE_LIBREADLINE.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2015-12-07 21:27:42 +01:00
parent 60fee0e6ae
commit 1cbda2c7dd
7 changed files with 35 additions and 140 deletions

View file

@ -75,9 +75,9 @@ print_usage(char *program_name)
" -r Restricted mode, no redirections\n"
" -s [HOST:]PORT Specify server HOST and PORT\n"
" -u Use UTF-8\n"
#ifdef HAVE_READLINE_HISTORY
#ifdef HAVE_LIBREADLINE
" -H Save readline command history to file\n"
#endif /* HAVE_READLINE_HISTORY */
#endif /* HAVE_LIBREADLINE */
" -h display this help and exit\n"
" -v display version information and exit\n",
program_name);
@ -107,11 +107,11 @@ main(int argc, char **argv)
case '2':
auxfname = optarg;
break;
#ifdef HAVE_READLINE_HISTORY
#ifdef HAVE_LIBREADLINE
case 'H':
use_history_file = 1;
break;
#endif /* HAVE_READLINE_HISTORY */
#endif /* HAVE_LIBREADLINE */
case 'k':
send_kill = 1;
break;