Move readline to the readline/readline subdirectory

readline turns out to be a bit of a stumbling block for the project to
move gdbsupport (and then gdbserver) to the top-level.

The issue is that readline headers are intended to be included with
names like "readline/readline.h".  To support this, gdb effectively
adds a -I option pointing to the top-level source directory -- but,
importantly, this option is not used when the system readline is used.

For gdbsupport, a -I option like this would always be needed, but that
in turn would break the system readline case.  This was PR build/17077,
fixed in commit a8a5dbcab8.

Previously, we had discussed this on the gdb-patches list in terms of
removing readline from the tree

    https://sourceware.org/ml/gdb-patches/2019-09/msg00317.html

However, Eli expressed some concerns, and Joel did as well (off-list).

Given those concerns, and the fact that a patch-free local readline is
relatively new in gdb (it was locally patched for years), I changed my
mind and decided to handle this situation by moving the readline
sources down a level.

That is, upstream readline is now in readline/readline, and the
top-level readline directory just contains the minimal configury
needed to build that.

This fixes the problem because, when gdb unconditionally adds a
-I$(top_srcdir), this will not find readline headers.  A separate -I
will be needed instead, which is exactly what's needed for
--with-system-readline.

gdb/ChangeLog
2019-10-23  Tom Tromey  <tom@tromey.com>

	* Makefile.in (READLINE_DIR): Update.

gdb/doc/ChangeLog
2019-10-23  Tom Tromey  <tom@tromey.com>

	* Makefile.in (READLINE_DIR): Update.

readline/ChangeLog
2019-10-23  Tom Tromey  <tom@tromey.com>

	Move old contents to readline/ subdirectory.
	* aclocal.m4, configure, configure.ac, .gitignore, Makefile.am,
	Makefile.in, README: New files.

Change-Id: Ice156a2ee09ea68722b48f64d97146d7428ea9e4
This commit is contained in:
Tom Tromey 2019-10-05 16:39:44 -06:00
parent 12e7c35ec3
commit 6999161a2a
152 changed files with 15591 additions and 10519 deletions

View File

@ -1,3 +1,7 @@
2019-10-23 Tom Tromey <tom@tromey.com>
* Makefile.in (READLINE_DIR): Update.
2019-10-23 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* infcall.c (call_function_by_hand_dummy): Fix the function

View File

@ -174,8 +174,8 @@ LIBDECNUMBER = $(LIBDECNUMBER_DIR)/libdecnumber.a
LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUMBER_DIR)
LIBDECNUMBER_CFLAGS = -I$(LIBDECNUMBER_DIR) -I$(LIBDECNUMBER_SRC)
# Where is the READLINE library? Typically in ../readline.
READLINE_DIR = ../readline
# Where is the READLINE library? Typically in ../readline/readline.
READLINE_DIR = ../readline/readline
READLINE_SRC = $(srcdir)/$(READLINE_DIR)
READLINE = @READLINE@
READLINE_DEPS = @READLINE_DEPS@

View File

@ -1,3 +1,7 @@
2019-10-23 Tom Tromey <tom@tromey.com>
* Makefile.in (READLINE_DIR): Update.
2019-10-23 Christian Biesinger <cbiesinger@google.com>
* python.texi (Threads In Python): Add a note for how to get the

View File

@ -74,7 +74,7 @@ BUGURL_TEXI = @REPORT_BUGS_TEXI@
# Where is the source dir for the READLINE library doc?
# Traditionally readline is in .. or .
READLINE_DIR = ${gdbdir}/../readline/doc
READLINE_DIR = ${gdbdir}/../readline/readline/doc
READLINE_TEXI_INCFLAG = @READLINE_TEXI_INCFLAG@
# The GDB/MI docs come from a sibling directory ../mi

35
readline/.gitignore vendored
View File

@ -1,37 +1,4 @@
Makefile
*.o
*.a
*.so
*.sl
*.dll
autom4te.cache
config.cache
config.h
config.log
config.status
doc/Makefile
examples/Makefile
shlib/Makefile
examples/fileman
examples/hist_erasedups
examples/hist_purgecmd
examples/histexamp
examples/rl
examples/rl-callbacktest
examples/rlbasic
examples/rlcat
examples/rlevent
examples/rltest
examples/rlversion
libhistory.so.*
libreadline.so.*
*.dylib
readline.pc
stamp-h

6
readline/ChangeLog Normal file
View File

@ -0,0 +1,6 @@
2019-10-23 Tom Tromey <tom@tromey.com>
Move old contents to readline/ subdirectory.
* aclocal.m4, configure, configure.ac, .gitignore, Makefile.am,
Makefile.in, README: New files.

20
readline/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
# Copyright (C) 2019 Free Software Foundation, Inc.
# This file is part of GDB.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AUTOMAKE_OPTIONS = no-dist foreign
SUBDIRS = readline
ACLOCAL_AMFLAGS = -I . -I ../config

File diff suppressed because it is too large Load Diff

View File

