[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, 23 Apr 2019 10:56:53 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/23/19 5:44 AM, Dmitrii Pasechnik wrote:

Responding to a five-year-old message?

> Why is this done? This is error-prone, as the linking application has to
> figure out which termcap library was meant to be used with the readline;
> one cannot assume that a random one would work just fine.

A "random" termcap library should be just fine, as long as it provides
the correct symbols. Readline is not "meant to be used" with any
particular termcap implementation; as long as it provides good information,
you can use anything.

> Without pkg-config supplying this info, this is hard, if not impossible.
> (and even with pkg-config supplying the correct extra -l..., this makes
> the setup more complicated than it should be).
> It appears that all major linux and *BSD distros
> simply patch readline to be linked with the appropriate termcap library.
> E.g. on Fedora 26:
> $ ldd /usr/lib64/libreadline.so
>         linux-vdso.so.1 (0x00007ffc12903000)
>         libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f28a631c000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007f28a5f47000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007f28a6794000)

This is a reasonable choice for a distribution to make. There's nothing
wrong with it.

>> The problem, if one exists, is probably in defaulting TERMCAP_LIB to
>> -ltermcap.
> this is certainly a bug, and it stems from BASH_CHECK_LIB_TERMCAP
> hardcoding the order of libraries to check, with termcap always first,
> regardless of --with-curses supplied, or not.
That's not the problem. TERMCAP_LIB has to default to *something* in the
case we're discussing: autoconf didn't find an appropriate library and
there will be undefined symbols.

I agree that --with-curses should inhibit checking for libtermcap using
AC_CHECK_LIB. If you have a patch for that, please send it.

> IMHO, termcap should not be checked if the option is on, at all.
> Anyway, with --with-curses supplied, termcap must to be checked ahead
> of tinfo/(n)curses.

I assume you mean --with-curses means that termcap must *not* be checked
before libtinfo/curses/ncurses/ncursesw.

> I'd be glad to supply patches for these two related issues.

Sure, please send them along. It might also be worthwhile to add a
--force-termcap (or similar) option to readline's configure script to
link the shared library against termcap/curses, as some distributions do.

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

reply via email to

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