I am developing a C library, which executes its unit tests as C files
using
libtool --mode=execute ...
This has to affect the value of LD_LIBRARY_PATH to ensure the executable
for the test uses the newly-compiled library. Fair enough.
Problem is, it doesn't respect an existing value for this variable and
instead totally overwrites the old value, causing things that should be
findable to not be.
This matters, because I am in fact developing two C libraries, one that
depends on the other. When I
make install PREFIX=$HOME
the lower library it lives in $HOME/lib and therefore I have to use
LD_LIBRARY_PATH to make sure the second library can find it at runtime.
Real programs can find it, but the unit tests for the second library
cannot, because `libtool --mode=execute` has overwritten the value
there.
To fix this, it simply has to ensure that it prepends to, rather than
overwrites, during its setup shell script.