@ -1,196 +1,14 @@
Introduction
============
This is an import of readline that is used by gdb.
This is the Gnu Readline library, version 8.0.
To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE. For maintainers, see ../gdb/MAINTAINERS.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
Emacs and vi editing modes are available. The Readline library includes
additional functions to maintain a list of previously-entered command
lines, to recall and perhaps reedit those lines, and perform csh-like
history expansion on previous commands.
If you need to patch readline, please document the changes here.
The history facilites are also placed into a separate library, the
History library, as part of the build process. The History library
may be used without Readline in applications which desire its
capabilities.
To import, copy the upstream readline sources into the "readline"
subdirectory, remembering to (1) remove any files that were deleted
upstream, and (2) merge the one small configure.ac patch that gdb
carries.
The Readline library is free software, distributed under the terms of
the [GNU] General Public License as published by the Free Software
Foundation, version 3 of the License. For more information, see the
file COPYING.
To build the library, try typing `./configure', then `make'. The
configuration process is automated, so no further intervention should
be necessary. Readline builds with `gcc' by default if it is
available. If you want to use `cc' instead, type
CC=cc ./configure
if you are using a Bourne-style shell. If you are not, the following
may work:
env CC=cc ./configure
Read the file INSTALL in this directory for more information about how
to customize and control the build process.
The file rlconf.h contains C preprocessor defines that enable and disable
certain Readline features.
The special make target `everything' will build the static and shared
libraries (if the target platform supports them) and the examples.
Examples
========
There are several example programs that use Readline features in the
examples directory. The `rl' program is of particular interest. It
is a command-line interface to Readline, suitable for use in shell
scripts in place of `read'.
Shared Libraries
================
There is skeletal support for building shared versions of the
Readline and History libraries. The configure script creates
a Makefile in the `shlib' subdirectory, and typing `make shared'
will cause shared versions of the Readline and History libraries
to be built on supported platforms.
If `configure' is given the `--enable-shared' option, it will attempt
to build the shared libraries by default on supported platforms.
Configure calls the script support/shobj-conf to test whether or
not shared library creation is supported and to generate the values
of variables that are substituted into shlib/Makefile. If you
try to build shared libraries on an unsupported platform, `make'
will display a message asking you to update support/shobj-conf for
your platform.
If you need to update support/shobj-conf, you will need to create
a `stanza' for your operating system and compiler. The script uses
the value of host_os and ${CC} as determined by configure. For
instance, FreeBSD 4.2 with any version of gcc is identified as
`freebsd4.2-gcc*'.
In the stanza for your operating system-compiler pair, you will need to
define several variables. They are:
SHOBJ_CC The C compiler used to compile source files into shareable
object files. This is normally set to the value of ${CC}
by configure, and should not need to be changed.
SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create
position-independent code. If you are using gcc, this
should probably be set to `-fpic'.
SHOBJ_LD The link editor to be used to create the shared library from
the object files created by $SHOBJ_CC. If you are using
gcc, a value of `gcc' will probably work.
SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation.
If you are using gcc, `-shared' may be all that is necessary.
These should be the flags needed for generic shared object
creation.
SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
creation. Many systems use the -R option to the link
editor to embed a path within the library for run-time
library searches. A reasonable value for such systems would
be `-R$(libdir)'.
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
SHLIB_LIBPREF The prefix to use when generating the filename of the shared
library. The default is `lib'; Cygwin uses `cyg'.
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
generating the filename of the shared library. Many systems
use `so'; HP-UX uses `sl'.
SHLIB_LIBVERSION The string to append to the filename to indicate the version
of the shared library. It should begin with $(SHLIB_LIBSUFF),
and possibly include version information that allows the
run-time loader to load the version of the shared library
appropriate for a particular program. Systems using shared
libraries similar to SunOS 4.x use major and minor library
version numbers; for those systems a value of
`$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
Systems based on System V Release 4 don't use minor version
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
Other Unix versions use different schemes.
SHLIB_DLLVERSION The version number for shared libraries that determines API
compatibility between readline versions and the underlying
system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
can be overridden at configuration time by defining DLLVERSION
in the environment.
SHLIB_DOT The character used to separate the name of the shared library
from the suffix and version information. The default is `.';
systems like Cygwin which don't separate version information
from the library name should set this to the empty string.
SHLIB_STATUS Set this to `supported' when you have defined the other
necessary variables. Make uses this to determine whether
or not shared library creation should be attempted.
You should look at the existing stanzas in support/shobj-conf for ideas.
Once you have updated support/shobj-conf, re-run configure and type
`make shared'. The shared libraries will be created in the shlib
subdirectory.
If shared libraries are created, `make install' will install them.
You may install only the shared libraries by running `make
install-shared' from the top-level build directory. Running `make
install' in the shlib subdirectory will also work. If you don't want
to install any created shared libraries, run `make install-static'.
Documentation
=============
The documentation for the Readline and History libraries appears in
the `doc' subdirectory. There are three texinfo files and a
Unix-style manual page describing the facilities available in the
Readline library. The texinfo files include both user and
programmer's manuals. HTML versions of the manuals appear in the
`doc' subdirectory as well.
Usage
=====
Our position on the use of Readline through a shared-library linking
mechanism is that there is no legal difference between shared-library
linking and static linking--either kind of linking combines various
modules into a single larger work. The conditions for using Readline
in a larger work are stated in section 3 of the GNU GPL.
Reporting Bugs
==============
Bug reports for Readline should be sent to:
bug-readline@gnu.org
When reporting a bug, please include the following information:
* the version number and release status of Readline (e.g., 4.2-release)
* the machine and OS that it is running on
* a list of the compilation flags or the contents of `config.h', if
appropriate
* a description of the bug
* a recipe for recreating the bug reliably
* a fix for the bug if you have one!
If you would like to contact the Readline maintainer directly, send mail
to bash-maintainers@gnu.org.
Since Readline is developed along with bash, the bug-bash@gnu.org mailing
list (mirrored to the Usenet newsgroup gnu.bash.bug) often contains
Readline bug reports and fixes.
Chet Ramey
chet.ramey@case.edu
If your import removes the need for a local patch, please remember to
update this file.

4936
readline/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

