summaryrefslogtreecommitdiff
path: root/libcli/smbreadline/wscript_configure
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-10-01 10:34:14 +0200
committerGünther Deschner <gd@samba.org>2010-10-01 22:30:22 +0200
commit0ff7e0c998bb4fbc67925be762b528ae6585c4f3 (patch)
treea0cbf213f73ca981713cc0adac4ffdc5a6f50bd9 /libcli/smbreadline/wscript_configure
parent405b7d843f9103a29e923892337472e0fd891037 (diff)
downloadsamba-0ff7e0c998bb4fbc67925be762b528ae6585c4f3.tar.gz
samba-0ff7e0c998bb4fbc67925be762b528ae6585c4f3.tar.bz2
samba-0ff7e0c998bb4fbc67925be762b528ae6585c4f3.zip
samba: share readline wrappers among all buildsystems.
Guenther
Diffstat (limited to 'libcli/smbreadline/wscript_configure')
-rw-r--r--libcli/smbreadline/wscript_configure52
1 files changed, 52 insertions, 0 deletions
diff --git a/libcli/smbreadline/wscript_configure b/libcli/smbreadline/wscript_configure
new file mode 100644
index 0000000000..cec6526898
--- /dev/null
+++ b/libcli/smbreadline/wscript_configure
@@ -0,0 +1,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)