MangoHud/bin/mangohud.in

26 lines
752 B
Plaintext
Raw Normal View History

2020-03-11 16:04:10 +00:00
#!/bin/sh
MANGOHUD_LIB_NAME="libMangoHud.so"
2020-04-21 13:56:46 +00:00
if [ "$MANGOHUD_DLSYM" = "1" ]; then
MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
2020-03-11 16:04:10 +00:00
fi
if [ "$#" -eq 0 ]; then
programname=`basename "$0"`
echo "ERROR: No program supplied"
echo
echo "Usage: $programname <program>"
exit 1
fi
# Execute the program under a clean environment
# pass through the overriden LD_PRELOAD environment variables
LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@libdir_mangohud@"
if hash @mangohud_sh@ 2>/dev/null; then
exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" @mangohud_sh@ "$@"
else
exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@"
fi