5829
readline/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,320 +1,29 @@
dnl Autoconf configure script for the readline wrapper directory
dnl Copyright (C) 2019 Free Software Foundation, Inc.
dnl
dnl Configure script for readline library
dnl This file is part of GDB.
dnl
dnl report bugs to chet@po.cwru.edu
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 1987-2018 Free Software Foundation, Inc.
AC_INIT([readline], [UNUSED-VERSION])
AC_CONFIG_SRCDIR([readline/readline.c])
AC_CONFIG_AUX_DIR(..)
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Readline 8.0, version 2.85])
m4_include([../config/override.m4])
AC_INIT(readline, 8.0, bug-readline@gnu.org)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(readline.h)
dnl GDB LOCAL
dnl AC_CONFIG_AUX_DIR(./support)
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
AC_CONFIG_HEADERS(config.h)
dnl update the value of RL_READLINE_VERSION in readline.h when this changes
LIBVERSION=8.0
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
dnl configure defaults
opt_curses=no
dnl arguments to configure
AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
if test "$opt_curses" = "yes"; then
prefer_curses=yes
fi
dnl option parsing for optional features
opt_multibyte=yes
opt_static_libs=yes
opt_shared_libs=no
opt_install_examples=no
AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
dnl AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
AC_ARG_ENABLE(install-examples, AC_HELP_STRING([--disable-install-examples], [don't install examples [[default=install]]]), opt_install_examples=$enableval)
if test $opt_multibyte = no; then
AC_DEFINE(NO_MULTIBYTE_SUPPORT)
fi
dnl load up the cross-building cache file -- add more cases and cache
dnl files as necessary
dnl Note that host and target machine are the same, and different than the
dnl build machine.
CROSS_COMPILE=
if test "x$cross_compiling" = "xyes"; then
case "${host}" in
*-cygwin*)
cross_cache=${srcdir}/cross-build/cygwin.cache
;;
*-mingw*)
cross_cache=${srcdir}/cross-build/mingw.cache
;;
i[[3456]]86-*-beos*)
cross_cache=${srcdir}/cross-build/x86-beos.cache
;;
*) echo "configure: cross-compiling for $host is not supported" >&2
;;
esac
if test -n "${cross_cache}" && test -r "${cross_cache}"; then
echo "loading cross-build cache file ${cross_cache}"
. ${cross_cache}
fi
unset cross_cache
CROSS_COMPILE='-DCROSS_COMPILING'
AC_SUBST(CROSS_COMPILE)
fi
echo ""
echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
echo ""
# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_MAKE_SET
AC_PROG_CC
dnl AC_AIX
AC_MINIX
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_CHECK_TOOL(AR, ar)
dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
dnl This allows people to set it when running configure or make
test -n "$ARFLAGS" || ARFLAGS="cr"
AC_PROG_RANLIB
MAKE_SHELL=/bin/sh
AC_SUBST(MAKE_SHELL)
AC_C_CONST
AC_C_PROTOTYPES
AC_C_CHAR_UNSIGNED
AC_C_VOLATILE
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, int)
AC_HEADER_STDC
AC_HEADER_STAT
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl kill lstat readlink)
AC_CHECK_FUNCS(fnmatch memmove pselect putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf)
AC_CHECK_FUNCS(isascii isxdigit)
AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
AC_FUNC_CHOWN
AC_FUNC_STRCOLL
AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h stdbool.h \
string.h strings.h \
limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h)
AC_CHECK_HEADERS(sys/ioctl.h sys/pte.h sys/stream.h sys/select.h sys/file.h)
AC_CHECK_HEADERS(sys/ptem.h,,,
[[
#if HAVE_SYS_STREAM_H
# include <sys/stream.h>
#endif
]])
AC_SYS_LARGEFILE
BASH_SYS_SIGNAL_VINTAGE
BASH_SYS_REINSTALL_SIGHANDLERS
BASH_FUNC_POSIX_SETJMP
BASH_FUNC_LSTAT
BASH_FUNC_STRCOLL
BASH_FUNC_CTYPE_NONASCII
BASH_CHECK_GETPW_FUNCS
AC_HEADER_TIOCGWINSZ
BASH_TYPE_SIG_ATOMIC_T
BASH_TYPE_SIGHANDLER
BASH_HAVE_TIOCSTAT
BASH_HAVE_FIONREAD
BASH_CHECK_SPEED_T
BASH_STRUCT_WINSIZE
BASH_STRUCT_DIRENT_D_INO
BASH_STRUCT_DIRENT_D_FILENO
AC_CHECK_HEADERS(libaudit.h)
AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include <linux/audit.h>]])
dnl yuck
case "$host_os" in
aix*) prefer_curses=yes ;;
esac
BASH_CHECK_LIB_TERMCAP
if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
if test "$prefer_curses" = yes; then
TERMCAP_LIB=-lcurses
else
TERMCAP_LIB=-ltermcap #default
fi
fi
# Windows ncurses installation
if test "$TERMCAP_LIB" = "-lncurses"; then
AC_CHECK_HEADERS(ncurses/termcap.h)
fi
case "$TERMCAP_LIB" in
-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
-lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;;
*) TERMCAP_PKG_CONFIG_LIB=termcap ;;
esac
BASH_CHECK_MULTIBYTE
case "$host_cpu" in
*cray*) LOCAL_CFLAGS=-DCRAY ;;
*s390*) LOCAL_CFLAGS=-fsigned-char ;;
esac
case "$host_os" in
isc*) LOCAL_CFLAGS=-Disc386 ;;
esac
# shared library configuration section
#
# Shared object configuration section. These values are generated by
# ${srcdir}/support/shobj-conf
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
# case "$SHLIB_LIBS" in
# *curses*|*termcap*|*termlib*) ;;
# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
# esac
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
AC_SUBST(SHOBJ_LDFLAGS)
AC_SUBST(SHOBJ_XLDFLAGS)
AC_SUBST(SHOBJ_LIBS)
AC_SUBST(SHOBJ_STATUS)
AC_SUBST(SHLIB_STATUS)
AC_SUBST(SHLIB_XLDFLAGS)
AC_SUBST(SHLIB_DOT)
AC_SUBST(SHLIB_LIBPREF)
AC_SUBST(SHLIB_LIBSUFF)
AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_DLLVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
# SHLIB_STATUS is either `supported' or `unsupported'. If it's
# `unsupported', turn off any default shared library building
if test "$SHLIB_STATUS" = 'unsupported'; then
opt_shared_libs=no
fi
# shared library versioning
# quoted for m4 so I can use character classes
SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
AC_SUBST(SHLIB_MAJOR)
AC_SUBST(SHLIB_MINOR)
fi
if test "$opt_static_libs" = "yes"; then
STATIC_TARGET=static
STATIC_INSTALL_TARGET=install-static
fi
if test "$opt_shared_libs" = "yes"; then
SHARED_TARGET=shared
SHARED_INSTALL_TARGET=install-shared
fi
AC_SUBST(STATIC_TARGET)
AC_SUBST(SHARED_TARGET)
AC_SUBST(STATIC_INSTALL_TARGET)
AC_SUBST(SHARED_INSTALL_TARGET)
if test "$opt_install_examples" = "yes"; then
EXAMPLES_INSTALL_TARGET=install-examples
fi
AC_SUBST(EXAMPLES_INSTALL_TARGET)
case "$build_os" in
msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
*) BUILD_DIR=`pwd` ;;
esac
case "$BUILD_DIR" in
*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
*) ;;
esac
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
AC_SUBST(LOCAL_CFLAGS)
AC_SUBST(LOCAL_LDFLAGS)
AC_SUBST(LOCAL_DEFS)
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
AC_SUBST(host_cpu)
AC_SUBST(host_os)
AC_SUBST(LIBVERSION)
AC_SUBST(TERMCAP_LIB)
AC_SUBST(TERMCAP_PKG_CONFIG_LIB)
AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc],
[
# Makefile uses this timestamp file to record whether config.h is up to date.
echo > stamp-h
])
AC_CONFIG_SUBDIRS([readline])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

37
readline/readline/.gitignore vendored Normal file
View File

@ -0,0 +1,37 @@
Makefile
*.o
*.a
*.so
*.sl
*.dll
config.cache
config.h
config.log
config.status
doc/Makefile
examples/Makefile
shlib/Makefile
examples/fileman
examples/hist_erasedups
examples/hist_purgecmd
examples/histexamp
examples/rl
examples/rl-callbacktest
examples/rlbasic
examples/rlcat
examples/rlevent
examples/rltest
examples/rlversion
libhistory.so.*
libreadline.so.*
*.dylib
readline.pc
stamp-h

