Set $ORIGIN based rpath on shared linux binaries

This commit is contained in:
BtbN 2021-05-14 19:23:11 +02:00
parent fbbdbf4905
commit a0384b8b70

28
scripts.d/99-rpath.sh Normal file
View file

@ -0,0 +1,28 @@
#!/bin/bash
ffbuild_enabled() {
[[ $TARGET == linux* ]]
}
ffbuild_dockerfinal() {
return 0
}
ffbuild_dockerlayer() {
return 0
}
ffbuild_dockerstage() {
return 0
}
ffbuild_dockerbuild() {
return 0
}
ffbuild_configure() {
if [[ $VARIANT == *shared* ]]; then
# Can't escape escape hell
echo --extra-ldexeflags=\'-Wl,-rpath='\\\\\\\$\\\$ORIGIN'\\ -Wl,-rpath='\\\\\\\$\\\$ORIGIN/../lib'\'
fi
}