Thank you very much for the prompt reply,
On 1/20/19 7:54 PM, Chet Ramey wrote:
On 1/20/19 12:03 PM, Mohammad Akhlaghi wrote:
Dear Bash developers,
I am trying to build Bash for a relatively closed environment where I don't
want the Bash executable to link with the system's libreadline and
libncursesw, but my own installation of these libraries.
However, even when I configure bash with `--enable-rpath', and add
`-Wl,-rpath-link=$my_install/lib' to LDFLAGS, the bash executable doesn't
have the absolute address of these libraries in it.
Bash doesn't use --enable-rpath, and it's not in the list of options
configure supports. Have you tried --with-installed-readline=path?
And told the linker to use a specific directory for libraries using
LDFLAGS when running the make?
You are right about `--enable-rpath'. Since `--disable-rpath' existed, I
assumed an `--enable-rpath' must also be present. Most programs only
show one of the `--enable-FEATURE' or `--disable-FEATURE'. So, because
my final bash executable didn't have any RPATH, I thought that
`--enable-rpath' might also be present, but as you mentioned, it had no
effect.
Yes, I configure Bash using the `--with-installed-readline' and set
LDFLAGS. It builds and installs successfully and there is no problem in
that part.
The problem is in running bash. I have installed Bash 5.0 and the
respective libreadline and libncursesw in a non-standard directory (I
don't have root access on the system). So, it will crash (because of not
finding libreadline) unless I set LD_LIBRARY_PATH.
I am trying to find a way to embed RPATH in the bash executable so I
don't have to set LD_LIBRARY_PATH before calling bash (and thus
inheriting this directory to everything that I call under bash).
I would be grateful you could guide me on how I can configure Bash to
have RPATH in its executable.
Thank you very much,
Mohammad