[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] Linking Shared libreadline with(out) TERMCAP_LIB

From: Chet Ramey
Subject: Re: [Bug-readline] Linking Shared libreadline with(out) TERMCAP_LIB
Date: Tue, 15 Apr 2014 16:46:14 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 4/11/14, 4:11 PM, Дилян Палаузов wrote:
> Hello,
> when I do ./configure --with-curses the TERMCAP_LIB Makefile variable is
> filled with -lcurses, and when I do ./configure --without-curses,
> TERMCAP_LIB is -ltermcap .

OK, -ltermcap is the default.  The readline configure process will use that
if --with-curses isn't supplied and the configure macro that looks for a
ncurses/curses/termlib/termcap library comes up empty.

> In terms of support/shobj-conf, my system is "linux-gnu-gcc-unknown", so
> the case "linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo" on line 127 is called.
> My SHLIB_LIBS is empty, because only on cygwin* and mingw* TERMCAP_LIB is
> added to SHLIB_LIBS .

Because Unix systems allow the calling application to supply values for the
undefined BC, PC, and UP symbols, and Windows traditionally did not.

> In shlib/Makefile lines 175-182 the same linker parameters are used to link
> with libhistory and libreadline .  To my understanding, libhistory does not
> need TERMCAP_LIB, as the latter does not contain symbols libhistory needs,
> but despite of this, on mingw and cygwin, shlib/libhistory is linked with

Yes, both libraries use identical linking commands.

> On the other side, under Linux, shlib/libreadline is liked with:
> $(CC) -shared -Wl,-soname,libreadline.so.6.3 -L/usr/lib -L/lib
> -Wl,-rpath,/usr/lib -Wl,-soname,libreadline.so.6 -o libreadline.so.6.3
> readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so
> complete.so bind.so isearch.so display.so signals.so util.so kill.so
> undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so
> history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
> tilde.so colors.so parse-colors.so xmalloc.so xfree.so compat.so
> -> without passing TERMCAP_LIB, which leads to undefined symbols:
> nm shlib/libreadline.so.6.3 | grep " U " | grep -v GLIBC
>                  U BC
>                  U PC
>                  U tgetent
>                  U tgetflag
>                  U tgetnum
>                  U tgetstr
>                  U tgoto
>                  U tputs
>                  U UP

Correct.  Readline does not `overlink'; the application linking with
readline chooses which library to link with to satisfy the termcap library

The problem, if one exists, is probably in defaulting TERMCAP_LIB to

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]