summaryrefslogtreecommitdiff
path: root/libcli/smbreadline/wscript_configure
blob: cec652689837901215f47ee7ca4d30b666e01dd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python


conf.CHECK_HEADERS('readline.h history.h readline/readline.h readline/history.h')
for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
    if conf.CHECK_FUNCS_IN('tgetent', termlib):
        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)

if conf.CHECK_FUNCS_IN('rl_event_hook', 'readline'):
    conf.DEFINE('HAVE_HISTORY_LIST', 1)