View File

@ -1,4 +1,4 @@
2019-09-23 Andrew Burgess <andrew.burgess@embecosm.com>
2019-10-23 Andrew Burgess <andrew.burgess@embecosm.com>
PR cli/24980
* display.c (init_line_structures): Initialise line_state using

View File

@ -0,0 +1,616 @@
## -*- text -*- ##
# Master Makefile for the GNU readline library.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
RL_LIBRARY_VERSION = @LIBVERSION@
RL_LIBRARY_NAME = readline
PACKAGE = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CC = @CC@
RANLIB = @RANLIB@
AR = @AR@
ARFLAGS = @ARFLAGS@
RM = rm -f
CP = cp
MV = mv
@SET_MAKE@
SHELL = @MAKE_SHELL@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
libdir = @libdir@
mandir = @mandir@
includedir = @includedir@
datadir = @datadir@
localedir = @localedir@
pkgconfigdir = ${libdir}/pkgconfig
infodir = @infodir@
docdir = @docdir@
man3dir = $(mandir)/man3
# Support an alternate destination root directory for package building
DESTDIR =
# Programs to make tags files.
ETAGS = etags
CTAGS = ctags -tw
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@ @CROSS_COMPILE@
LOCAL_DEFS = @LOCAL_DEFS@
TERMCAP_LIB = @TERMCAP_LIB@
# For libraries which include headers from other libraries.
INCLUDES = -I. -I$(srcdir)
XCCFLAGS = $(ASAN_CFLAGS) $(DEFS) $(LOCAL_DEFS) $(INCLUDES) $(CPPFLAGS)
CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
# could add -Werror here
GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
-Wwrite-strings -Wstrict-prototypes \
-Wmissing-prototypes -Wno-implicit -pedantic
GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@
ASAN_XCFLAGS = -fsanitize=address -fno-omit-frame-pointer
ASAN_XLDFLAGS = -fsanitize=address
install_examples = @EXAMPLES_INSTALL_TARGET@
.c.o:
${RM} $@
$(CC) -c $(CCFLAGS) $<
# The name of the main library target.
LIBRARY_NAME = libreadline.a
STATIC_LIBS = libreadline.a libhistory.a
# The C code source files for this library.
CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
$(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
$(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
$(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
$(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
$(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
$(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c $(srcdir)/xfree.c \
$(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
$(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
$(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \
$(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \
$(srcdir)/mbutil.c
# The header files for this library.
HSOURCES = $(srcdir)/readline.h $(srcdir)/rldefs.h $(srcdir)/chardefs.h \
$(srcdir)/keymaps.h $(srcdir)/history.h $(srcdir)/histlib.h \
$(srcdir)/posixstat.h $(srcdir)/posixdir.h $(srcdir)/posixjmp.h \
$(srcdir)/tilde.h $(srcdir)/rlconf.h $(srcdir)/rltty.h \
$(srcdir)/ansi_stdlib.h $(srcdir)/tcap.h $(srcdir)/rlstdc.h \
$(srcdir)/xmalloc.h $(srcdir)/rlprivate.h $(srcdir)/rlshell.h \
$(srcdir)/rltypedefs.h $(srcdir)/rlmbutil.h \
$(srcdir)/colors.h $(srcdir)/parse-colors.h
HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o
TILDEOBJ = tilde.o
COLORSOBJ = colors.o parse-colors.o
OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
rltty.o complete.o bind.o isearch.o display.o signals.o \
util.o kill.o undo.o macro.o input.o callback.o terminal.o \
text.o nls.o misc.o $(HISTOBJ) $(TILDEOBJ) $(COLORSOBJ) \
xmalloc.o xfree.o compat.o
# The texinfo files which document this library.
DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
DOCOBJECT = doc/readline.dvi
DOCSUPPORT = doc/Makefile
DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
CREATED_CONFIGURE = config.status config.h config.cache config.log \
stamp-config stamp-h readline.pc
CREATED_TAGS = TAGS tags
INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
rlstdc.h rlconf.h rltypedefs.h
OTHER_DOCS = $(srcdir)/CHANGES $(srcdir)/INSTALL $(srcdir)/README
OTHER_INSTALLED_DOCS = CHANGES INSTALL README
##########################################################################
TARGETS = @STATIC_TARGET@ @SHARED_TARGET@
INSTALL_TARGETS = @STATIC_INSTALL_TARGET@ @SHARED_INSTALL_TARGET@
all: $(TARGETS)
everything: all examples
asan:
${MAKE} ${MFLAGS} ASAN_CFLAGS='${ASAN_XCFLAGS}' ASAN_LDFLAGS='${ASAN_XLDFLAGS}' everything
static: $(STATIC_LIBS)
libreadline.a: $(OBJECTS)
$(RM) $@
$(AR) $(ARFLAGS) $@ $(OBJECTS)
-test -n "$(RANLIB)" && $(RANLIB) $@
libhistory.a: $(HISTOBJ) xmalloc.o xfree.o
$(RM) $@
$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o xfree.o
-test -n "$(RANLIB)" && $(RANLIB) $@
# Since tilde.c is shared between readline and bash, make sure we compile
# it with the right flags when it's built as part of readline
tilde.o: tilde.c
rm -f $@
$(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c
readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
$(CC) $(CCFLAGS) -DREADLINE_LIBRARY -o $@ $(top_srcdir)/examples/rl.c ./libreadline.a ${TERMCAP_LIB}
lint: force
$(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static
Makefile makefile: config.status $(srcdir)/Makefile.in
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
Makefiles makefiles: config.status $(srcdir)/Makefile.in
@for mf in $(CREATED_MAKEFILES); do \
CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
done
config.status: configure
$(SHELL) ./config.status --recheck
config.h: stamp-h
stamp-h: config.status $(srcdir)/config.h.in
CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
echo > $@
#$(srcdir)/configure: $(srcdir)/configure.ac ## Comment-me-out in distribution
# cd $(srcdir) && autoconf ## Comment-me-out in distribution
shared: force
-test -d shlib || mkdir shlib
( cd shlib ; ${MAKE} ${MFLAGS} all )
documentation: force
-test -d doc || mkdir doc
-( cd doc && $(MAKE) $(MFLAGS) )
examples: force
-test -d examples || mkdir examples
-(cd examples && ${MAKE} ${MFLAGS} all )
force:
## GDB LOCAL
## Don't mess with people's installed readline's.
## This tries to install this version of readline over whatever
## version is already installed on the system (which could be a
## newer version). There is no real reason for us to install
## readline along with GDB. GDB links statically against readline,
## so it doesn't depend on us installing it on the system.
install:
#install: $(INSTALL_TARGETS)
install-headers: installdirs ${INSTALLED_HEADERS}
for f in ${INSTALLED_HEADERS}; do \
$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/readline ; \
done
uninstall-headers:
-test -n "$(includedir)" && cd $(DESTDIR)$(includedir)/readline && \
${RM} ${INSTALLED_HEADERS}
maybe-uninstall-headers: uninstall-headers
install-pc: installdirs
-$(INSTALL_DATA) $(BUILD_DIR)/readline.pc $(DESTDIR)$(pkgconfigdir)/readline.pc
uninstall-pc:
-test -n "$(pkgconfigdir)" && cd $(DESTDIR)$(pkgconfigdir) && \
${RM} readline.pc
maybe-uninstall-pc: uninstall-pc
install-static: installdirs $(STATIC_LIBS) install-headers install-doc ${install_examples} install-pc
-$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
$(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
-$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old
$(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a
-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a
installdirs: $(srcdir)/support/mkinstalldirs
-$(SHELL) $(srcdir)/support/mkinstalldirs $(DESTDIR)$(includedir) \
$(DESTDIR)$(includedir)/readline $(DESTDIR)$(libdir) \
$(DESTDIR)$(infodir) $(DESTDIR)$(man3dir) $(DESTDIR)$(docdir) \
$(DESTDIR)$(pkgconfigdir)
uninstall: uninstall-headers uninstall-doc uninstall-examples uninstall-pc
-test -n "$(DESTDIR)$(libdir)" && cd $(DESTDIR)$(libdir) && \
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
-( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
install-shared: installdirs install-headers shared install-doc install-pc
( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
uninstall-shared: maybe-uninstall-headers maybe-uninstall-pc
-( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
install-examples: installdirs install-headers
-( cd examples ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
uninstall-examples: maybe-uninstall-headers
-( cd examples; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
install-doc: installdirs
$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
-( if test -d doc ; then \
cd doc && \
${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
fi )
uninstall-doc:
-( cd $(DESTDIR)$(docdir) && ${RM} ${OTHER_INSTALLED_DOCS} )
-( if test -d doc ; then \
cd doc && \
${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} uninstall; \
fi )
TAGS: force
-( cd $(srcdir) && $(ETAGS) $(CSOURCES) $(HSOURCES) )
tags: force
-( cd $(srcdir) && $(CTAGS) $(CSOURCES) $(HSOURCES) )
clean: force
$(RM) $(OBJECTS) $(STATIC_LIBS)
$(RM) readline readline.exe
( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
mostlyclean: clean
( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
distclean maintainer-clean: clean
( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
$(RM) Makefile
$(RM) $(CREATED_CONFIGURE)
$(RM) $(CREATED_TAGS)
readline.pc: config.status $(srcdir)/readline.pc.in
$(SHELL) config.status
info dvi html pdf ps:
-( cd doc && $(MAKE) $(MFLAGS) $@ )
install-info:
install-dvi:
install-html:
install-pdf:
install-ps:
check:
installcheck:
dist: force
@echo Readline distributions are created using $(srcdir)/support/mkdist.
@echo Here is a sample of the necessary commands:
@echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
@echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
@echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
# Dependencies
bind.o: ansi_stdlib.h posixstat.h
bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
bind.o: history.h
callback.o: rlconf.h
callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
compat.o: ${BUILD_DIR}/config.h
compat.o: rlstdc.h rltypedefs.h
complete.o: ansi_stdlib.h posixdir.h posixstat.h
complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
display.o: ansi_stdlib.h posixstat.h
display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
display.o: tcap.h
display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
display.o: history.h rlstdc.h
funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
funmap.o: ${BUILD_DIR}/config.h
histexpand.o: ansi_stdlib.h
histexpand.o: history.h histlib.h rlstdc.h rltypedefs.h
histexpand.o: ${BUILD_DIR}/config.h
histfile.o: ansi_stdlib.h
histfile.o: history.h histlib.h rlstdc.h rltypedefs.h
histfile.o: ${BUILD_DIR}/config.h
history.o: ansi_stdlib.h
history.o: history.h histlib.h rlstdc.h rltypedefs.h
history.o: ${BUILD_DIR}/config.h
histsearch.o: ansi_stdlib.h
histsearch.o: history.h histlib.h rlstdc.h rltypedefs.h
histsearch.o: ${BUILD_DIR}/config.h
input.o: ansi_stdlib.h
input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
isearch.o: ansi_stdlib.h history.h rlstdc.h
keymaps.o: emacs_keymap.c vi_keymap.c
keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
kill.o: ansi_stdlib.h
kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
kill.o: history.h rlstdc.h
macro.o: ansi_stdlib.h
macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
macro.o: history.h rlstdc.h
mbutil.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
mbutil.o: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
misc.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
misc.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
misc.o: history.h rlstdc.h ansi_stdlib.h
nls.o: ansi_stdlib.h
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
nls.o: history.h rlstdc.h
parens.o: rlconf.h
parens.o: ${BUILD_DIR}/config.h
parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
readline.o: history.h rlstdc.h
readline.o: posixstat.h ansi_stdlib.h posixjmp.h
rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
rltty.o: rltty.h
rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
savestring.o: ${BUILD_DIR}/config.h
search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
search.o: ansi_stdlib.h history.h rlstdc.h
shell.o: ${BUILD_DIR}/config.h
shell.o: ansi_stdlib.h
signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
signals.o: history.h rlstdc.h
terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
terminal.o: tcap.h
terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
terminal.o: history.h rlstdc.h
text.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
text.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
text.o: history.h rlstdc.h ansi_stdlib.h
tilde.o: ansi_stdlib.h
tilde.o: ${BUILD_DIR}/config.h
tilde.o: tilde.h
undo.o: ansi_stdlib.h
undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
undo.o: history.h rlstdc.h
util.o: posixjmp.h ansi_stdlib.h
util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
vi_mode.o: history.h ansi_stdlib.h rlstdc.h
xfree.o: ${BUILD_DIR}/config.h
xfree.o: ansi_stdlib.h
xmalloc.o: ${BUILD_DIR}/config.h
xmalloc.o: ansi_stdlib.h
colors.o: ${BUILD_DIR}/config.h colors.h
colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
colors.o: rlconf.h
colors.o: ansi_stdlib.h posixstat.h
parse-colors.o: ${BUILD_DIR}/config.h colors.h parse-colors.h
parse-colors.o: rldefs.h rlconf.h
parse-colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
bind.o: rlshell.h
histfile.o: rlshell.h
nls.o: rlshell.h
readline.o: rlshell.h
shell.o: rlshell.h
terminal.o: rlshell.h
histexpand.o: rlshell.h
bind.o: rlprivate.h
callback.o: rlprivate.h
complete.o: rlprivate.h
display.o: rlprivate.h
input.o: rlprivate.h
isearch.o: rlprivate.h
kill.o: rlprivate.h
macro.o: rlprivate.h
mbutil.o: rlprivate.h
misc.o: rlprivate.h
nls.o: rlprivate.h
parens.o: rlprivate.h
readline.o: rlprivate.h
rltty.o: rlprivate.h
search.o: rlprivate.h
signals.o: rlprivate.h
terminal.o: rlprivate.h
text.o: rlprivate.h
undo.o: rlprivate.h
util.o: rlprivate.h
vi_mode.o: rlprivate.h
colors.o: rlprivate.h
parse-colors.o: rlprivate.h
bind.o: xmalloc.h
callback.o: xmalloc.h
complete.o: xmalloc.h
display.o: xmalloc.h
funmap.o: xmalloc.h
histexpand.o: xmalloc.h
histfile.o: xmalloc.h
history.o: xmalloc.h
input.o: xmalloc.h
isearch.o: xmalloc.h
keymaps.o: xmalloc.h
kill.o: xmalloc.h
macro.o: xmalloc.h
mbutil.o: xmalloc.h
misc.o: xmalloc.h
readline.o: xmalloc.h
savestring.o: xmalloc.h
search.o: xmalloc.h
shell.o: xmalloc.h
terminal.o: xmalloc.h
text.o: xmalloc.h
tilde.o: xmalloc.h
undo.o: xmalloc.h
util.o: xmalloc.h
vi_mode.o: xmalloc.h
xfree.o: xmalloc.h
xmalloc.o: xmalloc.h
colors.o: xmalloc.h
parse-colors.o: xmalloc.h
complete.o: rlmbutil.h
display.o: rlmbutil.h
histexpand.o: rlmbutil.h
input.o: rlmbutil.h
isearch.o: rlmbutil.h
mbutil.o: rlmbutil.h
misc.o: rlmbutil.h
readline.o: rlmbutil.h
search.o: rlmbutil.h
text.o: rlmbutil.h
vi_mode.o: rlmbutil.h
bind.o: $(srcdir)/bind.c
callback.o: $(srcdir)/callback.c
compat.o: $(srcdir)/compat.c
complete.o: $(srcdir)/complete.c
display.o: $(srcdir)/display.c
funmap.o: $(srcdir)/funmap.c
input.o: $(srcdir)/input.c
isearch.o: $(srcdir)/isearch.c
keymaps.o: $(srcdir)/keymaps.c $(srcdir)/emacs_keymap.c $(srcdir)/vi_keymap.c
kill.o: $(srcdir)/kill.c
macro.o: $(srcdir)/macro.c
mbutil.o: $(srcdir)/mbutil.c
misc.o: $(srcdir)/misc.c
nls.o: $(srcdir)/nls.c
parens.o: $(srcdir)/parens.c
readline.o: $(srcdir)/readline.c
rltty.o: $(srcdir)/rltty.c
savestring.o: $(srcdir)/savestring.c
search.o: $(srcdir)/search.c
shell.o: $(srcdir)/shell.c
signals.o: $(srcdir)/signals.c
terminal.o: $(srcdir)/terminal.c
text.o: $(srcdir)/text.c
tilde.o: $(srcdir)/tilde.c
undo.o: $(srcdir)/undo.c
util.o: $(srcdir)/util.c
vi_mode.o: $(srcdir)/vi_mode.c
xfree.o: $(srcdir)/xfree.c
xmalloc.o: $(srcdir)/xmalloc.c
colors.o: $(srcdir)/parse-colors.c
parse-colors.o: $(srcdir)/parse-colors.c
histexpand.o: $(srcdir)/histexpand.c
histfile.o: $(srcdir)/histfile.c
history.o: $(srcdir)/history.c
histsearch.o: $(srcdir)/histsearch.c
bind.o: bind.c
callback.o: callback.c
compat.o: compat.c
complete.o: complete.c
display.o: display.c
funmap.o: funmap.c
input.o: input.c
isearch.o: isearch.c
keymaps.o: keymaps.c emacs_keymap.c vi_keymap.c
kill.o: kill.c
macro.o: macro.c
mbutil.o: mbutil.c
misc.o: misc.c
nls.o: nls.c
parens.o: parens.c
readline.o: readline.c
rltty.o: rltty.c
savestring.o: savestring.c
search.o: search.c
shell.o: shell.c
signals.o: signals.c
terminal.o: terminal.c
text.o: text.c
tilde.o: tilde.c
undo.o: undo.c
util.o: util.c
vi_mode.o: vi_mode.c
xfree.o: xfree.c
xmalloc.o: xmalloc.c
histexpand.o: histexpand.c
histfile.o: histfile.c
history.o: history.c
histsearch.o: histsearch.c

196
readline/readline/README Normal file
View File

@ -0,0 +1,196 @@
Introduction
============
This is the Gnu Readline library, version 8.0.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
Emacs and vi editing modes are available. The Readline library includes
additional functions to maintain a list of previously-entered command
lines, to recall and perhaps reedit those lines, and perform csh-like
history expansion on previous commands.
The history facilites are also placed into a separate library, the
History library, as part of the build process. The History library
may be used without Readline in applications which desire its
capabilities.
The Readline library is free software, distributed under the terms of
the [GNU] General Public License as published by the Free Software
Foundation, version 3 of the License. For more information, see the
file COPYING.
To build the library, try typing `./configure', then `make'. The
configuration process is automated, so no further intervention should
be necessary. Readline builds with `gcc' by default if it is
available. If you want to use `cc' instead, type
CC=cc ./configure
if you are using a Bourne-style shell. If you are not, the following
may work:
env CC=cc ./configure
Read the file INSTALL in this directory for more information about how
to customize and control the build process.
The file rlconf.h contains C preprocessor defines that enable and disable
certain Readline features.
The special make target `everything' will build the static and shared
libraries (if the target platform supports them) and the examples.
Examples
========
There are several example programs that use Readline features in the
examples directory. The `rl' program is of particular interest. It
is a command-line interface to Readline, suitable for use in shell
scripts in place of `read'.
Shared Libraries
================
There is skeletal support for building shared versions of the
Readline and History libraries. The configure script creates
a Makefile in the `shlib' subdirectory, and typing `make shared'
will cause shared versions of the Readline and History libraries
to be built on supported platforms.
If `configure' is given the `--enable-shared' option, it will attempt
to build the shared libraries by default on supported platforms.
Configure calls the script support/shobj-conf to test whether or
not shared library creation is supported and to generate the values
of variables that are substituted into shlib/Makefile. If you
try to build shared libraries on an unsupported platform, `make'
will display a message asking you to update support/shobj-conf for
your platform.
If you need to update support/shobj-conf, you will need to create
a `stanza' for your operating system and compiler. The script uses
the value of host_os and ${CC} as determined by configure. For
instance, FreeBSD 4.2 with any version of gcc is identified as
`freebsd4.2-gcc*'.
In the stanza for your operating system-compiler pair, you will need to
define several variables. They are:
SHOBJ_CC The C compiler used to compile source files into shareable
object files. This is normally set to the value of ${CC}
by configure, and should not need to be changed.
SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create
position-independent code. If you are using gcc, this
should probably be set to `-fpic'.
SHOBJ_LD The link editor to be used to create the shared library from
the object files created by $SHOBJ_CC. If you are using
gcc, a value of `gcc' will probably work.
SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation.
If you are using gcc, `-shared' may be all that is necessary.
These should be the flags needed for generic shared object
creation.
SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
creation. Many systems use the -R option to the link
editor to embed a path within the library for run-time
library searches. A reasonable value for such systems would
be `-R$(libdir)'.
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
SHLIB_LIBPREF The prefix to use when generating the filename of the shared
library. The default is `lib'; Cygwin uses `cyg'.
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
generating the filename of the shared library. Many systems
use `so'; HP-UX uses `sl'.
SHLIB_LIBVERSION The string to append to the filename to indicate the version
of the shared library. It should begin with $(SHLIB_LIBSUFF),
and possibly include version information that allows the
run-time loader to load the version of the shared library
appropriate for a particular program. Systems using shared
libraries similar to SunOS 4.x use major and minor library
version numbers; for those systems a value of
`$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
Systems based on System V Release 4 don't use minor version
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
Other Unix versions use different schemes.
SHLIB_DLLVERSION The version number for shared libraries that determines API
compatibility between readline versions and the underlying
system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
can be overridden at configuration time by defining DLLVERSION
in the environment.
SHLIB_DOT The character used to separate the name of the shared library
from the suffix and version information. The default is `.';
systems like Cygwin which don't separate version information
from the library name should set this to the empty string.
SHLIB_STATUS Set this to `supported' when you have defined the other
necessary variables. Make uses this to determine whether
or not shared library creation should be attempted.
You should look at the existing stanzas in support/shobj-conf for ideas.
Once you have updated support/shobj-conf, re-run configure and type
`make shared'. The shared libraries will be created in the shlib
subdirectory.
If shared libraries are created, `make install' will install them.
You may install only the shared libraries by running `make
install-shared' from the top-level build directory. Running `make
install' in the shlib subdirectory will also work. If you don't want
to install any created shared libraries, run `make install-static'.
Documentation
=============
The documentation for the Readline and History libraries appears in
the `doc' subdirectory. There are three texinfo files and a
Unix-style manual page describing the facilities available in the
Readline library. The texinfo files include both user and
programmer's manuals. HTML versions of the manuals appear in the
`doc' subdirectory as well.
Usage
=====
Our position on the use of Readline through a shared-library linking
mechanism is that there is no legal difference between shared-library
linking and static linking--either kind of linking combines various
modules into a single larger work. The conditions for using Readline
in a larger work are stated in section 3 of the GNU GPL.
Reporting Bugs
==============
Bug reports for Readline should be sent to:
bug-readline@gnu.org
When reporting a bug, please include the following information:
* the version number and release status of Readline (e.g., 4.2-release)
* the machine and OS that it is running on
* a list of the compilation flags or the contents of `config.h', if
appropriate
* a description of the bug
* a recipe for recreating the bug reliably
* a fix for the bug if you have one!
If you would like to contact the Readline maintainer directly, send mail
to bash-maintainers@gnu.org.
Since Readline is developed along with bash, the bug-bash@gnu.org mailing
list (mirrored to the Usenet newsgroup gnu.bash.bug) often contains
Readline bug reports and fixes.
Chet Ramey
chet.ramey@case.edu

4262
readline/readline/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

8203
readline/readline/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,320 @@
dnl
dnl Configure script for readline library
dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 1987-2018 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Readline 8.0, version 2.85])
m4_include([../../config/override.m4])
AC_INIT(readline, 8.0, bug-readline@gnu.org)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(readline.h)
dnl GDB LOCAL
dnl AC_CONFIG_AUX_DIR(./support)
AC_CONFIG_AUX_DIR(../..)
AC_CONFIG_HEADERS(config.h)
dnl update the value of RL_READLINE_VERSION in readline.h when this changes
LIBVERSION=8.0
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
dnl configure defaults
opt_curses=no
dnl arguments to configure
AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
if test "$opt_curses" = "yes"; then
prefer_curses=yes
fi
dnl option parsing for optional features
opt_multibyte=yes
opt_static_libs=yes
opt_shared_libs=no
opt_install_examples=no
AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
dnl AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
AC_ARG_ENABLE(install-examples, AC_HELP_STRING([--disable-install-examples], [don't install examples [[default=install]]]), opt_install_examples=$enableval)
if test $opt_multibyte = no; then
AC_DEFINE(NO_MULTIBYTE_SUPPORT)
fi
dnl load up the cross-building cache file -- add more cases and cache
dnl files as necessary
dnl Note that host and target machine are the same, and different than the
dnl build machine.
CROSS_COMPILE=
if test "x$cross_compiling" = "xyes"; then
case "${host}" in
*-cygwin*)
cross_cache=${srcdir}/cross-build/cygwin.cache
;;
*-mingw*)
cross_cache=${srcdir}/cross-build/mingw.cache
;;
i[[3456]]86-*-beos*)
cross_cache=${srcdir}/cross-build/x86-beos.cache
;;
*) echo "configure: cross-compiling for $host is not supported" >&2
;;
esac
if test -n "${cross_cache}" && test -r "${cross_cache}"; then
echo "loading cross-build cache file ${cross_cache}"
. ${cross_cache}
fi
unset cross_cache
CROSS_COMPILE='-DCROSS_COMPILING'
AC_SUBST(CROSS_COMPILE)
fi
echo ""
echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
echo ""
# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_MAKE_SET
AC_PROG_CC
dnl AC_AIX
AC_MINIX
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_CHECK_TOOL(AR, ar)
dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
dnl This allows people to set it when running configure or make
test -n "$ARFLAGS" || ARFLAGS="cr"
AC_PROG_RANLIB
MAKE_SHELL=/bin/sh
AC_SUBST(MAKE_SHELL)
AC_C_CONST
AC_C_PROTOTYPES
AC_C_CHAR_UNSIGNED
AC_C_VOLATILE
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, int)
AC_HEADER_STDC
AC_HEADER_STAT
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl kill lstat readlink)
AC_CHECK_FUNCS(fnmatch memmove pselect putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf)
AC_CHECK_FUNCS(isascii isxdigit)
AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
AC_FUNC_CHOWN
AC_FUNC_STRCOLL
AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h stdbool.h \
string.h strings.h \
limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h)
AC_CHECK_HEADERS(sys/ioctl.h sys/pte.h sys/stream.h sys/select.h sys/file.h)
AC_CHECK_HEADERS(sys/ptem.h,,,
[[
#if HAVE_SYS_STREAM_H
# include <sys/stream.h>
#endif
]])
AC_SYS_LARGEFILE
BASH_SYS_SIGNAL_VINTAGE
BASH_SYS_REINSTALL_SIGHANDLERS
BASH_FUNC_POSIX_SETJMP
BASH_FUNC_LSTAT
BASH_FUNC_STRCOLL
BASH_FUNC_CTYPE_NONASCII
BASH_CHECK_GETPW_FUNCS
AC_HEADER_TIOCGWINSZ
BASH_TYPE_SIG_ATOMIC_T
BASH_TYPE_SIGHANDLER
BASH_HAVE_TIOCSTAT
BASH_HAVE_FIONREAD
BASH_CHECK_SPEED_T
BASH_STRUCT_WINSIZE
BASH_STRUCT_DIRENT_D_INO
BASH_STRUCT_DIRENT_D_FILENO
AC_CHECK_HEADERS(libaudit.h)
AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include <linux/audit.h>]])
dnl yuck
case "$host_os" in
aix*) prefer_curses=yes ;;
esac
BASH_CHECK_LIB_TERMCAP
if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
if test "$prefer_curses" = yes; then
TERMCAP_LIB=-lcurses
else
TERMCAP_LIB=-ltermcap #default
fi
fi
# Windows ncurses installation
if test "$TERMCAP_LIB" = "-lncurses"; then
AC_CHECK_HEADERS(ncurses/termcap.h)
fi
case "$TERMCAP_LIB" in
-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
-lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;;
*) TERMCAP_PKG_CONFIG_LIB=termcap ;;
esac
BASH_CHECK_MULTIBYTE
case "$host_cpu" in
*cray*) LOCAL_CFLAGS=-DCRAY ;;
*s390*) LOCAL_CFLAGS=-fsigned-char ;;
esac
case "$host_os" in
isc*) LOCAL_CFLAGS=-Disc386 ;;
esac
# shared library configuration section
#
# Shared object configuration section. These values are generated by
# ${srcdir}/support/shobj-conf
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
# case "$SHLIB_LIBS" in
# *curses*|*termcap*|*termlib*) ;;
# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
# esac
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
AC_SUBST(SHOBJ_LDFLAGS)
AC_SUBST(SHOBJ_XLDFLAGS)
AC_SUBST(SHOBJ_LIBS)
AC_SUBST(SHOBJ_STATUS)
AC_SUBST(SHLIB_STATUS)
AC_SUBST(SHLIB_XLDFLAGS)
AC_SUBST(SHLIB_DOT)
AC_SUBST(SHLIB_LIBPREF)
AC_SUBST(SHLIB_LIBSUFF)
AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_DLLVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
# SHLIB_STATUS is either `supported' or `unsupported'. If it's
# `unsupported', turn off any default shared library building
if test "$SHLIB_STATUS" = 'unsupported'; then
opt_shared_libs=no
fi
# shared library versioning
# quoted for m4 so I can use character classes
SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
AC_SUBST(SHLIB_MAJOR)
AC_SUBST(SHLIB_MINOR)
fi
if test "$opt_static_libs" = "yes"; then
STATIC_TARGET=static
STATIC_INSTALL_TARGET=install-static
fi
if test "$opt_shared_libs" = "yes"; then
SHARED_TARGET=shared
SHARED_INSTALL_TARGET=install-shared
fi
AC_SUBST(STATIC_TARGET)
AC_SUBST(SHARED_TARGET)
AC_SUBST(STATIC_INSTALL_TARGET)
AC_SUBST(SHARED_INSTALL_TARGET)
if test "$opt_install_examples" = "yes"; then
EXAMPLES_INSTALL_TARGET=install-examples
fi
AC_SUBST(EXAMPLES_INSTALL_TARGET)
case "$build_os" in
msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
*) BUILD_DIR=`pwd` ;;
esac
case "$BUILD_DIR" in
*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
*) ;;
esac
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
AC_SUBST(LOCAL_CFLAGS)
AC_SUBST(LOCAL_LDFLAGS)
AC_SUBST(LOCAL_DEFS)
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
AC_SUBST(host_cpu)
AC_SUBST(host_os)
AC_SUBST(LIBVERSION)
AC_SUBST(TERMCAP_LIB)
AC_SUBST(TERMCAP_PKG_CONFIG_LIB)
AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc],
[
# Makefile uses this timestamp file to record whether config.h is up to date.
echo > stamp-h
])

View File

@ -1,4 +1,4 @@
2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2019-10-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* hsuser.texi (Using History Interactively): Disable !BashFeatures
@defcodeindex. Make the `Programming with GNU History' reference

View File

@ -1,4 +1,4 @@
2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2019-10-23 Jan Kratochvil <jan.kratochvil@redhat.com>
Imported readline 6.2, and upstream patch 001.

View File

@ -1,4 +1,4 @@
2004-11-04 Per Bothner <per@bothner.com>
2019-10-23 Per Bothner <per@bothner.com>
* pty.c: Import from screen-4.0.2.
* configure.in, Makefile.in, config.h.in: Set up autoconf handling,

View File

@ -1,4 +1,4 @@
2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
2019-10-23 Jan Kratochvil <jan.kratochvil@redhat.com>
Imported readline 6.2, and upstream patch 001.

Some files were not shown because too many files have changed in this diff Show More