forked from ali1234/fullscreenhack
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnpviewer
More file actions
executable file
·155 lines (141 loc) · 3.65 KB
/
npviewer
File metadata and controls
executable file
·155 lines (141 loc) · 3.65 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/sh
#
# nsplugin viewer wrapper script (C) 2005-2006 Gwenole Beauchesne
#
OS="`uname -s`"
ARCH="`uname -m`"
NPW_LIBDIR="/usr/lib/nspluginwrapper"
if test -z "$TARGET_OS"; then
echo "*** NSPlugin Viewer *** error, TARGET_OS not initialized"
exit 1
fi
if test -z "$TARGET_ARCH"; then
echo "*** NSPlugin Viewer *** error, TARGET_ARCH not initialized"
exit 1
fi
NPW_VIEWER_DIR=$NPW_LIBDIR/$TARGET_ARCH/$TARGET_OS
# Set a new LD_LIBRARY_PATH that is TARGET specific
export LD_LIBRARY_PATH=$NPW_VIEWER_DIR
# Note that a clever DBT will work at the function level and XShm
# should be possible with a proper native replacement to emulated code
# XXX: BTW, anything other than "yes" is interpreted as "no"
NPW_USE_XSHM=${NPW_USE_XSHM:-yes}
# Enable use of valgrind?
# Define NPW_VALGRIND_OPTIONS if you want to pass additional options to valgrind
NPW_USE_VALGRIND=${NPW_USE_VALGRIND:-no}
can_use_valgrind="no"
case $ARCH in
i?86|i86pc)
ARCH=i386
;;
amd64)
ARCH=x86_64
;;
esac
if test "$ARCH" != "$TARGET_ARCH"; then
case $TARGET_ARCH in
i386)
if test "$ARCH" = "x86_64"; then
case "$OS" in
Linux)
LOADER=`which linux32`
;;
FreeBSD | NetBSD)
# XXX check that COMPAT_LINUX is enabled or fail otherwise
LOADER="none"
;;
esac
elif test "$ARCH" = "ia64"; then
# XXX check that IA-32 EL or HW emulator is enabled or fail
# otherwise (use QEMU?)
LOADER="none"
else
LOADER=`which qemu-i386`
# Don't allow Xshm with qemu
NPW_USE_XSHM="no"
fi
;;
ppc)
if test "$ARCH" = "ppc64"; then
case "$OS" in
Linux)
LOADER=`which linux32`
;;
esac
else
LOADER=`which qemu-ppc`
# Don't allow Xshm with qemu
NPW_USE_XSHM="no"
fi
;;
esac
if test "$LOADER" = "none"; then
unset LOADER
elif test -z "$LOADER" -o ! -x "$LOADER"; then
echo "*** NSPlugin Viewer *** preloader not found"
exit 1
fi
fi
# Disallow Xshm (implying XVideo too)
if test "$NPW_USE_XSHM" != "yes"; then
if test -x "$NPW_VIEWER_DIR/libnoxshm.so"; then
if test -n "$LD_PRELOAD"; then
LD_PRELOAD="$LD_PRELOAD:$NPW_VIEWER_DIR/libnoxshm.so"
else
LD_PRELOAD="$NPW_VIEWER_DIR/libnoxshm.so"
fi
export LD_PRELOAD
fi
fi
# Expand PATH for RealPlayer package on NetBSD (realplay)
if test "$OS" = "NetBSD"; then
REALPLAYER_HOME="/usr/pkg/lib/RealPlayer"
if test -x "$REALPLAYER_HOME/realplay"; then
export PATH=$PATH:$REALPLAYER_HOME
fi
fi
# Use sound wrappers wherever possible (Flash 9 plugin)
case " $@ " in
*" --test "*|*" -t "*)
# do nothing, don't even allow valgrind'ing here
;;
*)
# XXX: detect QEMU target soundwrapper differently
case "$LOADER" in
*linux32)
if test "$OS" = "Linux"; then
soundwrapper=`which soundwrapper 2>/dev/null`
if test -x "$soundwrapper"; then
LOADER="$LOADER $soundwrapper"
elif ps aux | grep artsd | grep -vq grep; then
soundwrapper=`which artsdsp 2>/dev/null`
if test -x "$soundwrapper"; then
LOADER="$LOADER $soundwrapper"
fi
fi
fi
can_use_valgrind="yes"
;;
"")
can_use_valgrind="yes"
;;
esac
;;
esac
if test "$NPW_USE_VALGRIND:$can_use_valgrind" = "yes:yes"; then
valgrind=`which valgrind 2>/dev/null`
if test -x "$valgrind"; then
LOADER="$LOADER $valgrind --log-fd=1 $NPW_VALGRIND_OPTIONS"
export G_SLICE=always-malloc
export NPW_INIT_TIMEOUT=30
fi
fi
# begin fullscreen hack extra lines
if test -n "$LD_PRELOAD"; then
LD_PRELOAD="$LD_PRELOAD:$NPW_VIEWER_DIR/libfullscreenhack.so"
else
LD_PRELOAD="$NPW_VIEWER_DIR/libfullscreenhack.so"
fi
export LD_PRELOAD
#end fullscreen hack extra lines
exec $LOADER $NPW_VIEWER_DIR/npviewer.bin ${1+"$@"}