scripts: Use special ${LIB} token for architecture-independence

On GNU/Linux systems, the literal string '${LIB}' in dynamic linker
paths expands to "lib", a biarch libQUAL directory such as "lib64", or
a Debian-style multiarch directory such as "lib/x86_64-linux-gnu".
If we're installing libraries to such a directory, and we have both
word-sizes' compatibility libraries available, then pw-pulse can
use LD_LIBRARY_PATH='/usr/${LIB}/pipewire-0.3/pulse' to make both
i386 and x86_64 programs load the correct version.

Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
Simon McVittie 2020-06-03 11:03:35 +01:00 committed by Wim Taymans
parent 96eb6e4df8
commit e493be3844
3 changed files with 23 additions and 2 deletions

View file

@ -35,6 +35,21 @@ pipewire_sysconfdir = join_paths(prefix, get_option('sysconfdir'))
pipewire_configdir = join_paths(pipewire_sysconfdir, 'pipewire')
modules_install_dir = join_paths(pipewire_libdir, pipewire_name)
if host_machine.system() == 'linux'
# glibc ld.so interprets ${LIB} in a library loading path with an
# appropriate value for the current architecture, typically something
# like lib, lib64 or lib/x86_64-linux-gnu.
# This allows the same pw-pulse script to work for both 32- and 64-bit
# applications on biarch/multiarch distributions, by setting something
# like LD_LIBRARY_PATH='/usr/${LIB}/pipewire-0.3/pulse'.
# Note that ${LIB} is a special token expanded by the runtime linker,
# not an environment variable, and must be passed through literally.
modules_install_dir_dlopen = join_paths(prefix, '${LIB}', pipewire_name)
else
modules_install_dir_dlopen = modules_install_dir
endif
spa_plugindir = join_paths(pipewire_libdir, spa_name)
pipewire_headers_dir = join_paths(pipewire_name, 'pipewire')