4 conf
.CHECK_HEADERS('readline.h history.h readline/readline.h readline/history.h')
5 for termlib
in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
6 if conf
.CHECK_FUNCS_IN('tgetent', termlib
):
7 conf
.env
['READLINE_TERMLIB'] = termlib
11 # Check if we need to work around readline/readline.h
12 # deprecated declarations
14 if conf
.CONFIG_SET('HAVE_READLINE_READLINE_H'):
15 if not conf
.CHECK_CODE('''
16 #include <readline/readline.h>
17 int main() {return 0;}
19 define
='HAVE_WORKING_READLINE_READLINE_WITH_STRICT_PROTO',
20 cflags
=conf
.env
['WERROR_CFLAGS'] +
21 ['-Wstrict-prototypes',
22 '-Werror=strict-prototypes'],
23 msg
='for compiling <readline/readline.h> with strict prototypes',
27 #include <readline/readline.h>
28 int main() {return 0;}
30 cflags
=conf
.env
['WERROR_CFLAGS'] +
31 ['-Wstrict-prototypes',
32 '-Werror=strict-prototypes'],
33 msg
='for workaround to <readline/readline.h> strict prototypes issue',
34 define
='HAVE_READLINE_READLINE_WORKAROUND',
38 #ifdef HAVE_READLINE_READLINE_H
39 # ifdef HAVE_READLINE_READLINE_WORKAROUND
40 # define _FUNCTION_DEF
42 # include <readline/readline.h>
43 # ifdef HAVE_READLINE_HISTORY_H
44 # include <readline/history.h>
47 # ifdef HAVE_READLINE_H
48 # include <readline.h>
49 # ifdef HAVE_HISTORY_H
54 int main(void) {rl_completion_t f; return 0;}
56 'HAVE_RL_COMPLETION_FUNC_T', execute
=False, addmain
=False,
57 msg
='Checking for rl_completion_t')
60 #ifdef HAVE_READLINE_READLINE_H
61 # ifdef HAVE_READLINE_READLINE_WORKAROUND
62 # define _FUNCTION_DEF
64 # include <readline/readline.h>
65 # ifdef HAVE_READLINE_HISTORY_H
66 # include <readline/history.h>
69 # ifdef HAVE_READLINE_H
70 # include <readline.h>
71 # ifdef HAVE_HISTORY_H
76 int main(void) {CPPFunction f; return 0;}
78 'HAVE_CPPFUNCTION', execute
=False, addmain
=False,
79 msg
='Checking for CPPFunction')
81 if conf
.CHECK_FUNCS_IN('rl_completion_matches', 'readline'):
82 conf
.DEFINE('HAVE_NEW_LIBREADLINE', 1)
84 if conf
.CHECK_FUNCS_IN('history_list', 'readline'):
85 conf
.DEFINE('HAVE_HISTORY_LIST', 1)