add smarter checking for termcap support, which fixes a build problem when
authorRussell Bryant <russell@russellbryant.com>
Mon, 8 May 2006 15:24:52 +0000 (15:24 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 8 May 2006 15:24:52 +0000 (15:24 +0000)
ncurses is statically compiled with term info support, which is provided in
the statically compiled editline library that we are including.
(issue #6948, original patch by casper, modified to use the features
of AST_EXT_LIB)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25611 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
configure.ac
makeopts.in

index 628fab6..87c9bfd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -365,9 +365,9 @@ ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),)
 endif
 
 ifeq ($(OSARCH),Linux)
-  LIBS+=-ldl -lpthread -lncurses -lm -lresolv  #-lnjamd
+  LIBS+=-ldl -lpthread $(EDITLINE_LIBS) -lm -lresolv  #-lnjamd
 else
-  LIBS+=-lncurses -lm
+  LIBS+=$(EDITLINE_LIBS) -lm
 endif
 
 ifeq ($(OSARCH),Darwin)
@@ -395,11 +395,11 @@ ifeq ($(OSARCH),FreeBSD)
 endif
 
 ifeq ($(OSARCH),NetBSD)
-  LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses
+  LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib $(EDITLINE_LIBS)
 endif
 
 ifeq ($(OSARCH),OpenBSD)
-  LIBS+=-lcrypto -lpthread -lm -lncurses
+  LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIBS)
 endif
 
 ifeq ($(OSARCH),SunOS)
index 0dd06da..88dacbf 100644 (file)
@@ -171,9 +171,26 @@ AST_EXT_LIB([speex], [speex_encode], [speex/speex.h], [SPEEX], [Speex], [-lm])
 AST_EXT_LIB([sqlite], [sqlite_exec], [sqlite.h], [SQLITE], [SQLite])
 AST_EXT_LIB([ssl], [ssl2_connect], [openssl/ssl.h], [OPENSSL], [OpenSSL], [-lcrypto])
 AST_EXT_LIB([tds], [tds_version], [tds.h], [FREETDS], [FreeTDS])
+AST_EXT_LIB([termcap], [tgetent], [], [TERMCAP], [Termcap])
+AST_EXT_LIB([tinfo], [tgetent], [], [TINFO], [Term Info])
 AST_EXT_LIB([vorbis], [vorbis_info_init], [vorbis/codec.h], [VORBIS], [Vorbis], [-lm -lvorbisenc])
 AST_EXT_LIB([z], [compress], [zlib.h], [ZLIB], [zlib])
 
+EDITLINE_LIBS=""
+if test "x$termcap_LIB" != "x" ; then
+  EDITLINE_LIBS="$termcap_LIB"
+elif test "x$tinfo_LIB" != "x" ; then
+  EDITLINE_LIBS="$tinfo_LIB"
+elif test "x$curses_LIB" != "x" ; then
+  EDITLINE_LIBS="$curses_LIB"
+elif test "x$ncurses_LIB" != "x" ; then
+  EDITLINE_LIBS="$ncurses_LIB"
+else
+  echo "*** termcap support not found"
+  exit 1
+fi
+AC_SUBST(EDITLINE_LIBS)
+
 PBX_LIBossaudio=0
 AC_CHECK_HEADER([linux/soundcard.h],
                [
@@ -339,7 +356,7 @@ case ${withval} in
 esac
 ])
 if test "${USE_VPB}" != "no"; then
-   echo -n "checking for vpb_open in -lvpb..."
+   echo -n "checking for vpb_open in -lvpb... "
    saved_libs="${LIBS}"
    saved_cppflags="${CPPFLAGS}"
    if test "x${VPB_DIR}" != "x"; then
@@ -401,7 +418,7 @@ esac
 
 PBX_QT=0
 if test "${USE_QT}" != "no"; then
-   echo -n "checking for QDate in -lqt..."
+   echo -n "checking for QDate in -lqt... "
    saved_libs="${LIBS}"
    saved_cppflags="${CPPFLAGS}"
    if test "x${QT_DIR}" != "x"; then
@@ -487,7 +504,7 @@ esac
 
 PBX_KDE=0
 if test "${USE_KDE}" != "no"; then
-   echo -n "checking for crashHandler in -lkdecore..."
+   echo -n "checking for crashHandler in -lkdecore... "
    saved_ldflags="${LDFLAGS}"
    LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR}/lib -lkdecore"
        AC_LINK_IFELSE(
@@ -566,7 +583,7 @@ case ${withval} in
 esac
 ])
 if test "${USE_PWLIB}" != "no"; then
-       echo -n "checking for existence of pwlib..."
+       echo -n "checking for existence of pwlib... "
        
        saved_ldflags="${LDFLAGS}"
        LDFLAGS="${LDFLAGS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
@@ -696,7 +713,7 @@ echo
 
 echo "Package configured for: "
 echo " OS type  : $PBX_OSTYPE"
-echo " host cpu : $host_cpu"
+echo " Host CPU : $host_cpu"
 if test "x${crossCompile}" = xYes; then
    echo ""
    echo " Cross Compilation = YES"
index 69a53d6..2e148f3 100644 (file)
@@ -101,3 +101,6 @@ CURSES_INCLUDE=@curses_INCLUDE@
 
 NCURSES_LIB=@ncurses_LIB@
 NCURSES_INCLUDE=@ncurses_INCLUDE@
+
+EDITLINE_LIBS=@EDITLINE_LIBS@
+