diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-27 21:57:07 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-27 21:57:07 +0000 |
commit | 2c79b41903b9483e57ab646e1016a355a04c3df2 (patch) | |
tree | eb45702aee2dbcce056f9325db62aef4d82d58f3 /configure.ac | |
parent | bebdb0fda152a29d8e336408d2eee31d06bce0d7 (diff) |
Add ability to use system libedit and update bundled libedit.
The version of libedit that is bundled with asterisk is old and has some bugs.
This patch updates the bundled version of libedit within asterisk, and also
updates asterisk to use the system libedit instead if one is available (and
pkg-config is available). This review integrates several patches from other
users specifically kkm and tzafrir.
(closes issue #15929)
Reported by: kkm
Patches:
015929-astcli-editrc-trunk.240324.diff uploaded by kkm (license 888)
(issue #16858)
Reported by: jw-asterisk
(closes issue #17039)
Reported by: tzafrir
Patches:
0001-allow-using-system-copy-of-libedit.patch uploaded by tzafrir (license 46)
Review: https://reviewboard.asterisk.org/r/807/
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@280019 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index dfc45a5e8..295ba4342 100644 --- a/configure.ac +++ b/configure.ac @@ -336,6 +336,7 @@ AST_EXT_LIB_SETUP([JACK], [Jack Audio Connection Kit], [jack]) AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue]) AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap]) AST_LIBCURL_CHECK_CONFIG([], [7.10.1]) +AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit]) AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2]) AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl]) AST_EXT_LIB_SETUP([LUA], [Lua], [lua]) @@ -1959,6 +1960,51 @@ AC_SUBST(PBX_GTK2) AC_SUBST(GTK2_INCLUDE) AC_SUBST(GTK2_LIB) +PBX_LIBEDIT=0 +LIBEDIT_INCLUDE="-Ieditline -Ieditline/readline" +LIBEDIT_LIB= +LIBEDIT_EXTRA_LIB= +LIBEDIT_OBJ=editline/libedit.a +if test "${USE_LIBEDIT}" != "no"; then + AC_CHECK_TOOL(PKGCONFIG, pkg-config, no) + if test "${PKGCONFIG}" != "no"; then + if ${PKGCONFIG} --exists libedit; then + LIBEDIT_INCLUDE=$(${PKGCONFIG} libedit --cflags) + LIBEDIT_LIB=$(${PKGCONFIG} libedit --libs) + LIBEDIT_OBJ= + PBX_LIBEDIT=1 + AC_DEFINE([HAVE_LIBEDIT], 1, [Define if your system has the NetBSD Editline libraries.]) + fi + fi +fi +if test "${PBX_LIBEDIT}" != "1"; then + AC_CHECK_HEADER([vis.h], [HAS_VIS_H=yes], [HAS_VIS_H=no]) + if test "${HAS_VIS_H}" = "yes"; then + # We may need -lbsd + old_LIBS=${LIBS} + LIBS="" + AC_LINK_IFELSE( + AC_LANG_PROGRAM( + [#include <stdlib.h> + #include <vis.h>], [vis(NULL,0,0,0)]), + , + LIBS="-lbsd" + AC_LINK_IFELSE( + AC_LANG_PROGRAM( + [#include <stdlib.h> + #include <vis.h>], [vis(NULL,0,0,0)]), + LIBEDIT_EXTRA_LIB=$LIBS + ) + ) + LIBS=${old_LIBS} + fi +fi +AC_SUBST(PBX_LIBEDIT) +AC_SUBST(LIBEDIT_INCLUDE) +AC_SUBST(LIBEDIT_LIB) +AC_SUBST(LIBEDIT_EXTRA_LIB) +AC_SUBST(LIBEDIT_OBJ) + # build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred) # or iODBC |