275 |
AC_REPLACE_FUNCS(getline strerror strncasecmp strcspn snprintf vasprintf\ |
AC_REPLACE_FUNCS(getline strerror strncasecmp strcspn snprintf vasprintf\ |
276 |
strtok_r localtime_r strchrnul strndup strnlen) |
strtok_r localtime_r strchrnul strndup strnlen) |
277 |
|
|
278 |
|
AC_ARG_WITH([readline], |
279 |
|
AC_HELP_STRING([--without-readline], |
280 |
|
[do not use readline]), |
281 |
|
[ |
282 |
|
case "${withval}" in |
283 |
|
yes) usereadline=yes ;; |
284 |
|
no) usereadline=no ;; |
285 |
|
*) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;; |
286 |
|
esac],[usereadline=yes]) |
287 |
|
|
288 |
|
dnl Check for GNU Readline |
289 |
|
AC_SUBST(READLINE_LIBS) |
290 |
|
|
291 |
|
if test x"$usereadline" = x"yes"; then |
292 |
|
|
293 |
|
dnl FIXME This should only link in the curses libraries if it's |
294 |
|
dnl really needed! |
295 |
|
|
296 |
|
dnl Check for Curses libs. |
297 |
|
CURSES_LIBS= |
298 |
|
for lib in ncurses curses termcap |
299 |
|
do |
300 |
|
AC_CHECK_LIB($lib, tputs, [CURSES_LIBS="-l$lib"; break]) |
301 |
|
done |
302 |
|
|
303 |
|
saved_LIBS=$LIBS |
304 |
|
LIBS="$LIBS $CURSES_LIBS" |
305 |
|
AC_CHECK_LIB(readline, readline, ra_have_readline=yes) |
306 |
|
LIBS=$saved_LIBS |
307 |
|
|
308 |
|
if test x"$ra_have_readline" = x"yes"; then |
309 |
|
AC_CHECK_HEADERS(readline/readline.h, |
310 |
|
AC_DEFINE(WITH_READLINE,1,[Enable use of readline])) |
311 |
|
READLINE_LIBS="-lreadline $CURSES_LIBS" |
312 |
|
saved_LIBS=$LIBS |
313 |
|
LIBS="$LIBS $READLINE_LIBS" |
314 |
|
AC_CHECK_FUNCS(rl_completion_matches) |
315 |
|
LIBS=$saved_LIBS |
316 |
|
else |
317 |
|
AC_MSG_WARN(readline requested but does not seem to be installed) |
318 |
|
fi |
319 |
|
|
320 |
|
fi |
321 |
|
AH_BOTTOM([ |
322 |
|
/* Newer versions of readline have rl_completion_matches */ |
323 |
|
#ifndef HAVE_RL_COMPLETION_MATCHES |
324 |
|
# define rl_completion_matches completion_matches |
325 |
|
#endif]) |
326 |
|
|
327 |
RA_CHECK_STRUCT_FIELD(hostent, h_addr_list, |
RA_CHECK_STRUCT_FIELD(hostent, h_addr_list, |
328 |
[#include <netdb.h>]) |
[#include <netdb.h>]) |
329 |
RA_REPLACE_GNU_GETOPT |
RA_REPLACE_GNU_GETOPT |