[Rstplib-users] FW: [bzeeb+zebra@zabbadoz.net: [zebra 11865] [PATCH] updates libreadline support in
Status: Alpha
Brought to you by:
ralex
From: <al...@nb...> - 2002-01-15 15:13:34
|
It seems, that *readline* versions compatibility problem is a well known one :( ----- Forwarded message from "Bjoern A. Zeeb" <bze...@za...> ----- Date: Sat, 12 Jan 2002 19:23:27 +0100 (CET) From: "Bjoern A. Zeeb" <bze...@za...> X-Sender: <bz...@no...> To: Zebra ML <ze...@ze...> cc: Kunihiro Ishiguro <kun...@ze...> Reply-To: ze...@ze... Precedence: bulk X-Distribute: distribute [version 2.1 (Alpha1) patchlevel=26] X-Sequence: zebra 11865 Subject: [zebra 11865] [PATCH] updates libreadline support in vtysh, small bug in bgp_vty.c Errors-To: own...@ze... Hi, attached patches fixes: o small bug in bgp_vty.c introduced this afternoon in CVS tree o libreadline support in vtysh seems there were some api changes there. make configure recognize which one is on the system (FreeBSD 4.4-STABLE only supprts the old one :( ) please run autotools after applying -- Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT 56 69 73 69 74 http://www.zabbadoz.net/ Content-Description: zebra-cvs-20020112-003-bgp_vty.c-20020112-01.diff --- zebra-cvs-20020112-003/bgpd/bgp_vty.c.orig Sat Jan 12 19:07:28 2002 +++ zebra-cvs-20020112-003/bgpd/bgp_vty.c Sat Jan 12 19:07:43 2002 @@ -8530,7 +8530,7 @@ install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_cmd); #ifdef HAVE_IPV6 install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd); - install_element (bgpm, ENABLE_NODE, &clear_bgp_instance_all_soft_cmd); + install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_cmd); install_element (ENABLE_NODE, &clear_bgp_external_soft_cmd); Content-Description: zebra-cvs-20020112-001-readline-fixes-20020112-02.diff --- zebra-cvs-20020112-001.vanilla/./vtysh/vtysh.c Mon Aug 20 08:35:35 2001 +++ zebra-cvs-20020112-001/./vtysh/vtysh.c Sat Jan 12 17:06:44 2002 @@ -728,7 +728,12 @@ { char **matches; +#ifdef OLD_LIBREADLINE matches = completion_matches (text, command_generator); +#else + matches = rl_completion_matches(text, + (rl_compentry_func_t *)command_generator); +#endif if (matches) { @@ -1580,7 +1585,12 @@ { /* readline related settings. */ rl_bind_key ('?', vtysh_rl_describe); +#ifdef OLD_LIBREADLINE rl_completion_entry_function = vtysh_completion_entry_fucntion; +#else + rl_completion_entry_function = + (rl_compentry_func_t *)vtysh_completion_entry_fucntion; +#endif rl_attempted_completion_function = (CPPFunction *)new_completion; /* do not append space after completion. It will be appended in new_completion() function explicitly */ --- zebra-cvs-20020112-001.vanilla/./acconfig.h Thu Aug 30 09:04:12 2001 +++ zebra-cvs-20020112-001/./acconfig.h Sat Jan 12 17:07:23 2002 @@ -100,6 +100,9 @@ /* Define if one-vty option is specified. */ #undef VTYSH +/* Define if we only find old libreadline */ +#undef OLD_LIBREADLINE + /* Define if interface aliases don't have distinct indeces */ #undef HAVE_BROKEN_ALIASES --- zebra-cvs-20020112-001.vanilla/configure.in Tue Oct 23 10:43:55 2001 +++ zebra-cvs-20020112-001/configure.in Sat Jan 12 18:17:02 2002 @@ -200,9 +200,20 @@ AC_CHECK_LIB(readline, main) if test $ac_cv_lib_readline_main = no; then AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.]) + else + AC_CHECK_LIB(readline, rl_completion_matches) + if test $ac_cv_lib_readline_rl_completion_matches = no; then + AC_CHECK_LIB(readline, completion_matches) + if test $ac_cv_lib_readline_completion_matches = no; then + AC_MSG_ERROR([vtysh needs libreadline but no supported version was found on your system.]) + else + AC_DEFINE(OLD_LIBREADLINE) + AC_MSG_WARN([your libreadline is old. please contact your vendor for updates.]) + fi + fi fi AC_CHECK_HEADER(readline/history.h) - if test $ac_cv_header_readline_history_h = no;then + if test $ac_cv_header_readline_history_h = no; then AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.]) fi ;; ----- End forwarded message ----- |