In the highly unlikely that you would need to invoke a tool with an out of tree PCRE2 library, it comes handy to set LD_LIBRARY_PATH to point to such library and not get your setting blown away. As usual, if no LD_LIBRARY_PATH exists previous to calling the script, nothing will change. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@xxxxxxxxx> --- scripts/env_use_destdir | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/env_use_destdir b/scripts/env_use_destdir index 89d989a2..61ef7b26 100755 --- a/scripts/env_use_destdir +++ b/scripts/env_use_destdir @@ -21,7 +21,13 @@ if [ -z "${DESTDIR:-}" ] ; then exit 1 fi -export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib" +if [ -n "${LD_LIBRARY_PATH:-}" ] ; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DESTDIR/usr/lib:$DESTDIR/lib" +else + LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib" +fi + +export LD_LIBRARY_PATH if [ -n "${PREFIX:-}" ] ; then LD_LIBRARY_PATH="$DESTDIR$PREFIX/lib:$LD_LIBRARY_PATH" fi -- 2.39.0