lib:util: Add (PULL|PUSH)_(BE|LE)_I(8|16|32|64) byterarray macros
[samba.git] / libcli / smbreadline / wscript_configure
1 #!/usr/bin/env python
2
3
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
8         break
9
10 #
11 # Check if we need to work around readline/readline.h
12 # deprecated declarations
13 #
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;}
18                     ''',
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',
24                     addmain=False):
25                 conf.CHECK_CODE('''
26                     #define _FUNCTION_DEF
27                     #include <readline/readline.h>
28                     int main() {return 0;}
29                     ''',
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',
35                     addmain=False)
36
37 conf.CHECK_CODE('''
38 #ifdef HAVE_READLINE_READLINE_H
39 #  ifdef HAVE_READLINE_READLINE_WORKAROUND
40 #    define _FUNCTION_DEF
41 #  endif
42 #  include <readline/readline.h>
43 #  ifdef HAVE_READLINE_HISTORY_H
44 #    include <readline/history.h>
45 #  endif
46 #else
47 #  ifdef HAVE_READLINE_H
48 #    include <readline.h>
49 #    ifdef HAVE_HISTORY_H
50 #      include <history.h>
51 #    endif
52 #  endif
53 #endif
54 int main(void) {rl_completion_t f; return 0;}
55 ''',
56 'HAVE_RL_COMPLETION_FUNC_T', execute=False, addmain=False,
57 msg='Checking for rl_completion_t')
58
59 conf.CHECK_CODE('''
60 #ifdef HAVE_READLINE_READLINE_H
61 #  ifdef HAVE_READLINE_READLINE_WORKAROUND
62 #    define _FUNCTION_DEF
63 #  endif
64 #  include <readline/readline.h>
65 #  ifdef HAVE_READLINE_HISTORY_H
66 #    include <readline/history.h>
67 #  endif
68 #else
69 #  ifdef HAVE_READLINE_H
70 #    include <readline.h>
71 #    ifdef HAVE_HISTORY_H
72 #      include <history.h>
73 #    endif
74 #  endif
75 #endif
76 int main(void) {CPPFunction f; return 0;}
77 ''',
78 'HAVE_CPPFUNCTION', execute=False, addmain=False,
79 msg='Checking for CPPFunction')
80
81 if conf.CHECK_FUNCS_IN('rl_completion_matches', 'readline'):
82     conf.DEFINE('HAVE_NEW_LIBREADLINE', 1)
83
84 if conf.CHECK_FUNCS_IN('history_list', 'readline'):
85     conf.DEFINE('HAVE_HISTORY_LIST', 1)