:: Re: [DNG] Managing shared libraries
Pàgina inicial
Delete this message
Reply to this message
Autor: aitor
Data:  
A: dng
Assumpte: Re: [DNG] Managing shared libraries
Hi Joel,

On 4/10/23 3:06, Joel Roth via Dng wrote:
> A likely way forward is to place the 6.3
> sources in /usr/include/readline and compile
> against that.


You can define a separate pkgconfig file for 6.3, say "readline6.pc", as follows:

prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=<put_here_the_path_you_want>

Name: Readline
Description: Gnu Readline library for command line editing
URL:http://tiswww.cwru.edu/php/chet/readline/rltop.html
Version: 6.3
Requires.private: tinfo
Libs: -L${libdir} -lreadline
Cflags: -I${includedir}


Note that I've also moved the path to the shared library from "/usr/lib/x86_64-linux-gnu"
to "/usr/lib". Obviously, you need to create the symlinks at "/usr/lib" for 6.3.

In doing so, both versions 6.3 and 8.2 can coexist.

Now, to link against version 6.3:

`pkg-config --cflags --libs readline6`


> I would also like to compile against 8.1, but can I (and do
> I need to) point the symlink at 8.1 without breaking things
> like bash that depend on version 8.2?


I don't think it would break bash. But this is a guess. Either way, you can always use LD_PRELOAD.
For example:

$ LD_PRELOAD=/lib/x86_64-linux-gnu/libreadline.so.8

Cheers,

Aitor.