MangoHud/bin/mangohud.in

24 lines
601 B
Plaintext
Raw Normal View History

#!/bin/sh
2020-03-11 16:04:10 +00:00
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"
2020-03-11 16:04:10 +00:00
if [ "$1" = "--dlsym" ]; then
MANGOHUD_DLSYM=1
MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
shift
fi
2021-02-03 01:33:03 +00:00
# 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}"
exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"