hsa-runtime: add ENABLE_LDCONFIG to support multi-version install

Depends-On: I58fdf1d0b4e864b5a61ffe8e335d430d424811ab
Change-Id: I0cb6f8711ea5033e84b7e45ce20e7e23d84005c3
Signed-off-by: Cole Nelson <cole.nelson@amd.com>
This commit is contained in:
Cole Nelson
2021-03-03 15:06:43 -08:00
committed by Cole Nelson
parent d5855c1658
commit 72fa4a17fa
5 changed files with 34 additions and 16 deletions
@@ -44,12 +44,16 @@
set -e
# left-hand term originates from @ENABLE_LDCONFIG@ = ON/OFF at package build
do_ldconfig() {
echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
echo @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/lib > /etc/ld.so.conf.d/hsa-rocr-dev.conf
ldconfig
fi
}
case "$1" in
configure)
( configure )
do_ldconfig
# Workaround for CPACK directory symlink handling error.
mkdir -p @CPACK_PACKAGING_INSTALL_PREFIX@/hsa/include
@@ -58,7 +62,7 @@ case "$1" in
abort-upgrade|abort-remove|abort-deconfigure)
echo "$1"
;;
*)
( * )
exit 0
;;
esac
@@ -44,20 +44,23 @@
set -e
# left-hand term originates from @ENABLE_LDCONFIG@ = ON/OFF at package build
rm_ldconfig() {
rm -f /etc/ld.so.conf.d/hsa-rocr-dev.conf && ldconfig
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
rm -f /etc/ld.so.conf.d/hsa-rocr-dev.conf
ldconfig
fi
}
case "$1" in
remove)
( remove )
rm_ldconfig
# Workaround for CPACK directory symlink handling error.
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/hsa
;;
purge)
( purge )
;;
*)
( * )
exit 0
;;
esac