summaryrefslogtreecommitdiff
path: root/source4/lib
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 /source4/lib
parent405b7d843f9103a29e923892337472e0fd891037 (diff)
downloadsamba-0ff7e0c998bb4fbc67925be762b528ae6585c4f3.tar.gz
samba-0ff7e0c998bb4fbc67925be762b528ae6585c4f3.tar.bz2
samba-0ff7e0c998bb4fbc67925be762b528ae6585c4f3.zip
samba: share readline wrappers among all buildsystems.
Guenther
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/tools/regshell.c2
-rw-r--r--source4/lib/smbreadline/readline.m496
-rw-r--r--source4/lib/smbreadline/smbreadline.h9
-rw-r--r--source4/lib/smbreadline/wscript_build8
-rw-r--r--source4/lib/smbreadline/wscript_configure52
5 files changed, 1 insertions, 166 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 993fe3d791..6bd7fd3b8b 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -24,7 +24,7 @@
#include "lib/cmdline/popt_common.h"
#include "lib/events/events.h"
#include "system/time.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "lib/registry/tools/common.h"
#include "param/param.h"
diff --git a/source4/lib/smbreadline/readline.m4 b/source4/lib/smbreadline/readline.m4
deleted file mode 100644
index 06d60caae1..0000000000
--- a/source4/lib/smbreadline/readline.m4
+++ /dev/null
@@ -1,96 +0,0 @@
-###############################################
-# Readline included by default unless explicitly asked not to
-test "${with_readline+set}" != "set" && with_readline=yes
-
-EXTERNAL_READLINE=no
-# test for where we get readline() from
-AC_MSG_CHECKING(whether to use readline)
-AC_ARG_WITH(readline,
-[AS_HELP_STRING([--with-readline[=DIR]], [Look for readline include/libs in DIR (default=auto)])],
-[ case "$with_readline" in
- yes)
- AC_MSG_RESULT(yes)
-
- AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
- AC_CHECK_HEADERS(readline/history.h)
-
- AC_CHECK_HEADERS(readline.h readline/readline.h,[
- for termlib in ncurses curses termcap terminfo termlib tinfo; do
- AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
- done
- AC_CHECK_LIB(readline, rl_callback_handler_install,
- [TERMLIBS="-lreadline $TERMLIBS"
- EXTERNAL_READLINE=yes
- break], [TERMLIBS=], $TERMLIBS)])
- ;;
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- AC_MSG_RESULT(yes)
-
- # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
- # alternate readline path
- _ldflags=${LDFLAGS}
- _cppflags=${CPPFLAGS}
-
- # Add additional search path
- LDFLAGS="-L$with_readline/lib $LDFLAGS"
- CPPFLAGS="-I$with_readline/include $CPPFLAGS"
-
- AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
- AC_CHECK_HEADERS(readline/history.h)
-
- AC_CHECK_HEADERS(readline.h readline/readline.h,[
- for termlib in ncurses curses termcap terminfo termlib; do
- AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
- done
- AC_CHECK_LIB(readline, rl_callback_handler_install,
- [TERMLDFLAGS="-L$with_readline/lib"
- TERMCPPFLAGS="-I$with_readline/include"
- LDFLAGS="-L$with_readline/lib $LDFLAGS"
- CPPFLAGS="-I$with_readline/include $CPPFLAGS"
- TERMLIBS="-lreadline $TERMLIBS"
- EXTERNAL_READLINE=yes
- break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
-
- ;;
- esac],
- AC_MSG_RESULT(no)
-)
-
-# The readline API changed slightly from readline3 to readline4, so
-# code will generate warnings on one of them unless we have a few
-# special cases.
-AC_CHECK_LIB(readline, rl_completion_matches,
- [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1,
- [Do we have rl_completion_matches?])],
- [],
- [$TERMLIBS])
-
-# not all readline libs have rl_event_hook or history_list
-AC_CHECK_DECLS(rl_event_hook, [], [], [
- #include <stdio.h>
- #include <readline/readline.h>
-])
-AC_CHECK_LIB(readline, history_list,
- [AC_DEFINE(HAVE_HISTORY_LIST, 1, [Do we have history_list?])],
- [],
- [$TERMLIBS])
-
-AC_CHECK_LIB(readline, add_history,
- [AC_DEFINE(HAVE_ADD_HISTORY, 1, [Do we have add_history?])],
- [],
- [$TERMLIBS])
-
-AC_MSG_CHECKING(whether to use extern readline)
-if test x"$EXTERNAL_READLINE" = x"yes"; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
- SMB_SUBSYSTEM(SMBREADLINE, [\$(smbreadlinesrcdir)/smbreadline.o], [READLINE])
- SMB_EXT_LIB(READLINE, [${TERMLIBS}])
- SMB_ENABLE(READLINE,YES)
-else
- SMB_SUBSYSTEM(SMBREADLINE, [\$(smbreadlinesrcdir)/smbreadline.o], [])
- AC_MSG_RESULT(no)
-fi
diff --git a/source4/lib/smbreadline/smbreadline.h b/source4/lib/smbreadline/smbreadline.h
deleted file mode 100644
index cde2b47a24..0000000000
--- a/source4/lib/smbreadline/smbreadline.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __SMBREADLINE_H__
-#define __SMBREADLINE_H__
-
-char *smb_readline(const char *prompt, void (*callback)(void),
- char **(completion_fn)(const char *text, int start, int end));
-const char *smb_readline_get_line_buffer(void);
-void smb_readline_ca_char(char c);
-
-#endif /* __SMBREADLINE_H__ */
diff --git a/source4/lib/smbreadline/wscript_build b/source4/lib/smbreadline/wscript_build
deleted file mode 100644
index 17699eafa2..0000000000
--- a/source4/lib/smbreadline/wscript_build
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-
-termlib=bld.env.READLINE_TERMLIB or ''
-
-bld.SAMBA_SUBSYSTEM('SMBREADLINE',
- source='smbreadline.c',
- deps=termlib + ' readline talloc')
diff --git a/source4/lib/smbreadline/wscript_configure b/source4/lib/smbreadline/wscript_configure
deleted file mode 100644
index cec6526898..0000000000
--- a/source4/lib/smbreadline/wscript_configure
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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)