Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
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	[thread overview]
Message-ID: <1325238201-7982-1-git-send-email-vapier@gentoo.org> (raw)

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 <vapier@gentoo.org>

2011-12-30  Mike Frysinger  <vapier@gentoo.org>

	* 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


             reply	other threads:[~2011-12-30  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30 10:19 Mike Frysinger [this message]
2011-12-30 10:39 ` Joel Brobecker
2011-12-31  2:57   ` Mike Frysinger
2011-12-31  3:39     ` Joel Brobecker
2011-12-31  7:27 ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325238201-7982-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox