diff options
-rw-r--r-- | lib/replace/system/readline.h | 8 | ||||
-rw-r--r-- | source4/lib/smbreadline/wscript_configure | 38 |
2 files changed, 45 insertions, 1 deletions
diff --git a/lib/replace/system/readline.h b/lib/replace/system/readline.h index ba34dc6a61..e6b8fb9129 100644 --- a/lib/replace/system/readline.h +++ b/lib/replace/system/readline.h @@ -43,7 +43,13 @@ #endif #ifdef HAVE_NEW_LIBREADLINE -# define RL_COMPLETION_CAST (rl_completion_func_t *) +#ifdef HAVE_CPPFUNCTION +# define RL_COMPLETION_CAST (CPPFunction *) +#elif HAVE_RL_COMPLETION_T +# define RL_COMPLETION_CAST (rl_completion_t *) +#else +# define RL_COMPLETION_CAST +#endif #else /* This type is missing from libreadline<4.0 (approximately) */ # define RL_COMPLETION_CAST diff --git a/source4/lib/smbreadline/wscript_configure b/source4/lib/smbreadline/wscript_configure index 76273ddc23..cec6526898 100644 --- a/source4/lib/smbreadline/wscript_configure +++ b/source4/lib/smbreadline/wscript_configure @@ -7,6 +7,44 @@ for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']: conf.env['READLINE_TERMLIB'] = termlib break +conf.CHECK_CODE(''' +#ifdef HAVE_READLINE_READLINE_H +# include <readline/readline.h> +# ifdef HAVE_READLINE_HISTORY_H +# include <readline/history.h> +# endif +#else +# ifdef HAVE_READLINE_H +# include <readline.h> +# ifdef HAVE_HISTORY_H +# include <history.h> +# endif +# endif +#endif +int main(void) {rl_completion_t f; return 0;} +''', +'HAVE_RL_COMPLETION_FUNC_T', execute=False, addmain=False, +msg='Checking for rl_completion_t') + +conf.CHECK_CODE(''' +#ifdef HAVE_READLINE_READLINE_H +# include <readline/readline.h> +# ifdef HAVE_READLINE_HISTORY_H +# include <readline/history.h> +# endif +#else +# ifdef HAVE_READLINE_H +# include <readline.h> +# ifdef HAVE_HISTORY_H +# include <history.h> +# endif +# endif +#endif +int main(void) {CPPFunction f; return 0;} +''', +'HAVE_CPPFUNCTION', execute=False, addmain=False, +msg='Checking for CPPFunction') + if conf.CHECK_FUNCS_IN('rl_completion_matches', 'readline'): conf.DEFINE('HAVE_NEW_LIBREADLINE', 1) |