mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-23 22:52:23 +00:00
7c3dcb42dc
The wrapper script placed around the target binaries when using the companion libraries does not work for symbolic links The wrapper scripts needs to follow the links before calling the actual binary Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com> ---
16 lines
395 B
Bash
16 lines
395 B
Bash
#!/bin/sh
|
|
|
|
canonicalizedname=$(readlink -nm "${0}")
|
|
dirname="$(dirname "${canonicalizedname}")"
|
|
basename="$(basename "${canonicalizedname}")"
|
|
|
|
ld_lib_path="$(dirname "${dirname}")/lib"
|
|
|
|
case ":${LD_LIBRARY_PATH}:" in
|
|
*":${ld_lib_path}:"*) ;;
|
|
*) LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
|
|
esac
|
|
|
|
export LD_LIBRARY_PATH
|
|
exec "${dirname}/.${basename}" "$@"
|