Skip to content

Commit

Permalink
Completely unbundle libedit
Browse files Browse the repository at this point in the history
FS-353

Signed-off-by: Travis Cross <[email protected]>
  • Loading branch information
chewi authored and traviscross committed Mar 24, 2014
1 parent 1cde5f0 commit 8574988
Show file tree
Hide file tree
Showing 106 changed files with 94 additions and 24,047 deletions.
27 changes: 4 additions & 23 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ if HAVE_ODBC
CORE_CFLAGS += -DSWITCH_HAVE_ODBC $(ODBC_INC_FLAGS)
endif

if HAVE_LIBEDIT
CORE_CFLAGS += -I$(switch_srcdir)/libs/libedit/src -DSWITCH_HAVE_LIBEDIT
CORE_LIBS += libs/libedit/src/.libs/libedit.a
endif

if ENABLE_TIMERFD_WRAPPER
CORE_CFLAGS += -DTIMERFD_WRAP
endif
Expand All @@ -123,15 +118,11 @@ libfreeswitch_spandsp_la_SOURCES = libs/spandsp/src/plc.c libs/spandsp/src/alloc
libfreeswitch_spandsp_la_CFLAGS = -Ilibs/spandsp/src $(CORE_CFLAGS) $(AM_CFLAGS)
CORE_LIBS+=libfreeswitch_spandsp.la
lib_LTLIBRARIES = libfreeswitch.la
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(PLATFORM_CORE_LIBS)
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(PLATFORM_CORE_LIBS)
libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)

if HAVE_LIBEDIT
libfreeswitch_la_LIBADD += $(TINFO_LIBS)
endif

if HAVE_ODBC
libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
endif
Expand Down Expand Up @@ -301,13 +292,8 @@ bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode
##
fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm

if HAVE_LIBEDIT
fs_cli_CFLAGS += -DHAVE_EDITLINE -I$(switch_srcdir)/libs/libedit/src
fs_cli_LDADD = libs/libedit/src/.libs/libedit.a $(TINFO_LIBS)
endif
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS)


##
Expand Down Expand Up @@ -353,11 +339,6 @@ freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la

if HAVE_LIBEDIT
freeswitch_CFLAGS += -Ilibs/libedit/src -DSWITCH_HAVE_LIBEDIT
freeswitch_LDADD += libs/libedit/src/.libs/libedit.a $(TINFO_LIBS)
endif

if HAVE_ODBC
freeswitch_LDADD += $(ODBC_LIB_FLAGS)
endif
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ VERBOSE=false
BASEDIR=`pwd`;
LIBDIR=${BASEDIR}/libs;
SUBDIRS="apr \
libzrtp ilbc iksemel js js/nsprpub ldns libdingaling libedit libsndfile sofia-sip \
libzrtp ilbc iksemel js js/nsprpub ldns libdingaling libsndfile sofia-sip \
speex sqlite srtp openzap freetdm spandsp libg722_1 portaudio unimrcp tiff-4.0.2 broadvoice silk libcodec2 \
fs";

Expand Down
15 changes: 0 additions & 15 deletions cmake_modules/FindLibedit.cmake

This file was deleted.

39 changes: 21 additions & 18 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR([src/switch.c])
AC_CONFIG_HEADER([src/include/switch_private.h])
AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h])
AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h])

AC_PREFIX_DEFAULT(/usr/local/freeswitch)
Expand Down Expand Up @@ -1079,20 +1080,27 @@ PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])

AC_ARG_ENABLE(core-libedit-support,
[AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])], [enable_core_libedit_support="$enableval"], [enable_core_libedit_support="yes"])
[AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])

if test "$enable_core_libedit_support" = "yes" ; then
AC_CHECK_LIB(tinfo, tgetent, [have_libtinfo="yes"], [have_libtinfo="no"])
if test "$have_libtinfo" == "yes" ; then
TINFO_LIBS="-ltinfo"
else
TINFO_LIBS=""
AC_CHECK_LIB(ncurses, tgetent,,
[AC_CHECK_LIB(curses, tgetent,,
[AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
fi
AC_SUBST(TINFO_LIBS)
fi
case x$enable_core_libedit_support in
xno) ;;
xyes) PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11]) ;;
*) PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],, [AC_MSG_RESULT([no]); enable_core_libedit_support=no]) ;;
esac

AS_IF([test "x$enable_core_libedit_support" != "xno"], [
# If making changes here, don't forget to run autoheader and
# update libs/esl/src/include/esl_config_auto.h.in manually.
AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
save_LIBS="${LIBS}"
save_CPPFLAGS="${CPPFLAGS}"
LIBS="${LIBEDIT_LIBS}"
CPPFLAGS="${LIBEDIT_CFLAGS}"
AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
AC_CHECK_FUNCS([el_wset])
LIBS="${save_LIBS}"
CPPFLAGS="${save_CPPFLAGS}"
])

SAC_OPENSSL

