From 69a350e3aea9d0b7327fb3206f41712062b877ff Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Fri, 14 Oct 2011 19:10:58 -0500 Subject: [PATCH 2/3] Remove build infrastructure for internal editline library. This removes the ability to build and link to the internal editline library in favor of always linking against an external editline library. --- configure.ac | 29 +++++------------------------ main/Makefile | 21 ++++++++------------- makeopts.in | 2 -- 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/configure.ac b/configure.ac index 440a52e..0339819 100644 --- a/configure.ac +++ b/configure.ac @@ -476,26 +476,6 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/event.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h]) -# Any one of these 4 packages support a mandatory requirement, so we want to check on them as early as possible. -AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], []) -AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], []) -AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h]) -AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h]) - -EDITLINE_LIB="" -if test "x$TERMCAP_LIB" != "x" ; then - EDITLINE_LIB="$TERMCAP_LIB" -elif test "x$TINFO_LIB" != "x" ; then - EDITLINE_LIB="$TINFO_LIB" -elif test "x$CURSES_LIB" != "x" ; then - EDITLINE_LIB="$CURSES_LIB" -elif test "x$NCURSES_LIB" != "x" ; then - EDITLINE_LIB="$NCURSES_LIB" -else - AC_MSG_ERROR([*** termcap support not found (on modern systems, this typically means the ncurses development package is missing)]) -fi -AC_SUBST(EDITLINE_LIB) - # Another mandatory item (unless it's explicitly disabled) AC_ARG_ENABLE([xmldoc], [AS_HELP_STRING([--disable-xmldoc], @@ -2196,16 +2176,14 @@ AC_SUBST(GTK2_INCLUDE) AC_SUBST(GTK2_LIB) PBX_LIBEDIT=0 -LIBEDIT_INCLUDE=-Ieditline/readline +LIBEDIT_INCLUDE= LIBEDIT_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 @@ -2214,7 +2192,10 @@ fi AC_SUBST(PBX_LIBEDIT) AC_SUBST(LIBEDIT_INCLUDE) AC_SUBST(LIBEDIT_LIB) -AC_SUBST(LIBEDIT_OBJ) +if test "${PBX_LIBEDIT}" != 1; then + AC_MSG_NOTICE(*** The NetBSD Editline development package is missing.) + exit 1 +fi # build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred) # or iODBC diff --git a/main/Makefile b/main/Makefile index a4fa7b5..5482c13 100644 --- a/main/Makefile +++ b/main/Makefile @@ -42,9 +42,9 @@ ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-gnueabi kfre ifneq (x$(CAP_LIB),x) AST_LIBS+=$(CAP_LIB) endif - AST_LIBS+=-lpthread $(EDITLINE_LIB) -lm -lresolv + AST_LIBS+=-lpthread -lm -lresolv else - AST_LIBS+=$(EDITLINE_LIB) -lm + AST_LIBS+=-lm endif ifneq ($(findstring BETTER_BACKTRACES,$(MENUSELECT_CFLAGS)),) @@ -81,11 +81,11 @@ ifneq ($(findstring $(OSARCH), mingw32 cygwin ),) ASTLINK+= -shared -Wl,--out-implib,libasterisk.a endif ifeq ($(OSARCH),NetBSD) - AST_LIBS+=-lpthread -lcrypto -lm -L/usr/pkg/lib $(EDITLINE_LIB) + AST_LIBS+=-lpthread -lcrypto -lm -L/usr/pkg/lib endif ifeq ($(OSARCH),OpenBSD) - AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB) + AST_LIBS+=-lcrypto -lpthread -lm endif ifeq ($(OSARCH),SunOS) @@ -109,10 +109,6 @@ endif .PHONY: CHECK_SUBDIR CHECK_SUBDIR: # do nothing, just make sure that we recurse in the subdir/ -editline/libedit.a: CHECK_SUBDIR - cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(_ASTCFLAGS:-Werror=) $(ASTCFLAGS))" LDFLAGS="$(_ASTLDFLAGS) $(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR) - $(MAKE) -C editline libedit.a - ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),) ast_expr2.c ast_expr2.h: ast_expr2.y else @@ -179,13 +175,13 @@ endif $(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\" -$(MAIN_TGT): $(OBJS) $(LIBEDIT_OBJ) $(AST_EMBED_LDSCRIPTS) +$(MAIN_TGT): $(OBJS) $(AST_EMBED_LDSCRIPTS) @$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS) - $(ECHO_PREFIX) echo " [LD] $(OBJS) $(LIBEDIT_OBJ) $(AST_EMBED_LDSCRIPTS) -> $@" + $(ECHO_PREFIX) echo " [LD] $(OBJS) $(AST_EMBED_LDSCRIPTS) -> $@" ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),) - $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) $(LIBEDIT_OBJ) $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS) $(LIBEDIT_LIB) + $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS) $(LIBEDIT_LIB) else - $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) $(LIBEDIT_OBJ) $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS) $(LIBEDIT_LIB) + $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS) $(LIBEDIT_LIB) endif ifeq ($(GNU_LD),1) @@ -197,6 +193,5 @@ endif clean:: rm -f asterisk rm -f asterisk.exports - @if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi @$(MAKE) -C stdtime clean rm -f libresample/src/*.o diff --git a/makeopts.in b/makeopts.in index 4db0e96..a47f858 100644 --- a/makeopts.in +++ b/makeopts.in @@ -118,8 +118,6 @@ CURSES_INCLUDE=@CURSES_INCLUDE@ CURSES_LIB=@CURSES_LIB@ CURSES_DIR=@CURSES_DIR@ -EDITLINE_LIB=@EDITLINE_LIB@ - FREETDS_INCLUDE=@FREETDS_INCLUDE@ FREETDS_LIB=@FREETDS_LIB@ -- 1.7.6.4