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
> $TERM_CAP.

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
symbols.

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

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

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to