Expand All @@ -1118,7 +1126,6 @@ AC_ARG_ENABLE(parallel-build-v8,
AM_CONDITIONAL([ENABLE_PARALLEL_BUILD_V8],[test "x$enable_parallel_build_v8" != "xno"])

AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
AM_CONDITIONAL([HAVE_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"])
AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])

#
Expand Down Expand Up @@ -1518,10 +1525,6 @@ ac_configure_args="$ac_configure_args CONFIGURE_CFLAGS='$CFLAGS' CONFIGURE_CXXFL
# Run configure in all the subdirs
AC_CONFIG_SUBDIRS([libs/srtp])
AC_CONFIG_SUBDIRS([libs/sqlite])
if test "$enable_core_libedit_support" = "yes" ; then
AC_CONFIG_SUBDIRS([libs/libedit])
fi

AC_CONFIG_SUBDIRS([libs/apr])
AC_CONFIG_SUBDIRS([libs/apr-util])
AC_CONFIG_SUBDIRS([libs/ilbc])
Expand Down
1 change: 1 addition & 0 deletions debian/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ Build-Depends:
dpkg-dev (>= 1.15.8.12), gcc (>= 4:4.4.5), g++ (>= 4:4.4.5),
libc6-dev (>= 2.11.3), make (>= 3.81),
libpcre3-dev,
libedit-dev (>= 2.11),
wget, pkg-config,
# core codecs
libogg-dev, libspeex-dev, libspeexdsp-dev,
Expand Down
11 changes: 0 additions & 11 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -1831,17 +1831,6 @@ Files: libs/libwebsockets/win32port/win32helpers/getopt_long.c
Copyright: 1987-1996, The Regents of the University of California.
License: BSD-4-clause

Files: libs/libedit/*
Copyright: 1992, 1993 The Regents of the University of California.
1997-2005 The NetBSD Foundation, Inc.
1998 Todd C. Miller <[email protected]>
License: BSD-3-clause

Files: libs/libedit/src/strlcat.c
libs/libedit/src/strlcpy.c
Copyright: 1998 Todd C. Miller <[email protected]>
License: ISC

Files: libs/esl/*
Copyright: 2007 Michael Jerris
2002 Todd C. Miller <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ SEARCH_INCLUDES = YES

INCLUDE_PATH =../libs/apr ../libs/apr-util \
../libs/iksemel ../libs/ilbc ../libs/js \
../libs/libedit ../libs/libg722_1 ../libs/libnatpmp \
../libs/libg722_1 ../libs/libnatpmp \
../libs/libsndfile ../libs/miniupnpc \
../libs/portaudio ../libs/sofia-sip ../libs/spandsp \
../libs/sqlite ../libs/srtp \
Expand Down
22 changes: 0 additions & 22 deletions libs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -249,27 +249,6 @@ opal
/libdingaling/Makefile.in
/libdingaling/src/config.h
/libdingaling/src/stamp-h1
/libedit/config.h
/libedit/doc/editline.3
/libedit/doc/editrc.5
/libedit/doc/Makefile
/libedit/doc/Makefile.in
/libedit/examples/fileman
/libedit/examples/Makefile
/libedit/examples/Makefile.in
/libedit/examples/test
/libedit/Makefile
/libedit/Makefile.in
/libedit/src/common.h
/libedit/src/emacs.h
/libedit/src/fcns.c
/libedit/src/fcns.h
/libedit/src/help.c
/libedit/src/help.h
/libedit/src/Makefile
/libedit/src/Makefile.in
/libedit/src/vi.h
/libedit/stamp-h1
/libg722_1/config-h.in
/libg722_1/doc/Makefile
/libg722_1/doc/Makefile.in
Expand Down Expand Up @@ -905,7 +884,6 @@ opal
!/yaml/configure
broadvoice/config/compile
ilbc/config/compile
libedit/compile
libg722_1/config/compile
pcre/compile
spandsp/config/compile
Expand Down
1 change: 1 addition & 0 deletions libs/esl/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ eslmake.rules
testserver_fork
Makefile
Makefile.in
/src/include/esl_config_auto.h
11 changes: 3 additions & 8 deletions libs/esl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,9 @@ bin_PROGRAMS = fs_cli ivrd
noinst_PROGRAMS = testclient testserver testserver_fork

fs_cli_SOURCES = fs_cli.c
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
fs_cli_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS) $(LIBS)
fs_cli_LDADD = libesl.la

if HAVE_LIBEDIT
fs_cli_CFLAGS += -DHAVE_EDITLINE -I$(switch_srcdir)/libs/libedit/src
fs_cli_LDADD += ../libedit/src/.libs/libedit.a $(TINFO_LIBS)
endif
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
fs_cli_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(LIBEDIT_LIBS)
fs_cli_LDADD = libesl.la

testclient_SOURCES = testclient.c
testclient_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
Expand Down
1 change: 0 additions & 1 deletion libs/esl/eslmake.rules.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
TINFO_LIBS=@TINFO_LIBS@
SYSTEM_CFLAGS=@CFLAGS@
SYSTEM_LDFLAGS=@LDFLAGS@
CXX=@CXX@
Expand Down
Loading

0 comments on commit 8574988

Please sign in to comment.