diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 2ca87677..b498c021 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2005-05-06 Kolja Waschk + + * acinclude.m4, src/cmd/cmd.c, src/jtag.c: + Update for [ 1940323 ] OS X support for UrJTAG (by Ville Voipio) + 2008-05-05 Mike Frysinger * src/svf/svf.c: Fix __MINGW32__ typo. diff --git a/jtag/acinclude.m4 b/jtag/acinclude.m4 index 30065b09..0960653f 100644 --- a/jtag/acinclude.m4 +++ b/jtag/acinclude.m4 @@ -45,7 +45,8 @@ dnl dnl dnl @version 1.1 dnl @author Ville Laurikari -dnl +dnl @author Ville Voipio ; check for readline completion (not available in, e.g. Leopard) + AC_DEFUN([VL_LIB_READLINE], [ AC_CACHE_CHECK([for a readline compatible library], vl_cv_lib_readline, [ @@ -78,16 +79,23 @@ AC_DEFUN([VL_LIB_READLINE], [ [Define if you have a readline compatible library]) AC_CHECK_HEADERS(readline.h readline/readline.h) AC_CACHE_CHECK([whether readline supports history], - vl_cv_lib_readline_history, [ - vl_cv_lib_readline_history="no" - AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes") - ]) + vl_cv_lib_readline_history, + [vl_cv_lib_readline_history="no" + AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")]) if test "$vl_cv_lib_readline_history" = "yes"; then - AC_DEFINE(HAVE_READLINE_HISTORY, 1, - [Define if your readline library has \`add_history']) + AC_DEFINE(HAVE_READLINE_HISTORY, 1, [Define if your readline library has \`add_history']) AC_CHECK_HEADERS(history.h readline/history.h) fi + + AC_CACHE_CHECK([whether readline supports completion], + vl_cv_lib_readline_completion, + [vl_cv_lib_readline_completion="no" + AC_TRY_LINK_FUNC(rl_completion_matches, vl_cv_lib_readline_completion="yes")]) + if test "$vl_cv_lib_readline_completion" = "yes"; then + AC_DEFINE(HAVE_READLINE_COMPLETION, 1, [Define if your readline library has \`rl_completion_matches']) + fi fi + ])dnl # ACI_PROG_SED diff --git a/jtag/src/cmd/cmd.c b/jtag/src/cmd/cmd.c index 93d6968c..13b857a1 100644 --- a/jtag/src/cmd/cmd.c +++ b/jtag/src/cmd/cmd.c @@ -141,6 +141,7 @@ cmd_find_next( const char *text, int state ) return NULL; } +#ifdef HAVE_READLINE_COMPLETION char ** cmd_completion( const char *text, int start, int end ) { @@ -152,6 +153,7 @@ cmd_completion( const char *text, int start, int end ) return ret; } #endif +#endif int cmd_test_cable( chain_t *chain ) diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index b5adbc73..d6368afe 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -463,7 +463,9 @@ main( int argc, char *const argv[] ) go = norc ? 1 : jtag_parse_rc( chain ); #ifdef HAVE_LIBREADLINE +#ifdef HAVE_READLINE_COMPLETION rl_attempted_completion_function = cmd_completion; +#endif #endif if (go) {