summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcli/smbreadline/wscript_configure33
1 files changed, 33 insertions, 0 deletions
diff --git a/libcli/smbreadline/wscript_configure b/libcli/smbreadline/wscript_configure
index b4d1be2b434..912ff53a150 100644
--- a/libcli/smbreadline/wscript_configure
+++ b/libcli/smbreadline/wscript_configure
@@ -7,8 +7,38 @@ for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
conf.env['READLINE_TERMLIB'] = termlib
break
+#
+# Check if we need to work around readline/readline.h
+# deprecated declarations
+#
+if conf.CONFIG_SET('HAVE_READLINE_READLINE_H'):
+ if not conf.CHECK_CODE('''
+ #include <readline/readline.h>
+ int main() {return 0;}
+ ''',
+ define='HAVE_WORKING_READLINE_READLINE_WITH_STRICT_PROTO',
+ cflags=conf.env['WERROR_CFLAGS'] +
+ ['-Wstrict-prototypes',
+ '-Werror=strict-prototypes'],
+ msg='for compiling <readline/readline.h> with strict prototypes',
+ addmain=False):
+ conf.CHECK_CODE('''
+ #define _FUNCTION_DEF
+ #include <readline/readline.h>
+ int main() {return 0;}
+ ''',
+ cflags=conf.env['WERROR_CFLAGS'] +
+ ['-Wstrict-prototypes',
+ '-Werror=strict-prototypes'],
+ msg='for workaround to <readline/readline.h> strict prototypes issue',
+ define='HAVE_READLINE_READLINE_WORKAROUND',
+ addmain=False)
+
conf.CHECK_CODE('''
#ifdef HAVE_READLINE_READLINE_H
+# ifdef HAVE_READLINE_READLINE_WORKAROUND
+# define _FUNCTION_DEF
+# endif
# include <readline/readline.h>
# ifdef HAVE_READLINE_HISTORY_H
# include <readline/history.h>
@@ -28,6 +58,9 @@ msg='Checking for rl_completion_t')
conf.CHECK_CODE('''
#ifdef HAVE_READLINE_READLINE_H
+# ifdef HAVE_READLINE_READLINE_WORKAROUND
+# define _FUNCTION_DEF
+# endif
# include <readline/readline.h>
# ifdef HAVE_READLINE_HISTORY_H
# include <readline/history.h>