From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15588 invoked by alias); 30 Dec 2011 09:43:34 -0000 Received: (qmail 15580 invoked by uid 22791); 30 Dec 2011 09:43:33 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Dec 2011 09:43:20 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 9EA4E1B401B for ; Fri, 30 Dec 2011 09:43:19 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: erc32: fix linking against local readline on modern (ncurses) systems Date: Fri, 30 Dec 2011 10:19:00 -0000 Message-Id: <1325238201-7982-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00900.txt.bz2 The current erc32 configure script only searches for -ltermcap to provide any termcap funcs (which readlines needs). When building against a local readline (which is static), we hit link failures like so: gcc ...-I/-D flags... -o sis \ sis.o exec.o erc32.o func.o help.o float.o \ ../../bfd/libbfd.a ../../opcodes/libopcodes.a \ ../../libiberty/libiberty.a -lz -lnsl \ ../../readline/libreadline.a -lm ../../readline/libreadline.a(display.o): In function 'cr': .../readline/display.c:2486: undefined reference to 'tputs' collect2: ld returned 1 exit status make[2]: *** [sis] Error 1 Use AC_SEARCH_LIBS to check for ncurses/curses (which should be the modern equivalent on most systems for libtermcap). Signed-off-by: Mike Frysinger 2011-12-30 Mike Frysinger * configure.ac: Change AC_CHECK_LIB to AC_SEARCH_LIBS, and add ncurses/curses to the library search list. * configure: Regenerated. --- sim/erc32/configure.ac | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/sim/erc32/configure.ac b/sim/erc32/configure.ac index 5a43b5e..59a000f 100644 --- a/sim/erc32/configure.ac +++ b/sim/erc32/configure.ac @@ -17,7 +17,8 @@ lose if test x$sim_cv_os_cygwin = xyes; then TERMCAP='`if test -r ../../libtermcap/libtermcap.a; then echo ../../libtermcap/libtermcap.a; else echo -ltermcap; fi` -luser32' else - AC_CHECK_LIB(termcap, main, TERMCAP=-ltermcap, TERMCAP="") + AC_SEARCH_LIBS(tputs, ncurses curses termcap, + [TERMCAP=$ac_cv_search_tputs], [TERMCAP=""]) fi AC_SUBST(TERMCAP) -- 1.7.6.1