You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
785 B
Bash
31 lines
785 B
Bash
#!/bin/sh
|
|
|
|
if [ "$#" -eq 0 ]; then
|
|
programname=`basename "$0"`
|
|
echo "ERROR: No program supplied"
|
|
echo
|
|
echo "Usage: $programname <program>"
|
|
exit 1
|
|
fi
|
|
|
|
MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud.so"
|
|
|
|
if [ "$1" = "--dlsym" ]; then
|
|
MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
|
|
shift
|
|
fi
|
|
|
|
# Make sure we don't append mangohud lib multiple times
|
|
# otherwise this could cause issues with steam runtime
|
|
case ":${LD_PRELOAD-}:" in
|
|
(*:$MANGOHUD_LIB_NAME:*)
|
|
;;
|
|
(*)
|
|
# Preload using the plain filenames of the libs, the dynamic linker will
|
|
# figure out whether the 32 or 64 bit version should be used
|
|
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
|
|
esac
|
|
|
|
|
|
exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
|