summaryrefslogtreecommitdiff
path: root/source4
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
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')
-rw-r--r--source4/Makefile.in2
-rw-r--r--source4/client/client.c2
-rw-r--r--source4/configure.ac2
-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
-rw-r--r--source4/torture/shell.c2
-rw-r--r--source4/torture/smbtorture.c2
-rw-r--r--source4/wscript2
-rw-r--r--source4/wscript_build2
12 files changed, 8 insertions, 173 deletions
diff --git a/source4/Makefile.in b/source4/Makefile.in
index 40f35e0308..7c4f1416ff 100644
--- a/source4/Makefile.in
+++ b/source4/Makefile.in
@@ -68,7 +68,7 @@ tdbsrcdir := ../lib/tdb
ldbsrcdir := lib/ldb
libtlssrcdir := lib/tls
libregistrysrcdir := lib/registry
-smbreadlinesrcdir := lib/smbreadline
+smbreadlinesrcdir := ../libcli/smbreadline
libmessagingsrcdir := lib/messaging
libteventsrcdir := ../lib/tevent
libeventssrcdir := lib/events
diff --git a/source4/client/client.c b/source4/client/client.c
index ee5357f1bf..93d6f34495 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -45,7 +45,7 @@
#include "system/time.h" /* needed by some systems for asctime() */
#include "libcli/resolve/resolve.h"
#include "libcli/security/security.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
#include "libcli/raw/raw_proto.h"
diff --git a/source4/configure.ac b/source4/configure.ac
index f415d0bbb4..bdbbb30d71 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -12,7 +12,7 @@ AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h.])
# Configuration rules.
m4_include(build/m4/env.m4)
m4_include(../lib/replace/samba.m4)
-m4_include(lib/smbreadline/readline.m4)
+m4_include(../libcli/smbreadline/readline.m4)
m4_include(heimdal_build/config.m4)
m4_include(../lib/util/fault.m4)
m4_include(../lib/util/signal.m4)
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)
diff --git a/source4/torture/shell.c b/source4/torture/shell.c
index 03c670a902..4c098a9748 100644
--- a/source4/torture/shell.c
+++ b/source4/torture/shell.c
@@ -21,7 +21,7 @@
#include "includes.h"
#include "system/readline.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "lib/cmdline/popt_common.h"
#include "auth/credentials/credentials.h"
#include "torture/smbtorture.h"
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 940ce85c74..8989bdf8d2 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -24,7 +24,7 @@
#include "system/wait.h"
#include "system/filesys.h"
#include "system/readline.h"
-#include "lib/smbreadline/smbreadline.h"
+#include "../libcli/smbreadline/smbreadline.h"
#include "libcli/libcli.h"
#include "lib/events/events.h"
diff --git a/source4/wscript b/source4/wscript
index 64502b3f4f..806c58a4f2 100644
--- a/source4/wscript
+++ b/source4/wscript
@@ -109,7 +109,7 @@ def configure(conf):
conf.RECURSE('../lib/uid_wrapper')
conf.RECURSE('../lib/popt')
conf.RECURSE('../lib/subunit/c')
- conf.RECURSE('lib/smbreadline')
+ conf.RECURSE('../libcli/smbreadline')
conf.RECURSE('../pidl')
conf.RECURSE('selftest')
diff --git a/source4/wscript_build b/source4/wscript_build
index 110ca3ea2f..a4236643e9 100644
--- a/source4/wscript_build
+++ b/source4/wscript_build
@@ -110,7 +110,7 @@ bld.RECURSE('../libcli/samsync')
bld.RECURSE('lib/policy')
bld.RECURSE('../libcli/named_pipe_auth')
bld.RECURSE('heimdal_build')
-bld.RECURSE('lib/smbreadline')
+bld.RECURSE('../libcli/smbreadline')
bld.RECURSE('../codepages')
bld.RECURSE('setup')
bld.RECURSE('scripting')