From 684df598448e9ba63d88cf806a6bc81b684e8e71 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 8 May 2006 15:24:52 +0000 Subject: [PATCH] add smarter checking for termcap support, which fixes a build problem when 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 | 8 ++++---- configure.ac | 27 ++++++++++++++++++++++----- makeopts.in | 3 +++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 628fab60e0..87c9bfdca1 100644 --- 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) diff --git a/configure.ac b/configure.ac index 0dd06da4f4..88dacbf2b6 100644 --- a/configure.ac +++ b/configure.ac @@ -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" diff --git a/makeopts.in b/makeopts.in index 69a53d6815..2e148f3b9b 100644 --- a/makeopts.in +++ b/makeopts.in @@ -101,3 +101,6 @@ CURSES_INCLUDE=@curses_INCLUDE@ NCURSES_LIB=@ncurses_LIB@ NCURSES_INCLUDE=@ncurses_INCLUDE@ + +EDITLINE_LIBS=@EDITLINE_LIBS@ +