Commit 6d55afc8 authored by Arpad Lovassy's avatar Arpad Lovassy Committed by Gerrit Code Review
Browse files

Merge "Changed mctr_cli and debugger UI to use 'libedit' as an external...

Merge "Changed mctr_cli and debugger UI to use 'libedit' as an external library instead of as embedded source (Bug 565893)"
parents ac9cc425 c8806d41
......@@ -3681,7 +3681,7 @@ static void print_makefile(struct makefile_struct *makefile)
fputs(" -lresolv", fp);
#endif
#ifdef ADVANCED_DEBUGGER_UI
fputs(" -lcurses", fp);
fputs(" -lcurses -lbsd -ledit", fp);
#endif
if (makefile->solspeclibraries) {
struct string_list* act_elem = makefile->solspeclibraries;
......@@ -3699,7 +3699,7 @@ static void print_makefile(struct makefile_struct *makefile)
fputs(" -lresolv", fp);
#endif
#ifdef ADVANCED_DEBUGGER_UI
fputs(" -lcurses", fp);
fputs(" -lcurses -lbsd -ledit", fp);
#endif
if (makefile->sol8speclibraries) {
struct string_list* act_elem = makefile->sol8speclibraries;
......@@ -3717,7 +3717,7 @@ static void print_makefile(struct makefile_struct *makefile)
fputs(" -lpthread -lrt", fp);
#endif
#ifdef ADVANCED_DEBUGGER_UI
fputs(" -lncurses", fp);
fputs(" -lncurses -lbsd -ledit", fp);
#endif
if (makefile->linuxspeclibraries) {
struct string_list* act_elem = makefile->linuxspeclibraries;
......@@ -3732,7 +3732,7 @@ static void print_makefile(struct makefile_struct *makefile)
fputs("FREEBSD_LIBS = -lxml2", fp);
#ifdef ADVANCED_DEBUGGER_UI
fputs(" -lncurses", fp);
fputs(" -lncurses -lbsd -ledit", fp);
#endif
if (makefile->freebsdspeclibraries) {
struct string_list* act_elem = makefile->freebsdspeclibraries;
......@@ -3747,7 +3747,7 @@ static void print_makefile(struct makefile_struct *makefile)
fputs("WIN32_LIBS = -lxml2", fp);
#ifdef ADVANCED_DEBUGGER_UI
fputs(" -lncurses", fp);
fputs(" -lncurses -lbsd -ledit", fp);
#endif
if (makefile->win32speclibraries) {
struct string_list* act_elem = makefile->win32speclibraries;
......
......@@ -18,7 +18,7 @@
#include <ctype.h>
#ifdef ADVANCED_DEBUGGER_UI
#include "../mctr2/editline/libedit/src/editline/readline.h"
#include <editline/readline.h>
// use a different file, than the MCTR CLI, since not all commands are the same
#define TTCN3_HISTORY_FILENAME ".ttcn3_history_single"
#endif
......@@ -221,7 +221,7 @@ void TTCN_Debugger_UI::init()
// read history from file, don't bother if it does not exist
read_history(ttcn3_history_filename);
// set our own command completion function
rl_completion_entry_function = (Function*)complete_command;
rl_completion_entry_function = complete_command;
#endif
}
......
......@@ -83,12 +83,12 @@ WIN32_LIBS := -lxml2
INTERIX_LIBS := -lxml2
ifeq ($(ADVANCED_DEBUGGER_UI), yes)
SOLARIS_LIBS += -lcurses
SOLARIS8_LIBS += -lcurses
LINUX_LIBS += -lncurses
FREEBSD_LIBS += -lncurses
WIN32_LIBS += -lncurses
INTERIX_LIBS += -lncurses
SOLARIS_LIBS += -lcurses -lbsd -ledit
SOLARIS8_LIBS += -lcurses -lbsd -ledit
LINUX_LIBS += -lncurses -lbsd -ledit
FREEBSD_LIBS += -lncurses -lbsd -ledit
WIN32_LIBS += -lncurses -lbsd -ledit
INTERIX_LIBS += -lncurses -lbsd -ledit
endif
ifeq ($(USAGE_STATS), yes)
......@@ -179,15 +179,9 @@ ifeq ($(USAGE_STATS), yes)
COMMON_OBJECTS += ../common/usage_stats.o
endif
ifeq ($(ADVANCED_DEBUGGER_UI), yes)
EDITLINE_OBJECTS := $(addprefix ../mctr2/editline/build/src/.libs/, chared.o common.o \
emacs.o fgetln.o help.o history.o map.o prompt.o read.o search.o strlcat.o term.o tty.o \
vi.o wcsdup.o chartype.o el.o fcns.o filecomplete.o hist.o key.o parse.o readline.o \
refresh.o sig.o strlcpy.o tokenizer.o unvis.o vis.o)
endif
LIBRARY_OBJECTS_NOMAIN := $(filter-out Single_main.o Parallel_main.o ProfMerge_main.o, \
$(OBJECTS)) $(COMMON_OBJECTS) $(EDITLINE_OBJECTS)
$(OBJECTS)) $(COMMON_OBJECTS)
TOBECLEANED := LoggerPlugin_static.o LoggerPlugin_dynamic.o ProfilerTools.profmerge.o
......
......@@ -24,7 +24,7 @@ include $(TOP)/Makefile.cfg
SUBDIRS :=
ifeq ($(CLI), yes)
SUBDIRS += editline cli
SUBDIRS += cli
endif
SUBDIRS += mctr
......
......@@ -31,7 +31,7 @@
#include "../mctr/MainController.h"
#include <stdio.h>
#include "../editline/libedit/src/editline/readline.h"
#include <editline/readline.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
......@@ -372,7 +372,7 @@ int Cli::interactiveMode()
// Read history from file, don't bother if it does not exist!
read_history(ttcn3_history_filename);
// Set our own command completion function
rl_completion_entry_function = (Function*)completeCommand;
rl_completion_entry_function = completeCommand;
// Override rl_getc() in order to detect shell mode
rl_getc_function = getcWithShellDetection;
......
##############################################################################
# Copyright (c) 2000-2020 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Delic, Adam
# Raduly, Csaba
# Szabados, Kristof
#
##############################################################################
# Makefile for build and install nedit and xemacs additions
#
#
TOP := ../..
include ../../Makefile.cfg
SUBDIR = build
DEPFILES = $(SUBDIR)/Makefile $(SUBDIR)/config.h $(SUBDIR)/config.status
CONFIGURING = configuring
UPPERCFG = ../../Makefile.cfg
ifeq ($(DEBUG), no)
INSTALL = install-strip
else
INSTALL = install
endif
# Variable wrappers
# make sure "configure" doesn't get -Werror
CFLAGS=$(filter-out -Werror,$(CCFLAGS) $(CPPFLAGS)) -Wno-unused-value
EXEEXT=$(EXESUFFIX)
prefix=$(TTCN3_DIR)
mandir=$(MANDIR)
# For MinGW only
bindir=$(BINDIR)
ifeq ($(PLATFORM), WIN32)
# Help "configure" find ncurses headers on Cygwin 1.7
CPPFLAGS+=-I/usr/include/ncurses
endif
# Override make options for ctags' autoconf
OPTIONS =MINGW CPPFLAGS CC CCFLAGS CCDEPFLAG CXXDEPFLAG EXEEXT CFLAGS LDFLAGS prefix mandir
ifdef MINGW
OPTIONS+=bindir
endif
# path and name of 'config.site'
#config_site = config.site
CONFIGOPTIONS = $(foreach m, $(OPTIONS), $(m)='$($m)')
ifdef SRCDIR
CONFIG_PARAMS := --srcdir=$(SRCDIR)/mctr2/editline/libedit
else
SRCDIR := $(ABS_TOP)
endif
all run: $(DEPFILES)
$(MAKE) -C $(SUBDIR) all
clean:
- cd $(SUBDIR) && $(MAKE) $@ || exit
distclean:
rm -rf $(SUBDIR)
rm -f $(CONFIGURING) $(DEPFILES)
dep: $(DEPFILES)
$(DEPFILES): $(UPPERCFG) $(CONFIGURING)
$(CONFIGURING): $(UPPERCFG)
@touch $(SRCDIR)/mctr2/editline/libedit/*.m4
@touch $(SRCDIR)/mctr2/editline/libedit/configure
@touch $(SRCDIR)/mctr2/editline/libedit/config.h.in
mkdir -p $(SUBDIR)
@echo Running 'configure' script...
cd $(SUBDIR) && $(CONFIGOPTIONS) $(SRCDIR)/mctr2/editline/libedit/configure $(CONFIG_PARAMS)
@touch $(CONFIGURING)
.PHONY: all install tags dep clean distclean
Makefile
config.h
config.log
config.status
libedit.pc
libtool
stamp-h1
autom4te.cache
Copyright (c) 1992, 1993
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Christos Zoulas of Cornell University.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
* See also NetBSD changelog:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit
2010-04-24 Jess Thrysoee
* version-info: 0:35:0
* all: sync with upstream source.
Now with UTF-8 support. To enable this run 'configure --enable-widec'.
For now an UTF-32 encoded wchar_t is required.
This requirement is met on NetBSD, Solaris and OS X for any UTF-8 locale,
and any system that defines __STDC_ISO_10646__ (e.g. GNU libc on Linux).
2009-09-23 Jess Thrysoee
* version-info: 0:34:0
* all: apply Apple patches from:
http://opensource.apple.com/source/libedit/libedit-11/patches
2009-09-05 Jess Thrysoee
* version-info: 0:33:0
* all: Use predefined macro __sun to identify Solaris
* src/el.c: Ignore comment lines in .editrc
2009-07-23 Jess Thrysoee
* version-info: 0:32:0
* all: sync with upstream source.
2009-06-10 Jess Thrysoee
* version-info: 0:31:0
* all: sync with upstream source.
2009-05-03 Jess Thrysoee
* version-info: 0:30:0
* all: sync with upstream source.
2009-04-05 Jess Thrysoee
* version-info: 0:29:0
* all: sync with upstream source.
2009-01-11 Jess Thrysoee
* version-info: 0:28:0
* all: sync with upstream source. MAJOR.MINOR version is now 3.0.
This is due to NetBSD changing time_t and dev_t to 64 bits. It does
not really effect this package.
* configure.ac: Remove '--enable-debug' configure flag. The autoconf way
to control flags is by specifying them when running configure,
e.g. 'CFLAGS="-O0 -g" ./configure'
2008-07-12 Jess Thrysoee
* version-info: 0:27:0
* configure.ac: Added '--enable-debug' configure flag, to produce debugging
information.
* examples/fileman.c: cast stat struct members, st_nlink and st_size,
appropriately (see also 'man 2 stat'). Patch by Alex Elder.
* all: sync with upstream source. MINOR version is now 11.
2007-08-31 Jess Thrysoee
* version-info: 0:26:0
* libedit.pc.in,Makefile.am,configure.ac,patches/extra_dist_list.sh:
Added pkg-config support for libedit. Patch by Masatake YAMATO.
2007-08-13 Jess Thrysoee
* version-info: 0:25:0
* all: sync with upstream source.
2007-03-02 Jess Thrysoee
* version-info: 0:24:0
* all: sync with upstream source.
2006-10-22 Jess Thrysoee
* version-info: 0:23:0
* src/shlib_version: Upstream bumped minor version from 9 to 10.
* all: sync with upstream source. More readline functions.
2006-10-22 Jess Thrysoee
* version-info: 0:22:0
* all: sync with upstream source.
2006-08-29 Jess Thrysoee
* version-info: 0:21:0
* all: License cleanup. All 4-clause advertising BSD licenses has been
changed to the 3-clause version by upstream.
* src/fgetln.c: use src/tools/compat/fgetln.c instead of
othersrc/libexec/tnftpd/libnetbsd/fgetln.c
2006-08-16 Jess Thrysoee
* version-info: 0:20:0
* all: sync with upstream source.
2006-06-03 Jess Thrysoee
* version-info: 0:19:0
* COPYING: added global license file
* all: sync with upstream source.
2006-02-13 Jess Thrysoee
* version-info: 0:18:0
* src/readline.c: Partial rl_getc_function support, patch by Kjeld Borch
Egevang.
* src/readline.c: Make write_history and read_history returncode readline
compatible. Upstream patch.
2006-01-03 Jess Thrysoee
* version-info: 0:17:0
* patches/cvs_export.sh: strlcat.c and strlcpy.c was moved to
src/common/lib/libc/string in the upstream cvs repository.
* all: sync with upstream source.
2005-10-22 Jess Thrysoee
* version-info: 0:16:0
* patches/*.patch, configure.ac: define SCCSID, undef LIBC_SCCS. Remove
fourteen cosmetic patches.
* all: sync with upstream source.
2005-09-11 Jess Thrysoee
* version-info: 0:15:0
* src/Makefile.am: fix typo that meant generated files were distributes,
and make generated file targets dependent on the the 'makelist' input
files.
* all: sync with upstream source. This is just a manpage update
2005-08-28 Jess Thrysoee
* version-info: 0:14:0
* src/sys.h: include config.h to avoid "redefinition of
`u_int32_t'". Patch by Norihiko Murase.
* src/search.c: explicitly include sys/types.h, because regex.h on
FreeBSD needs it and does not include it itself. Patch by Norihiko Murase.
* acinclude.m4: added EL_GETPW_R_DRAFT test and use AC_TRY_LINK instead
of AC_TRY_COMPILE. Suggested by Norihiko Murase.
* all: sync with upstream source.
2005-08-16 Jess Thrysoee
* version-info: 0:13:0
* all: sync with upstream source.
2005-08-05 Jess Thrysoee
* version-info: 0:12:0
* all: sync with upstream source.
2005-07-24 Jess Thrysoee
* version-info: 0:11:0
* histedit.h, histedit.c, readline.c, editline/readline.h: From
upstream; added remove_history().
2005-07-07 Jess Thrysoee
* version-info: 0:10:0
* history.c, key.c: From upstream source; Fix memory leaks found by
valgrind.
2005-06-28 Jess Thrysoee
* version-info: 0:9:0
* src/readline.c: getpwent_r is not POSIX, always use getpwent.
Reported by Gerrit P. Haase.
* src/Makefile.am: Added libtool -no-undefined. This is needed on Cygwin
to get a shared editline library. Should not affect other platforms.
Suggested by Gerrit P. Haase.
2005-06-15 Jess Thrysoee
* version-info: 0:8:0
* all: sync with upstream source.
2005-06-01 Jess Thrysoee
* version-info: 0:7:0
* all: sync with upstream source.
* src/readline.c, src/filecomplete.c: Solaris use POSIX draft versions
of getpwent_r, getpwnam_r and getpwuid_r which return 'struct passwd *'.
Define HAVE_GETPW_R_POSIX if these functions are (non draft) POSIX
compatible. Patch by Julien Torrs.
2005-05-28 Jess Thrysoee
* version-info: 0:6:0
* all: sync with upstream source.
2005-03-11 Jess Thrysoee
* version-info: 0:5:0
* all: sync with upstream source.
2004-12-07 Jess Thrysoee
* version-info: 0:4:0
* src/readline.c: d_namlen (in struct dirent) is not portable, always
use strlen. Patch by Scott Rankin.
2004-11-27 Jess Thrysoee
* version-info: 0:3:0
* src/history.c: bug #26785 fixed upstream, removed local patch.
2004-11-06 Jess Thrysoee
* version-info: 0:2:0
* all: sync with upstream source.
* doc/Makefile.am: If mdoc2man fails, remove empty file. Patch by
Darren Tucker.
2004-10-14 Jess Thrysoee
* version-info: 0:1:0
* doc/Makefile.am: 'make install' twice fails. Remove old links before
trying to link the man pages. Patch by Rick Richardson.
2004-09-28 Jess Thrysoee
* version-info: 0:0:0
* acinclude.m4 configure.ac src/Makefile.am: Adhere to
LibTools library interface versions recommendation.
http://www.gnu.org/software/libtool/manual.html#SEC32
* doc/Makefile.am: name all manpage links as el_* (e.g. el_history.3)
to avoid conflicts.
2004-09-08 Jess Thrysoee
* all: Initial package.
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures