3 if [ -z "$1" -o "$1" = '--help' ]; then
4 echo "USAGE: $0 <program> [args...]"
8 if [ -d /usr
/lib64
]; then
10 if [ -d "$libdir_64/mumble" ]; then
11 libdir_64
="$libdir_64/mumble";
14 if [ -d /usr
/lib32
]; then
16 if [ -d "$libdir_32/mumble" ]; then
17 libdir_32
="$libdir_32/mumble";
20 if [ -d /opt
/lib32
/usr
/lib
]; then
21 libdir_32
=/opt
/lib32
/usr
/lib
22 if [ -d "$libdir_32/mumble" ]; then
23 libdir_32
="$libdir_32/mumble";
26 if [ -z "$libdir_32" -o -z "$libdir_64" ]; then
28 if [ -d "$tlibdir/mumble" ]; then
29 tlibdir
="$tlibdir/mumble"
31 if [ -f "$tlibdir/libmumble.so.1" ]; then
32 case $
(file -L "$tlibdir/libmumble.so.1") in
33 *64-bit*) libdir_64
=$tlibdir ;;
34 *32-bit*) libdir_32
=$tlibdir ;;
39 MUMBLE_OVERLAY_PATH_32
=$libdir_32
40 MUMBLE_OVERLAY_PATH_64
=$libdir_64
42 if [ -f /etc
/sysconfig
/mumble
]; then
43 .
/etc
/sysconfig
/mumble
47 if [ "${binary/\/}" = "$binary" ]; then
48 binary
=$
(which "$binary")
50 if [ ! -x "$binary" ]; then
51 echo "$1 not found" >&2
58 case $
(file -L "$binary") in
60 if [ ! -f "${MUMBLE_OVERLAY_PATH_64}/libmumble.so.1" ]; then
61 echo "64-bit libmumble.so.1 not found in ${MUMBLE_OVERLAY_PATH_64}" >&2
64 MUMBLE_PRELOAD
="${MUMBLE_OVERLAY_PATH_64}/libmumble.so.1"
67 if [ ! -f "${MUMBLE_OVERLAY_PATH_32}/libmumble.so.1" ]; then
68 echo "32-bit libmumble.so.1 not found in ${MUMBLE_OVERLAY_PATH_32}" >&2
71 MUMBLE_PRELOAD
="${MUMBLE_OVERLAY_PATH_32}/libmumble.so.1"
74 if [ -f "${MUMBLE_OVERLAY_PATH_64}/libmumble.so.1" ]; then
75 MUMBLE_PRELOAD
="${MUMBLE_OVERLAY_PATH_64}/libmumble.so.1"
77 if [ -f "${MUMBLE_OVERLAY_PATH_32}/libmumble.so.1" ]; then
78 MUMBLE_PRELOAD
="${MUMBLE_PRELOAD} ${MUMBLE_OVERLAY_PATH_32}/libmumble.so.1"
80 if [ -z "${MUMBLE_PRELOAD}" ]; then
81 echo "Neither 32-bit or 64-bit libmumble.so.1 found"
86 LD_PRELOAD
="${MUMBLE_PRELOAD} ${LD_PRELOAD}" "${@}"