File: mangohud.in

package info (click to toggle)
mangohud 0.6.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,676 kB
  • sloc: cpp: 58,377; ansic: 11,109; sh: 583; python: 518; xml: 34; makefile: 13
file content (28 lines) | stat: -rwxr-xr-x 818 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

if [ "$#" -eq 0 ]; then
	programname=`basename "$0"`
	echo "ERROR: No program supplied"
	echo
	echo "Usage: $programname <program>"
	exit 1
fi

if [ "$1" = "--dlsym" ]; then
	MANGOHUD_DLSYM=1
	shift
fi

MANGOHUD_LIB_NAME="@ld_libdir_mangohud_abs@libMangoHud.so"

if [ "$MANGOHUD_DLSYM" = "1" ]; then
	MANGOHUD_LIB_NAME="@ld_libdir_mangohud_abs@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
fi

# Preload using the plain filenames of the libs, the dynamic linker will
# figure out whether the 32 or 64 bit version should be used, and will search
# for it in the correct directory
LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}${MANGOHUD_LIB_NAME}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@ld_libdir_mangohud@"

exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@"