Hello. I discovered this issue when tried to install carla plugin host on gentoo. This tool appart to be simple plugin host, also implements a sampler, being linked directly with linuxsampler and fluidsynth libraries.
Currently there are two ways to do it: libtool (older, needs autotools) and pkg-config. Linuxsampler itself uses libtool almost everywhere inside self (linking linuxsampler executable with own library) and then works well. But almost all modern stuff uses pkg-config for that. Carla too. However, after successful linking and installing it can't start because can't find liblinuxsampler.so.3, because path, written to pkglibdir (libdir/linuxsampler) is not in LD_LIBRARY_PATH. In kxstudio this problem is solved by adding a separate file in "/etc/ld.conf.d" to liblinuxsampler package. I could do same, but i'm searching for better solution, reducing such extra efforts for packagers.
There are two solutions, that i can see:
1. Since linuxsampler links using -Wl-rpath (seems to be added by libtool), same option may be specified by pkg-config (in `pkg-config --libs linuxsampler`). Even more, it may replace -D option... though i'm not sure, is it good idea to remove first - don't know, wether -Wl-rpath and -D overrided each other or complement (i.e., if library not found in LD_LIBRARY_PATH, it could be searched by path, specified by -rpath).
2. Simply change liblinuxsampler install path to libdir (/usr/lib) - indeed, why not?? Almost all other libraries do so (gtk, qt, sndfile, jack-audio-connection-kit). However, if there are more 3rd party sruff, linked with liblinuxsampler in some distros, this may break them, requiring their rebuilding.
I don't hurry to bring it to bugtracker, as description may be a bit fuzzy.