提交 c5c13c26 authored 作者: Anthony Minessale's avatar Anthony Minessale

add --enable-core-libedit-support configure flag in case you want nicer command…

add --enable-core-libedit-support configure flag in case you want nicer command line stuff in the debug console (I know I do when I am coding dunno about you)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5044 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 01f9b3f1
......@@ -110,6 +110,11 @@ library_include_HEADERS += src/include/switch_odbc.h
CORE_LIBS += -lodbc
endif
if ADD_LIBEDIT
CORE_CFLAGS += -Ilibs/libedit/src -DSWITCH_HAVE_LIBEDIT
CORE_LIBS += libs/libedit/src/.libs/libedit.a
endif
lib_LTLIBRARIES = libfreeswitch.la
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS)
......@@ -127,7 +132,13 @@ freeswitch_SOURCES = src/switch.c
nodist_freeswitch_SOURCES = src/include/switch_version.h
freeswitch_CFLAGS = $(AM_CFLAGS)
freeswitch_LDFLAGS = $(AM_LDFLAGS) -rpath $(libdir)
freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la -ltermcap
libs/libedit/Makefile:
cd libs/libedit && ./configure --disable-shared --with-pic
libs/libedit/src/.libs/libedit.a: libs/libedit/Makefile
cd libs/libedit && $(MAKE)
$(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/quiet_libtool modules.conf
......
......@@ -317,11 +317,15 @@ AC_ARG_ENABLE(crash-protection,
AC_ARG_ENABLE(core-odbc-support,
[ --enable-core-odbc-support Compile with ODBC Support],,[enable_core_odbc_support="no"])
AC_ARG_ENABLE(core-libedit-support,
[ --enable-core-libedit-support Compile with libedit Support],,[enable_core_libedit_support="no"])
#AX_LIB_MYSQL([MINIMUM-VERSION])
AX_LIB_MYSQL
AM_CONDITIONAL([CRASHPROT],[test "x$enable_crash_prot" != "xno"])
AM_CONDITIONAL([ADD_ODBC],[test "x$enable_core_odbc_support" != "xno"])
AM_CONDITIONAL([ADD_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"])
AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
AC_CONFIG_FILES([Makefile
......
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.
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
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src examples doc
## GENERATED BY SCRIPT - DO NOT EDIT BELOW
EXTRA_DIST = patches/README \
patches/00-readline.h.patch \
patches/01-strlcat.c.patch \
patches/02-strlcpy.c.patch \
patches/03-vis.c.patch \
patches/04-unvis.c.patch \
patches/05-vis.h.patch \
patches/06-fgetln.c.patch \
patches/07-el_term.h.patch \
patches/08-el.c.patch \
patches/09-el.h.patch \
patches/10-filecomplete.c.patch \
patches/11-history.c.patch \
patches/12-readline.c.patch \
patches/13-search.c.patch \
patches/14-sys.h.patch \
patches/15-term.c.patch \
patches/16-tc1.c.patch \
patches/17-editline.3.roff.patch \
patches/18-editrc.5.roff.patch \
patches/cvs_export.sh \
patches/patches_make.sh \
patches/patches_apply.sh \
patches/patches_check.sh \
patches/extra_dist_list.sh \
patches/update_version.sh \
patches/update_dist.sh \
patches/timestamp.cvsexport
差异被折叠。
Thanks to the NetBSD Project maintainers of libedit!
dnl
dnl read lib version from file (and trim trailing newline)
dnl
define([EL_RELEASE], [patsubst(esyscmd([. src/shlib_version; echo $major.$minor]), [
])])
dnl
dnl read cvsexport timestamp from file (and trim trailing newline)
dnl
dnl define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([cat patches/timestamp.cvsexport]), [
define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([date +"%Y%m%d"]), [
])])
dnl
dnl NetBSD use the -mdoc macro package for manpages, but e.g.
dnl AIX and Solaris only support the -man package.
dnl
AC_DEFUN([EL_MANTYPE],
[
MANTYPE=
TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then
MANTYPE=mdoc
fi
AC_SUBST(MANTYPE)
])
dnl
dnl Check if getpwnam_r and getpwuid_r are POSIX.1 compatible
dnl POSIX draft version returns 'struct passwd *' (used on Solaris)
dnl NOTE: getpwent_r is not POSIX so we always use getpwent
dnl
AC_DEFUN([EL_GETPW_R_POSIX],
[
AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix like])
# The prototype for the POSIX version is:
# int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **)
# int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
AC_TRY_LINK([#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>],
[getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL);
getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
[AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
])
AC_DEFUN([EL_GETPW_R_DRAFT],
[
AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like])
# The prototype for the POSIX draft version is:
# struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
# struct passwd *getpwnam_r(char *, struct passwd *, char *, int);
AC_TRY_LINK([#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>],
[getpwnam_r(NULL, NULL, NULL, (size_t)0);
getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);],
[AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
])
差异被折叠。
差异被折叠。
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `endpwent' function. */
#undef HAVE_ENDPWENT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1
versions. */
#undef HAVE_GETPW_R_DRAFT
/* Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1
compatible. */
#undef HAVE_GETPW_R_POSIX
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isascii' function. */
#undef HAVE_ISASCII
/* Define to 1 if you have the `issetugid' function. */
#undef HAVE_ISSETUGID
/* Define to 1 if you have the `curses' library (-lcurses). */
#undef HAVE_LIBCURSES
/* Define to 1 if you have the `ncurses' library (-lncurses). */
#undef HAVE_LIBNCURSES
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the `memchr' function. */
#undef HAVE_MEMCHR
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the `regcomp' function. */
#undef HAVE_REGCOMP
/* Define to 1 if you have the `re_comp' function. */
#undef HAVE_RE_COMP
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the <sys/cdefs.h> header file. */
#undef HAVE_SYS_CDEFS_H
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `u_int32_t'. */
#undef HAVE_U_INT32_T
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Solaris's term.h does horrid things. */
#undef _SUNOS
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork
#include <sys.h>
#define SCCSID
#undef LIBC_SCCS
差异被折叠。
差异被折叠。
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT(libedit, [EL_RELEASE],, libedit-[EL_TIMESTAMP_CVSEXPORT])
AC_CONFIG_SRCDIR([src/strlcat.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AC_PROG_LIBTOOL
# libtool -version-info
AC_SUBST(LT_VERSION, [0:24:0])
# AC_PROG_LIBTOOL runs AC_CANONICAL_HOST
case $host in
*-sun-*) AC_DEFINE([_SUNOS], [], [Solaris's term.h does horrid things.]);;
esac
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_AWK
EL_MANTYPE
AC_CHECK_LIB(curses, tgetent,,
[AC_CHECK_LIB(ncurses, tgetent,,
[AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h])
AC_CHECK_HEADER([termios.h], [], [AC_MSG_ERROR([termios.h is required!])],[])
## include curses.h to prevent "Present But Cannot Be Compiled"
AC_CHECK_HEADERS([term.h],,,
[[#if HAVE_CURSES_H
# include <curses.h>
#elif HAVE_NCURSES_H
# include <ncurses.h>
#endif
]])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([u_int32_t])
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
## _AIX is offended by rpl_malloc and rpl_realloc
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strcspn strdup strerror strrchr strstr strtol issetugid])
EL_GETPW_R_POSIX
EL_GETPW_R_DRAFT
AH_BOTTOM([
#include <sys.h>
#define SCCSID
#undef LIBC_SCCS
])
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile
examples/Makefile])
AC_OUTPUT
差异被折叠。
EL_MANS = editline.3 editrc.5
man_MANS = $(EL_MANS)
EL_MAN_LINKS = el_init.3 el_end.3 el_reset.3 el_gets.3 el_getc.3 \
el_push.3 el_parse.3 el_set.3 el_get.3 el_source.3 \
el_resize.3 el_line.3 el_insertstr.3 el_deletestr.3 \
el_history_init.3 el_history_end.3 el_history.3 el_tok_init.3 \
el_tok_end.3 el_tok_reset.3 el_tok_line.3 el_tok_str.3
install-data-hook: $(EL_MAN_LINKS)
$(EL_MAN_LINKS):
(cd $(DESTDIR)$(man3dir) && rm -f $@ && $(LN_S) editline.3 $@)
$(EL_MANS):
if test "$(MANTYPE)" = "mdoc"; then\
cp $(srcdir)/$@.roff $@;\
else\
$(AWK) -f $(srcdir)/mdoc2man.awk $(srcdir)/$@.roff > $@ || rm -f $@;\
fi;
uninstall-local:
(cd $(DESTDIR)$(man3dir) && rm -f $(EL_MAN_LINKS))
CLEANFILES = $(EL_MANS)
EXTRA_DIST = editline.3.roff editrc.5.roff mdoc2man.awk
changelog.txt: ../ChangeLog
@sed 's/@/ (at)/g;s/</\&lt;/g;s/>/\&gt;/g;s/è/\&egrave;/g' $(srcdir)/$< > $@;
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
LDADD = $(top_builddir)/src/libedit.la
AM_CFLAGS = -I$(top_srcdir)/src
noinst_PROGRAMS = test fileman
test_SOURCES = test.c
fileman_SOURCES = fileman.c
差异被折叠。
差异被折叠。
/* $NetBSD: test.c,v 1.18 2005/06/01 11:37:52 lukem Exp $ */
/*-
* 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.
*/
/*
* test.c: A little test program
*/
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include "histedit.h"
/* from src/sys/sys/cdefs.h */
#ifndef __UNCONST
# define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif
static int continuation = 0;
volatile sig_atomic_t gotsig = 0;
static unsigned char complete(EditLine *, int);
int main(int, char **);
static char *prompt(EditLine *);
static void sig(int);
static char *
prompt(EditLine *el)
{
static char a[] = "Edit$ ";
static char b[] = "Edit> ";
return (continuation ? b : a);
}
static void
sig(int i)
{
gotsig = i;
}
static unsigned char
complete(EditLine *el, int ch)
{
DIR *dd = opendir(".");
struct dirent *dp;
const char* ptr;
const LineInfo *lf = el_line(el);
int len;
/*
* Find the last word
*/
for (ptr = lf->cursor - 1;
!isspace((unsigned char)*ptr) && ptr > lf->buffer; ptr--)
continue;
len = lf->cursor - ++ptr;
for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
if (len > strlen(dp->d_name))
continue;
if (strncmp(dp->d_name, ptr, len) == 0) {
closedir(dd);
if (el_insertstr(el, &dp->d_name[len]) == -1)
return (CC_ERROR);
else
return (CC_REFRESH);
}
}
closedir(dd);
return (CC_ERROR);
}
int
main(int argc, char *argv[])
{
EditLine *el = NULL;
int num;
const char *buf;
Tokenizer *tok;
#if 0
int lastevent = 0;
#endif
int ncontinuation;
History *hist;
HistEvent ev;
(void) signal(SIGINT, sig);
(void) signal(SIGQUIT, sig);
(void) signal(SIGHUP, sig);
(void) signal(SIGTERM, sig);
hist = history_init(); /* Init the builtin history */
/* Remember 100 events */
history(hist, &ev, H_SETSIZE, 100);
tok = tok_init(NULL); /* Initialize the tokenizer */
/* Initialize editline */
el = el_init(*argv, stdin, stdout, stderr);
el_set(el, EL_EDITOR, "vi"); /* Default editor is vi */
el_set(el, EL_SIGNAL, 1); /* Handle signals gracefully */
el_set(el, EL_PROMPT, prompt); /* Set the prompt function */
/* Tell editline to use this history interface */
el_set(el, EL_HIST, history, hist);
/* Add a user-defined function */
el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete);
/* Bind tab to it */
el_set(el, EL_BIND, "^I", "ed-complete", NULL);
/*
* Bind j, k in vi command mode to previous and next line, instead
* of previous and next history.
*/
el_set(el, EL_BIND, "-a", "k", "ed-prev-line", NULL);
el_set(el, EL_BIND, "-a", "j", "ed-next-line", NULL);
/*
* Source the user's defaults file.
*/
el_source(el, NULL);
while ((buf = el_gets(el, &num)) != NULL && num != 0) {
int ac, cc, co;
#ifdef DEBUG
int i;
#endif
const char **av;
const LineInfo *li;
li = el_line(el);
#ifdef DEBUG
(void) fprintf(stderr, "==> got %d %s", num, buf);
(void) fprintf(stderr, " > li `%.*s_%.*s'\n",
(li->cursor - li->buffer), li->buffer,
(li->lastchar - 1 - li->cursor),
(li->cursor >= li->lastchar) ? "" : li->cursor);
#endif
if (gotsig) {
(void) fprintf(stderr, "Got signal %d.\n", gotsig);
gotsig = 0;
el_reset(el);
}
if (!continuation && num == 1)
continue;
ac = cc = co = 0;
ncontinuation = tok_line(tok, li, &ac, &av, &cc, &co);
if (ncontinuation < 0) {
(void) fprintf(stderr, "Internal error\n");
continuation = 0;
continue;
}
#ifdef DEBUG
(void) fprintf(stderr, " > nc %d ac %d cc %d co %d\n",
ncontinuation, ac, cc, co);
#endif
#if 0
if (continuation) {
/*
* Append to the right event in case the user
* moved around in history.
*/
if (history(hist, &ev, H_SET, lastevent) == -1)
err(1, "%d: %s", lastevent, ev.str);
history(hist, &ev, H_ADD , buf);
} else {
history(hist, &ev, H_ENTER, buf);
lastevent = ev.num;
}
#else
/* Simpler */
history(hist, &ev, continuation ? H_APPEND : H_ENTER, buf);
#endif
continuation = ncontinuation;
ncontinuation = 0;
if (continuation)
continue;
#ifdef DEBUG
for (i = 0; i < ac; i++) {
(void) fprintf(stderr, " > arg# %2d ", i);
if (i != cc)
(void) fprintf(stderr, "`%s'\n", av[i]);
else
(void) fprintf(stderr, "`%.*s_%s'\n",
co, av[i], av[i] + co);
}
#endif
if (strcmp(av[0], "history") == 0) {
int rv;
switch (ac) {
case 1:
for (rv = history(hist, &ev, H_LAST); rv != -1;
rv = history(hist, &ev, H_PREV))
(void) fprintf(stdout, "%4d %s",
ev.num, ev.str);
break;
case 2:
if (strcmp(av[1], "clear") == 0)
history(hist, &ev, H_CLEAR);
else
goto badhist;
break;
case 3:
if (strcmp(av[1], "load") == 0)
history(hist, &ev, H_LOAD, av[2]);
else if (strcmp(av[1], "save") == 0)
history(hist, &ev, H_SAVE, av[2]);
break;
badhist:
default:
(void) fprintf(stderr,
"Bad history arguments\n");
break;
}
} else if (el_parse(el, ac, av) == -1) {
switch (fork()) {
case 0:
execvp(av[0], (char *const *)__UNCONST(av));
perror(av[0]);
_exit(1);
/*NOTREACHED*/
break;
case -1:
perror("fork");
break;
default:
if (wait(&num) == -1)
perror("wait");
(void) fprintf(stderr, "Exit %x\n", num);
break;
}
}
tok_reset(tok);
}
el_end(el);
tok_end(tok);
history_end(hist);
return (0);
}
差异被折叠。
差异被折叠。
差异被折叠。
--- export/src/editline/readline.h 2007-03-02 22:26:59.000000000 +0100
+++ ../src/editline/readline.h 2007-03-02 22:38:45.000000000 +0100
@@ -45,9 +45,11 @@
typedef char *CPFunction(const char *, int);
typedef char **CPPFunction(const char *, int, int);
+typedef void *histdata_t;
+
typedef struct _hist_entry {
const char *line;
- const char *data;
+ histdata_t *data;
} HIST_ENTRY;
typedef struct _keymap_entry {
@@ -68,7 +70,7 @@
#ifndef CTRL
#include <sys/ioctl.h>
-#if !defined(__sun__) && !defined(__hpux__)
+#ifdef __GLIBC__
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
--- export/src/strlcat.c 2007-03-02 22:26:59.000000000 +0100
+++ ../src/strlcat.c 2007-03-02 22:38:45.000000000 +0100
@@ -17,19 +17,12 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
+#include <config.h>
-#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: strlcat.c,v 1.2 2006/03/30 20:37:51 christos Exp $");
#endif /* LIBC_SCCS and not lint */
-#ifdef _LIBC
-#include "namespace.h"
-#endif
#include <sys/types.h>
#include <assert.h>
#include <string.h>
@@ -40,10 +33,6 @@
# endif
#endif
-#else
-#include <lib/libkern/libkern.h>
-#endif /* !_KERNEL && !_STANDALONE */
-
#if !HAVE_STRLCAT
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
--- export/src/strlcpy.c 2007-03-02 22:26:59.000000000 +0100
+++ ../src/strlcpy.c 2007-03-02 22:38:45.000000000 +0100
@@ -17,19 +17,12 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
+#include <config.h>
-#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: strlcpy.c,v 1.2 2006/03/30 20:37:51 christos Exp $");
#endif /* LIBC_SCCS and not lint */
-#ifdef _LIBC
-#include "namespace.h"
-#endif
#include <sys/types.h>
#include <assert.h>
#include <string.h>
@@ -39,10 +32,6 @@
__weak_alias(strlcpy, _strlcpy)
# endif
#endif
-#else
-#include <lib/libkern/libkern.h>
-#endif /* !_KERNEL && !_STANDALONE */
-
#if !HAVE_STRLCPY
/*
差异被折叠。
--- export/src/unvis.c 2007-03-02 22:26:59.000000000 +0100
+++ ../src/unvis.c 2007-03-02 22:38:45.000000000 +0100
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
+#include <config.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
@@ -38,7 +38,6 @@
#endif
#endif /* LIBC_SCCS and not lint */
-#include "namespace.h"
#include <sys/types.h>
#include <assert.h>
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论