]> git.sesse.net Git - vlc/commitdiff
* QNX RTOS plug-in by Jon Lech Johansen.
authorChristophe Massiot <massiot@videolan.org>
Thu, 19 Jul 2001 11:50:51 +0000 (11:50 +0000)
committerChristophe Massiot <massiot@videolan.org>
Thu, 19 Jul 2001 11:50:51 +0000 (11:50 +0000)
AUTHORS
ChangeLog
Makefile.opts.in
configure
configure.in
extras/libdvdcss/ioctl.c
include/defs.h.in
plugins/qnx/Makefile [new file with mode: 0644]
plugins/qnx/aout_qnx.c [new file with mode: 0644]
plugins/qnx/qnx.c [new file with mode: 0644]
plugins/qnx/vout_qnx.c [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index 010e8a65996adc2e5f8cc97bd51e69f380021579..933c1286f9968cca6be92561314042bb4c95d9ef 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -127,6 +127,7 @@ N: Jon Lech Johansen
 E: jon-vl@nanocrew.net
 D: PS input fixes
 D: Win32 DVD input port
+D: QNX RTOS plug-in
 
 N: Michel Kaempf
 E: maxx@via.ecp.fr
index 8d630160576b71f50ca2be37ed7c79982994b80d..4e0a24410c1ebb586d319078b66e718cba5d0a9d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,6 +63,7 @@ HEAD
   * Kludged so that times displayed in the scrollbar are finally correct
     for MPEG-2 streams.
   * FreeBSD compilation fix by Ã˜yvind Kolbu.
+  * QNX RTOS plug-in by Jon Lech Johansen.
 
 0.2.80
 Tue,  5 Jun 2001 04:41:06 +0200
index 2080552f5658b6038faa24ed77dc4a091a5136c3..a072bf3dcbd44967a20d5c3e18447d5b24fe5a43 100644 (file)
@@ -74,6 +74,7 @@ LIB_GTK = @LIB_GTK@
 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
 LIB_KDE = @LIB_KDE@
 LIB_MACOSX = @LIB_MACOSX@
+LIB_QNX = @LIB_QNX@
 LIB_NCURSES = @LIB_NCURSES@
 LIB_QT = @LIB_QT@
 LIB_TS = @LIB_TS@
index e22d479fc59b0c62870bc56ff7f98f178fe7a87f..990da9d2f14b2a823e7ee7637779b49dabe03b83 100755 (executable)
--- a/configure
+++ b/configure
@@ -45,6 +45,8 @@ ac_help="$ac_help
   --enable-darwin         Darwin sound support (default disabled)"
 ac_help="$ac_help
   --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)"
+ac_help="$ac_help
+  --disable-qnx           QNX RTOS support (default enabled)"
 ac_help="$ac_help
   --enable-fb             Linux framebuffer support (default disabled)"
 ac_help="$ac_help
@@ -609,7 +611,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:613: checking host system type" >&5
+echo "configure:615: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -640,7 +642,7 @@ VLC_CODENAME=Ourumov
 save_CFLAGS="${CFLAGS}"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:644: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:646: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -669,7 +671,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:673: checking for $ac_word" >&5
+echo "configure:675: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -699,7 +701,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:703: checking for $ac_word" >&5
+echo "configure:705: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -750,7 +752,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:754: checking for $ac_word" >&5
+echo "configure:756: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -782,7 +784,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:786: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:788: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -793,12 +795,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 797 "configure"
+#line 799 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -824,12 +826,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:830: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:833: checking whether we are using GNU C" >&5
+echo "configure:835: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -838,7 +840,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -857,7 +859,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:861: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:863: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -889,7 +891,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:893: checking how to run the C preprocessor" >&5
+echo "configure:895: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -904,13 +906,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 908 "configure"
+#line 910 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -921,13 +923,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 925 "configure"
+#line 927 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -938,13 +940,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 942 "configure"
+#line 944 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -971,7 +973,7 @@ echo "$ac_t""$CPP" 1>&6
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:975: checking for $ac_word" >&5
+echo "configure:977: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1011,7 +1013,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1015: checking for a BSD compatible install" >&5
+echo "configure:1017: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1065,18 +1067,18 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1069: checking for working const" >&5
+echo "configure:1071: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1074 "configure"
+#line 1076 "configure"
 #include "confdefs.h"
 
 int main() {
 
 /* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0,0};
 /* SunOS 4.1.1 cc rejects this.  */
 char const *const *ccp;
 char **p;
@@ -1119,7 +1121,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1142,14 +1144,14 @@ fi
 
 if test x${cross_compiling} != xyes; then
   echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1146: checking whether byte ordering is bigendian" >&5
+echo "configure:1148: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 1153 "configure"
+#line 1155 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1160,11 +1162,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 1168 "configure"
+#line 1170 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1175,7 +1177,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -1195,7 +1197,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1199 "configure"
+#line 1201 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -1208,7 +1210,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:1212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -1236,12 +1238,12 @@ fi
 for ac_func in gettimeofday select strerror strtod strtol
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1240: checking for $ac_func" >&5
+echo "configure:1242: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1245 "configure"
+#line 1247 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1264,7 +1266,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1291,12 +1293,12 @@ done
 for ac_func in setenv putenv
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1295: checking for $ac_func" >&5
+echo "configure:1297: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1300 "configure"
+#line 1302 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1319,7 +1321,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1344,12 +1346,12 @@ fi
 done
 
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1348: checking for connect" >&5
+echo "configure:1350: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1353 "configure"
+#line 1355 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -1372,7 +1374,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -1391,7 +1393,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1395: checking for connect in -lsocket" >&5
+echo "configure:1397: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1399,7 +1401,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1403 "configure"
+#line 1405 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1410,7 +1412,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1434,12 +1436,12 @@ fi
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1438: checking for gethostbyname" >&5
+echo "configure:1440: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1443 "configure"
+#line 1445 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1462,7 +1464,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1481,7 +1483,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1485: checking for gethostbyname in -lnsl" >&5
+echo "configure:1487: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1489,7 +1491,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1493 "configure"
+#line 1495 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1500,7 +1502,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:1504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1524,12 +1526,12 @@ fi
 fi
 
 echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
-echo "configure:1528: checking for nanosleep" >&5
+echo "configure:1530: checking for nanosleep" >&5
 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1533 "configure"
+#line 1535 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char nanosleep(); below.  */
@@ -1552,7 +1554,7 @@ nanosleep();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_nanosleep=yes"
 else
@@ -1571,7 +1573,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
-echo "configure:1575: checking for nanosleep in -lrt" >&5
+echo "configure:1577: checking for nanosleep in -lrt" >&5
 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1579,7 +1581,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1583 "configure"
+#line 1585 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1590,7 +1592,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1610,7 +1612,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
-echo "configure:1614: checking for nanosleep in -lposix4" >&5
+echo "configure:1616: checking for nanosleep in -lposix4" >&5
 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1618,7 +1620,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1622 "configure"
+#line 1624 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1629,7 +1631,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:1633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1658,12 +1660,12 @@ fi
 for ac_func in usleep
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1662: checking for $ac_func" >&5
+echo "configure:1664: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1667 "configure"
+#line 1669 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1686,7 +1688,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1711,12 +1713,12 @@ fi
 done
 
 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:1715: checking for inet_aton" >&5
+echo "configure:1717: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1720 "configure"
+#line 1722 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -1739,7 +1741,7 @@ inet_aton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -1758,7 +1760,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:1762: checking for inet_aton in -lresolv" >&5
+echo "configure:1764: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1766,7 +1768,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1770 "configure"
+#line 1772 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1777,7 +1779,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1803,12 +1805,12 @@ fi
 for ac_func in vasprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1807: checking for $ac_func" >&5
+echo "configure:1809: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1812 "configure"
+#line 1814 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1831,7 +1833,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1858,12 +1860,12 @@ done
 for ac_func in swab
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1862: checking for $ac_func" >&5
+echo "configure:1864: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1867 "configure"
+#line 1869 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1886,7 +1888,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1914,12 +1916,12 @@ done
 for ac_func in sigrelse
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1918: checking for $ac_func" >&5
+echo "configure:1920: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1923 "configure"
+#line 1925 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1942,7 +1944,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1968,12 +1970,12 @@ done
 
 
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:1972: checking for getopt_long" >&5
+echo "configure:1974: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1977 "configure"
+#line 1979 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -1996,7 +1998,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -2018,7 +2020,7 @@ else
   echo "$ac_t""no" 1>&6
  # FreeBSD has a gnugetopt library for this:
   echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:2022: checking for getopt_long in -lgnugetopt" >&5
+echo "configure:2024: checking for getopt_long in -lgnugetopt" >&5
 ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2026,7 +2028,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgnugetopt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2030 "configure"
+#line 2032 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2037,7 +2039,7 @@ int main() {
 getopt_long()
 ; return 0; }
 EOF
-if { (eval echo configure:2041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2069,17 +2071,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2073: checking for $ac_hdr" >&5
+echo "configure:2075: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2078 "configure"
+#line 2080 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2108,12 +2110,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2112: checking for $ac_func" >&5
+echo "configure:2114: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2117 "configure"
+#line 2119 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2136,7 +2138,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2161,7 +2163,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2165: checking for working mmap" >&5
+echo "configure:2167: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2169,7 +2171,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2173 "configure"
+#line 2175 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2196,12 +2198,15 @@ else
 #include <sys/types.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -2256,7 +2261,7 @@ main()
        /*
         * First, make a file with some known garbage in it.
         */
-       data = malloc(pagesize);
+       data = (char*)malloc(pagesize);
        if (!data)
                exit(1);
        for (i = 0; i < pagesize; ++i)
@@ -2277,7 +2282,7 @@ main()
        fd = open("conftestmmap", O_RDWR);
        if (fd < 0)
                exit(1);
-       data2 = malloc(2 * pagesize);
+       data2 = (char*)malloc(2 * pagesize);
        if (!data2)
                exit(1);
        data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
@@ -2295,7 +2300,7 @@ main()
         */
        for (i = 0; i < pagesize; ++i)
                *(data2 + i) = *(data2 + i) + 1;
-       data3 = malloc(pagesize);
+       data3 = (char*)malloc(pagesize);
        if (!data3)
                exit(1);
        if (read(fd, data3, pagesize) != pagesize)
@@ -2309,7 +2314,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2332,12 +2337,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2336: checking return type of signal handlers" >&5
+echo "configure:2341: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2341 "configure"
+#line 2346 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2354,7 +2359,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2373,7 +2378,7 @@ EOF
 
 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2377: checking for dlopen in -ldl" >&5
+echo "configure:2382: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2381,7 +2386,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2385 "configure"
+#line 2390 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2392,7 +2397,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2413,7 +2418,7 @@ else
 fi
 
 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:2417: checking for pow in -lm" >&5
+echo "configure:2422: checking for pow in -lm" >&5
 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2421,7 +2426,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2425 "configure"
+#line 2430 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2432,7 +2437,7 @@ int main() {
 pow()
 ; return 0; }
 EOF
-if { (eval echo configure:2436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2458,7 +2463,7 @@ CFLAGS="${CFLAGS} -I/usr/local/include"
 
 PTHREAD_LIBS=error
 echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
-echo "configure:2462: checking for pthread_attr_init in -lpthread" >&5
+echo "configure:2467: checking for pthread_attr_init in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2466,7 +2471,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2470 "configure"
+#line 2475 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2477,7 +2482,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2499,7 +2504,7 @@ fi
 
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
-echo "configure:2503: checking for pthread_attr_init in -lpthreads" >&5
+echo "configure:2508: checking for pthread_attr_init in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2507,7 +2512,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2511 "configure"
+#line 2516 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2518,7 +2523,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2541,7 +2546,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
-echo "configure:2545: checking for pthread_attr_init in -lc_r" >&5
+echo "configure:2550: checking for pthread_attr_init in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2549,7 +2554,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2553 "configure"
+#line 2558 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2560,7 +2565,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2584,12 +2589,12 @@ fi
 if test "x${THREAD_LIB}" = xerror; then
   THREAD_LIBS=""
   echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
-echo "configure:2588: checking for pthread_attr_init" >&5
+echo "configure:2593: checking for pthread_attr_init" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2593 "configure"
+#line 2598 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_attr_init(); below.  */
@@ -2612,7 +2617,7 @@ pthread_attr_init();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_attr_init=yes"
 else
@@ -2634,7 +2639,7 @@ fi
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 2638 "configure"
+#line 2643 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -2650,7 +2655,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2654 "configure"
+#line 2659 "configure"
 #include "confdefs.h"
 #include <strings.h>
 EOF
@@ -2670,17 +2675,17 @@ for ac_hdr in stddef.h getopt.h strings.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2674: checking for $ac_hdr" >&5
+echo "configure:2679: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2679 "configure"
+#line 2684 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2710,17 +2715,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2714: checking for $ac_hdr" >&5
+echo "configure:2719: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2719 "configure"
+#line 2724 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2750,17 +2755,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2754: checking for $ac_hdr" >&5
+echo "configure:2759: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2759 "configure"
+#line 2764 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2790,17 +2795,17 @@ for ac_hdr in dlfcn.h image.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2794: checking for $ac_hdr" >&5
+echo "configure:2799: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2799 "configure"
+#line 2804 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2830,17 +2835,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2834: checking for $ac_hdr" >&5
+echo "configure:2839: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2839 "configure"
+#line 2844 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2870,17 +2875,17 @@ for ac_hdr in machine/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2874: checking for $ac_hdr" >&5
+echo "configure:2879: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2879 "configure"
+#line 2884 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2911,17 +2916,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2915: checking for $ac_hdr" >&5
+echo "configure:2920: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2920 "configure"
+#line 2925 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2950,9 +2955,9 @@ done
 
 CFLAGS="${save_CFLAGS} -Wall -Werror"
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:2954: checking for ntohl in sys/param.h" >&5
+echo "configure:2959: checking for ntohl in sys/param.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2956 "configure"
+#line 2961 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 void foo() { int meuh; ntohl(meuh); }
@@ -2960,7 +2965,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define NTOHL_IN_SYS_PARAM_H 1
@@ -2977,16 +2982,16 @@ rm -f conftest*
 
 CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
 echo $ac_n "checking if \$CC compiles plugins with -bundle -undefined suppress""... $ac_c" 1>&6
-echo "configure:2981: checking if \$CC compiles plugins with -bundle -undefined suppress" >&5
+echo "configure:2986: checking if \$CC compiles plugins with -bundle -undefined suppress" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2983 "configure"
+#line 2988 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; echo "$ac_t""yes" 1>&6
 else
@@ -2999,16 +3004,16 @@ rm -f conftest*
 
 CFLAGS="${save_CFLAGS} -shared"
 echo $ac_n "checking if \$CC compiles plugins with -shared""... $ac_c" 1>&6
-echo "configure:3003: checking if \$CC compiles plugins with -shared" >&5
+echo "configure:3008: checking if \$CC compiles plugins with -shared" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3005 "configure"
+#line 3010 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   PLCFLAGS="${PLCFLAGS} -shared"; echo "$ac_t""yes" 1>&6
 else
@@ -3022,9 +3027,9 @@ rm -f conftest*
 CFLAGS="${save_CFLAGS}"
 
 echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3026: checking for boolean_t in sys/types.h" >&5
+echo "configure:3031: checking for boolean_t in sys/types.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3028 "configure"
+#line 3033 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 void quux() { boolean_t foo; }
@@ -3032,7 +3037,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define BOOLEAN_T_IN_SYS_TYPES_H 1
@@ -3047,9 +3052,9 @@ else
 fi
 rm -f conftest*
 echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
-echo "configure:3051: checking for boolean_t in pthread.h" >&5
+echo "configure:3056: checking for boolean_t in pthread.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3053 "configure"
+#line 3058 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 void quux() { boolean_t foo; }
@@ -3057,7 +3062,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define BOOLEAN_T_IN_PTHREAD_H 1
@@ -3073,18 +3078,18 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3077: checking for working const" >&5
+echo "configure:3082: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3082 "configure"
+#line 3087 "configure"
 #include "confdefs.h"
 
 int main() {
 
 /* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0,0};
 /* SunOS 4.1.1 cc rejects this.  */
 char const *const *ccp;
 char **p;
@@ -3127,7 +3132,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3148,12 +3153,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3152: checking for ANSI C header files" >&5
+echo "configure:3157: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3157 "configure"
+#line 3162 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3161,7 +3166,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3178,7 +3183,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3182 "configure"
+#line 3187 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3196,7 +3201,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3200 "configure"
+#line 3205 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3217,7 +3222,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 3221 "configure"
+#line 3226 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3228,7 +3233,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -3252,12 +3257,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3256: checking for size_t" >&5
+echo "configure:3261: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3261 "configure"
+#line 3266 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3285,12 +3290,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3289: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3294: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3294 "configure"
+#line 3299 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3299,7 +3304,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3329,16 +3334,16 @@ MMX_MODULES="yuvmmx idctmmx motionmmx"
 MMXEXT_MODULES="idctmmxext motionmmxext imdct3dn imdctsse downmix3dn downmixsse"
 
 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:3333: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:3338: checking if \$CC groks MMX inline assembly" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3335 "configure"
+#line 3340 "configure"
 #include "confdefs.h"
 void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
   echo "$ac_t""yes" 1>&6
@@ -3351,16 +3356,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking if \$CC groks MMX EXT or SSE inline assembly""... $ac_c" 1>&6
-echo "configure:3355: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
+echo "configure:3360: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3357 "configure"
+#line 3362 "configure"
 #include "confdefs.h"
 void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
   echo "$ac_t""yes" 1>&6
@@ -3377,17 +3382,17 @@ for ac_hdr in winioctl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3381: checking for $ac_hdr" >&5
+echo "configure:3386: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3386 "configure"
+#line 3391 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3420,17 +3425,17 @@ for ac_hdr in sys/ioctl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3424: checking for $ac_hdr" >&5
+echo "configure:3429: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3429 "configure"
+#line 3434 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3456,17 +3461,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3460: checking for $ac_hdr" >&5
+echo "configure:3465: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3465 "configure"
+#line 3470 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3494,7 +3499,7 @@ done
 
   BSD_DVD_STRUCT=0
         cat > conftest.$ac_ext <<EOF
-#line 3498 "configure"
+#line 3503 "configure"
 #include "confdefs.h"
 #include <sys/dvdio.h>
 EOF
@@ -3512,7 +3517,7 @@ fi
 rm -f conftest*
 
         cat > conftest.$ac_ext <<EOF
-#line 3516 "configure"
+#line 3521 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -3536,7 +3541,7 @@ EOF
 
   fi
         cat > conftest.$ac_ext <<EOF
-#line 3540 "configure"
+#line 3545 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -3641,7 +3646,7 @@ if test "${enable_pth+set}" = set; then
   enableval="$enable_pth"
    if test x$enableval = xyes; then
     echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
-echo "configure:3645: checking for pth_init in -lpth" >&5
+echo "configure:3650: checking for pth_init in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3649,7 +3654,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3653 "configure"
+#line 3658 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3660,7 +3665,7 @@ int main() {
 pth_init()
 ; return 0; }
 EOF
-if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3688,7 +3693,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 3692 "configure"
+#line 3697 "configure"
 #include "confdefs.h"
 #include <pth.h>
 EOF
@@ -3728,17 +3733,17 @@ for ac_hdr in videolan/dvdcss.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3732: checking for $ac_hdr" >&5
+echo "configure:3737: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3737 "configure"
+#line 3742 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3827,7 +3832,7 @@ if test "${enable_esd+set}" = set; then
      # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3831: checking for $ac_word" >&5
+echo "configure:3836: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3892,17 +3897,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3896: checking for $ac_hdr" >&5
+echo "configure:3901: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3901 "configure"
+#line 3906 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3935,6 +3940,58 @@ done
 fi
 
 
+# Check whether --enable-qnx or --disable-qnx was given.
+if test "${enable_qnx+set}" = set; then
+  enableval="$enable_qnx"
+  :
+fi
+
+    if test x$enable_qnx != xno; then
+      for ac_hdr in Ph.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3955: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3960 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+        PLUGINS="${PLUGINS} qnx"
+        LIB_QNX="-lasound -lph"
+      
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+    fi
+
 # Check whether --enable-fb or --disable-fb was given.
 if test "${enable_fb+set}" = set; then
   enableval="$enable_fb"
@@ -3973,17 +4030,17 @@ if test "${with_sdl+set}" = set; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3977: checking for $ac_hdr" >&5
+echo "configure:4034: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3982 "configure"
+#line 4039 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4021,17 +4078,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4025: checking for $ac_hdr" >&5
+echo "configure:4082: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4030 "configure"
+#line 4087 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4075,17 +4132,17 @@ if test "${with_directx+set}" = set; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4079: checking for $ac_hdr" >&5
+echo "configure:4136: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4084 "configure"
+#line 4141 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4123,17 +4180,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4127: checking for $ac_hdr" >&5
+echo "configure:4184: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4132 "configure"
+#line 4189 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4237,7 +4294,7 @@ if test x$enable_gtk != xno; then
   # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4241: checking for $ac_word" >&5
+echo "configure:4298: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4297,17 +4354,17 @@ if test x$enable_x11 != xno; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4301: checking for $ac_hdr" >&5
+echo "configure:4358: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4306 "configure"
+#line 4363 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4359,17 +4416,17 @@ if test x$enable_xvideo != xno; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4363: checking for $ac_hdr" >&5
+echo "configure:4420: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4368 "configure"
+#line 4425 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4407,17 +4464,17 @@ if test "${enable_alsa+set}" = set; then
   enableval="$enable_alsa"
   if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:4411: checking for sys/asoundlib.h" >&5
+echo "configure:4468: checking for sys/asoundlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4416 "configure"
+#line 4473 "configure"
 #include "confdefs.h"
 #include <sys/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4434,7 +4491,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:4438: checking for main in -lasound" >&5
+echo "configure:4495: checking for main in -lasound" >&5
 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4442,14 +4499,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4446 "configure"
+#line 4503 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4531,6 +4588,7 @@ fi
 
 
 
+
 
 
 trap '' 1 2 15
@@ -4715,6 +4773,7 @@ s%@LIB_GTK@%$LIB_GTK%g
 s%@LIB_IDCTALTIVEC@%$LIB_IDCTALTIVEC%g
 s%@LIB_KDE@%$LIB_KDE%g
 s%@LIB_MACOSX@%$LIB_MACOSX%g
+s%@LIB_QNX@%$LIB_QNX%g
 s%@LIB_NCURSES@%$LIB_NCURSES%g
 s%@LIB_QT@%$LIB_QT%g
 s%@LIB_TS@%$LIB_TS%g
index ba42419479df23eff40484df677bfd7ac2513a80..16722e5cd55cb30fc125d1eae97285792a19764c 100644 (file)
@@ -412,6 +412,18 @@ AC_ARG_ENABLE(macosx,
      LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
    )])
 
+dnl
+dnl  QNX RTOS module
+dnl
+AC_ARG_ENABLE(qnx,
+  [  --disable-qnx           QNX RTOS support (default enabled)])
+    if test x$enable_qnx != xno; then
+      AC_CHECK_HEADERS(Ph.h, [
+        PLUGINS="${PLUGINS} qnx"
+        LIB_QNX="-lasound -lph"
+      ])
+    fi
+
 dnl
 dnl  Linux framebuffer module
 dnl
@@ -656,6 +668,7 @@ AC_SUBST(LIB_GTK)
 AC_SUBST(LIB_IDCTALTIVEC)
 AC_SUBST(LIB_KDE)
 AC_SUBST(LIB_MACOSX)
+AC_SUBST(LIB_QNX)
 AC_SUBST(LIB_NCURSES)
 AC_SUBST(LIB_QT)
 AC_SUBST(LIB_TS)
index 3c75e93c8b7cde957b01753d7e291517a2443dd5..fea327d596f3ea45a5a9d5f0ff44e5080658087b 100644 (file)
@@ -2,7 +2,7 @@
  * ioctl.c: DVD ioctl replacement function
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ioctl.c,v 1.3 2001/06/25 11:34:08 sam Exp $
+ * $Id: ioctl.c,v 1.4 2001/07/19 11:50:50 massiot Exp $
  *
  * Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
  *          Samuel Hocevar <sam@zoy.org>
@@ -168,6 +168,16 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
         *pi_copyright = p_buffer[ 4 ];
     }
 
+#elif defined( __QNXNTO__ )
+    /*
+        QNX RTOS currently doesn't have a CAM
+        interface (they're working on it though).
+        Assume DVD is not encrypted.
+    */
+
+    *pi_copyright = 0;
+    i_ret = 0;
+
 #else
     /* DVD ioctls unavailable - do as if the ioctl failed */
     i_ret = -1;
index 0309fba9ce185c119ef57bbb77a737a2ef3204d9..29847be993566a3839c9b41f1be9141069a11692 100644 (file)
@@ -1,4 +1,4 @@
-/* include/defs.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
+/* include/defs.h.in.  Generated automatically from configure.in by autoheader.  */
 
 /* Define to empty if the keyword does not work.  */
 #undef const
@@ -61,6 +61,9 @@
 /* Define if you have the <Carbon/Carbon.h> header file.  */
 #undef HAVE_CARBON_CARBON_H
 
+/* Define if you have the <Ph.h> header file.  */
+#undef HAVE_PH_H
+
 /* Define if you have the <SDL/SDL.h> header file.  */
 #undef HAVE_SDL_SDL_H
 
diff --git a/plugins/qnx/Makefile b/plugins/qnx/Makefile
new file mode 100644 (file)
index 0000000..1d2ec11
--- /dev/null
@@ -0,0 +1,29 @@
+###############################################################################
+# vlc (VideoLAN Client) QNX RTOS module Makefile
+# (c)2001 VideoLAN
+###############################################################################
+
+#
+# Objects
+#
+
+PLUGIN_C = qnx.o aout_qnx.o vout_qnx.o
+BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
+
+ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
+
+#
+# Virtual targets
+#
+
+include ../../Makefile.modules
+
+#
+# Real targets
+#
+
+../../plugins/qnx.so: $(PLUGIN_C)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_QNX) 
+
+../../plugins/qnx.a: $(BUILTIN_C)
+       ar r $@ $^
diff --git a/plugins/qnx/aout_qnx.c b/plugins/qnx/aout_qnx.c
new file mode 100644 (file)
index 0000000..cabac59
--- /dev/null
@@ -0,0 +1,367 @@
+/*****************************************************************************
+ * aout_qnx.c : Alsa functions library
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ *
+ * Authors: Henri Fallon <henri@videolan.org>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME qnx 
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+
+#include "defs.h"
+
+#include <errno.h>                                                 /* ENOMEM */
+#include <string.h>                                            /* strerror() */
+#include <stdio.h>                                           /* "intf_msg.h" */
+#include <stdlib.h>                            /* calloc(), malloc(), free() */
+
+#include <sys/asoundlib.h>
+
+#include "config.h"
+#include "common.h"                                     /* boolean_t, byte_t */
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+
+#include "audio_output.h"                                   /* aout_thread_t */
+
+#include "intf_msg.h"                        /* intf_DbgMsg(), intf_ErrMsg() */
+#include "main.h"
+
+#include "modules.h"
+#include "modules_export.h"
+
+typedef struct alsa_device_s
+{
+    int i_num;
+} alsa_device_t;
+
+typedef struct alsa_card_s
+{
+    int i_num;
+} alsa_card_t;
+
+/* here we store plugin dependant informations */
+
+typedef struct aout_sys_s
+{
+    snd_pcm_t                * p_alsa_handle;
+    alsa_device_t              s_alsa_device;
+    alsa_card_t                s_alsa_card;
+    snd_pcm_channel_params_t   s_alsa_channel_params;
+    snd_pcm_format_t           s_alsa_format;
+} aout_sys_t;
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int     aout_Probe       ( probedata_t *p_data );
+static int     aout_Open        ( aout_thread_t *p_aout );
+static int     aout_SetFormat   ( aout_thread_t *p_aout );
+static long    aout_GetBufInfo  ( aout_thread_t *p_aout, long l_buffer_info );
+static void    aout_Play        ( aout_thread_t *p_aout,
+                                  byte_t *buffer, int i_size );
+static void    aout_Close       ( aout_thread_t *p_aout );
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void _M( aout_getfunctions )( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = aout_Probe;
+    p_function_list->functions.aout.pf_open = aout_Open;
+    p_function_list->functions.aout.pf_setformat = aout_SetFormat;
+    p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
+    p_function_list->functions.aout.pf_play = aout_Play;
+    p_function_list->functions.aout.pf_close = aout_Close;
+}
+
+/*****************************************************************************
+ * aout_Probe: probes the audio device and return a score
+ *****************************************************************************
+ * This function tries to open the dps and returns a score to the plugin
+ * manager so that it can make its choice.
+ *****************************************************************************/
+static int aout_Probe( probedata_t *p_data )
+{
+    int i_open_return, i_close_return;
+    aout_sys_t local_sys;
+    /* This is the same as the beginning of the aout_Open */
+    
+    /* Initialize  */
+    local_sys.s_alsa_device.i_num = 0;
+    local_sys.s_alsa_card.i_num = 0;
+
+    /* Open device */
+    i_open_return = snd_pcm_open( &(local_sys.p_alsa_handle),
+                     local_sys.s_alsa_card.i_num,
+                     local_sys.s_alsa_device.i_num,
+                     SND_PCM_OPEN_PLAYBACK );
+    if( i_open_return )
+    {
+        intf_WarnMsg( 2, "aout info: could not probe ALSA device (%s)",
+              snd_strerror( i_open_return ) );
+        return ( 0 );
+    }
+
+    /* Close it */
+    i_close_return = snd_pcm_close( local_sys.p_alsa_handle );
+    
+    if( i_close_return )
+    {
+        intf_ErrMsg( "aout error: could not close ALSA device (%s)",
+                     snd_strerror( i_close_return ) );
+        return( 0 );
+    }
+    
+    if( TestMethod( AOUT_METHOD_VAR, "qnx" ) )
+    {
+        return( 999 );
+    }
+
+    /* And return score */
+    return( 50 );
+}    
+
+/*****************************************************************************
+ * aout_Open : creates a handle and opens an alsa device
+ *****************************************************************************
+ * This function opens an alsa device, through the alsa API
+ *****************************************************************************/
+static int aout_Open( aout_thread_t *p_aout )
+{
+    int i_open_returns;
+    
+    /* Allocate structures */
+    p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
+    if( p_aout->p_sys == NULL )
+    {
+        intf_ErrMsg( "aout error: failed allocating memory for ALSA (%s)",
+                     strerror(ENOMEM) );
+        return( 1 );
+    }
+
+    /* Initialize  */
+    p_aout->p_sys->s_alsa_device.i_num = 0;
+    p_aout->p_sys->s_alsa_card.i_num = 0;
+    /* FIXME : why not other format ? */
+    p_aout->i_format = AOUT_FMT_S16_LE;   
+    /* FIXME : why always 2 channels ?*/
+    p_aout->i_channels = 2;
+    p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT );
+    
+    /* Open device */
+    if( ( i_open_returns = snd_pcm_open( &(p_aout->p_sys->p_alsa_handle),
+                p_aout->p_sys->s_alsa_card.i_num,
+                p_aout->p_sys->s_alsa_device.i_num,
+                SND_PCM_OPEN_PLAYBACK ) ) )
+    {
+        intf_ErrMsg( "aout error: could not open ALSA device (%s)",
+             snd_strerror(i_open_returns) );
+        return( -1 );
+    }
+
+    intf_DbgMsg( "aout info: ALSA device successfully opened" );
+    return( 0 );
+}
+
+
+/*****************************************************************************
+ * aout_SetFormat : sets the alsa output format
+ *****************************************************************************
+ * This function prepares the device, sets the rate, format, the mode
+ * ("play as soon as you have data"), and buffer information.
+ *****************************************************************************/
+static int aout_SetFormat( aout_thread_t *p_aout )
+{
+    
+    int i_set_param_returns;
+    int i_prepare_playback_returns;
+    int i_playback_go_returns;
+
+    /* Fill with zeros */
+    memset( &p_aout->p_sys->s_alsa_channel_params, 0,
+            sizeof( p_aout->p_sys->s_alsa_channel_params ) );
+    
+    /* Fill the s_alsa_channel_params structure */
+
+    /* Tranfer mode and direction*/    
+    p_aout->p_sys->s_alsa_channel_params.channel = SND_PCM_CHANNEL_PLAYBACK ;
+    p_aout->p_sys->s_alsa_channel_params.mode = SND_PCM_MODE_STREAM;
+    
+    /* Format and rate */
+    p_aout->p_sys->s_alsa_channel_params.format.interleave = 1;
+    if( p_aout->i_format == AOUT_FMT_S16_LE )
+    {
+        p_aout->p_sys->s_alsa_channel_params.format.format = 
+            SND_PCM_SFMT_S16_LE;
+    }
+    else
+    {
+        p_aout->p_sys->s_alsa_channel_params.format.format = 
+            SND_PCM_SFMT_S16_BE;
+    }
+    p_aout->p_sys->s_alsa_channel_params.format.rate = p_aout->l_rate;
+    p_aout->p_sys->s_alsa_channel_params.format.voices = p_aout->i_channels ;
+    
+    /* When to start playing and when to stop */
+    p_aout->p_sys->s_alsa_channel_params.start_mode = SND_PCM_START_DATA;
+    p_aout->p_sys->s_alsa_channel_params.stop_mode = SND_PCM_STOP_STOP;
+
+    /* Buffer information . I have chosen the stream mode here
+     * instead of the block mode. I don't know whether i'm wrong 
+     * but it seemed more logical */
+    /* TODO : find the best value to put here. Probably depending
+     * on many parameters */
+    p_aout->p_sys->s_alsa_channel_params.buf.stream.queue_size = 131072; 
+    
+    p_aout->p_sys->s_alsa_channel_params.buf.stream.fill = SND_PCM_FILL_NONE ;
+    p_aout->p_sys->s_alsa_channel_params.buf.stream.max_fill = 0 ; 
+  
+    /* Now we pass this to the driver */
+    i_set_param_returns = snd_pcm_channel_params( 
+            p_aout->p_sys->p_alsa_handle, 
+            &(p_aout->p_sys->s_alsa_channel_params) );
+    
+    if( i_set_param_returns )
+    {
+        intf_ErrMsg( "aout error: unable to set parameters (%s)",
+                     snd_strerror( i_set_param_returns ) );
+        return( -1 );
+    }
+
+    /* we shall now prepare the channel */
+    i_prepare_playback_returns = 
+        snd_pcm_playback_prepare( p_aout->p_sys->p_alsa_handle );
+
+    if( i_prepare_playback_returns )
+    {
+        intf_ErrMsg( "aout error: unable to prepare channel (%s)",
+                      snd_strerror( i_set_param_returns ) );
+        return( -1 );
+    }
+    
+   /* then we may go */
+   i_playback_go_returns =
+       snd_pcm_playback_go( p_aout->p_sys->p_alsa_handle );
+    if( i_playback_go_returns )
+    {
+        intf_ErrMsg( "aout error: unable to prepare channel (bis) (%s)",
+                     snd_strerror( i_set_param_returns ) );
+        return( -1 );
+    }
+
+    p_aout->i_latency = 0;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * aout_BufInfo: buffer status query
+ *****************************************************************************
+ * This function returns the number of used byte in the queue.
+ * It also deals with errors : indeed if the device comes to run out
+ * of data to play, it switches to the "underrun" status. It has to
+ * be flushed and re-prepared
+ *****************************************************************************/
+static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+{
+    snd_pcm_channel_status_t alsa_channel_status;
+    int i_alsa_get_status_returns;
+    
+    memset( &alsa_channel_status, 0, sizeof( alsa_channel_status ) );
+   
+    i_alsa_get_status_returns = snd_pcm_channel_status( 
+            p_aout->p_sys->p_alsa_handle, &alsa_channel_status );
+
+    if( i_alsa_get_status_returns )
+    {
+        intf_ErrMsg( "aout error: failed getting alsa buffer info (%s)",
+                     snd_strerror ( i_alsa_get_status_returns ) );
+        return( -1 );
+    }
+
+    switch( alsa_channel_status.status )
+    {
+        case SND_PCM_STATUS_NOTREADY:
+        { 
+            intf_ErrMsg( "aout error: status NOT READY" );
+            break;
+        }
+    
+        case SND_PCM_STATUS_UNDERRUN:
+        {
+            int i_prepare_returns;
+            intf_ErrMsg( "aout error: status UNDERRUN ... resetting queue ");
+            i_prepare_returns = snd_pcm_playback_prepare( 
+                             p_aout->p_sys->p_alsa_handle );
+            if ( i_prepare_returns )
+            {
+                intf_ErrMsg( "aout error: could not flush (%s)", 
+                             snd_strerror(i_prepare_returns) );
+            }
+            break;
+        }
+    } 
+
+    return( alsa_channel_status.count );
+}
+
+/*****************************************************************************
+ * aout_Play : plays a sample
+ *****************************************************************************
+ * Plays a sample using the snd_pcm_write function from the alsa API
+ *****************************************************************************/
+static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+{
+    int i_write_returns;
+
+    i_write_returns = (int) snd_pcm_write (
+            p_aout->p_sys->p_alsa_handle, (void *) buffer, (size_t) i_size );
+
+    if( i_write_returns <= 0 )
+    {
+        intf_ErrMsg( "aout error: writing blocks failed (%s)",
+                     snd_strerror( i_write_returns ) );
+    }
+}
+
+/*****************************************************************************
+ * aout_Close : close the Alsa device
+ *****************************************************************************/
+static void aout_Close( aout_thread_t *p_aout )
+{
+    int i_close_returns;
+
+    i_close_returns = snd_pcm_close( p_aout->p_sys->p_alsa_handle );
+
+    if( i_close_returns )
+    {
+        intf_ErrMsg( "aout error: failed closing ALSA device (%s)",
+                     snd_strerror( i_close_returns ) );
+    }
+    free( p_aout->p_sys );
+
+    intf_DbgMsg( "aout: ALSA device closed" );    
+}
+
diff --git a/plugins/qnx/qnx.c b/plugins/qnx/qnx.c
new file mode 100644 (file)
index 0000000..54a0e86
--- /dev/null
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * qnx.c : QNX RTOS plugin for vlc
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ *
+ * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
+ *      
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME qnx 
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include "config.h"
+#include "common.h"                                     /* boolean_t, byte_t */
+#include "threads.h"
+#include "mtime.h"
+
+#include "video.h"
+#include "video_output.h"
+
+#include "modules.h"
+#include "modules_export.h"
+
+/*****************************************************************************
+ * Capabilities defined in the other files.
+ ******************************************************************************/
+void _M( aout_getfunctions )( function_list_t * p_function_list );
+void _M( vout_getfunctions )( function_list_t * p_function_list );
+
+/*****************************************************************************
+ * Building configuration tree
+ *****************************************************************************/
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for QNX RTOS module" )
+    ADD_COMMENT( "For now, the QNX RTOS module cannot be configured" )
+MODULE_CONFIG_STOP
+
+MODULE_INIT_START
+    p_module->psz_longname = "QNX RTOS module";
+    p_module->i_capabilities = MODULE_CAPABILITY_NULL
+                                | MODULE_CAPABILITY_AOUT
+                                | MODULE_CAPABILITY_VOUT;
+MODULE_INIT_STOP
+
+MODULE_ACTIVATE_START
+    _M( aout_getfunctions )( &p_module->p_functions->aout );
+    _M( vout_getfunctions )( &p_module->p_functions->vout );
+MODULE_ACTIVATE_STOP
+
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP
diff --git a/plugins/qnx/vout_qnx.c b/plugins/qnx/vout_qnx.c
new file mode 100644 (file)
index 0000000..3b2e479
--- /dev/null
@@ -0,0 +1,845 @@
+/*****************************************************************************
+ * vout_qnx.c: QNX RTOS video output display method
+ *****************************************************************************
+ * Copyright (C) 2001 VideoLAN
+ *
+ * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME qnx 
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <errno.h>                                                 /* ENOMEM */
+#include <stdlib.h>                                                /* free() */
+#include <string.h>                                            /* strerror() */
+
+#include <photon/PtWidget.h>
+#include <photon/PtWindow.h>
+#include <photon/PtLabel.h>
+#include <photon/PdDirect.h>
+
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+
+#include "video.h"
+#include "video_output.h"
+
+#include "interface.h"
+#include "intf_msg.h"
+#include "main.h"
+
+#include "modules.h"
+#include "modules_export.h"
+
+/*****************************************************************************
+ * vout_sys_t: video output QNX method descriptor
+ *****************************************************************************
+ * This structure is part of the video output thread descriptor.
+ * It describes the QNX specific properties of an output thread. QNX video
+ * output is performed through regular resizable windows. Windows can be
+ * dynamically resized to adapt to the size of the streams.
+ *****************************************************************************/
+
+#define MODE_NORMAL_MEM     0
+#define MODE_SHARED_MEM     1
+#define MODE_VIDEO_MEM      2
+#define MODE_VIDEO_OVERLAY  3
+
+typedef struct vout_sys_s
+{
+    /* video mode */
+    int                     i_mode;
+
+    /* internal stuff */
+    PtWidget_t *            p_window;
+
+    /* [shared] memory blit */
+    PhImage_t *             p_image[2];
+    int                     i_img_type;
+
+    /* video memory blit */
+    PdOffscreenContext_t *  p_ctx[2];
+    char *                  p_buf[2];
+
+    /* video overlay */
+    PgVideoChannel_t *      p_channel;
+    void *                  p_vc_y[2];
+    void *                  p_vc_u[2];
+    void *                  p_vc_v[2];
+    int                     i_vc_flags;
+    int                     i_vc_format;
+
+    /* position & dimensions */
+    PhPoint_t               pos;
+    PhDim_t                 dim;
+    PhDim_t                 old_dim;
+    PhDim_t                 screen_dim;
+} vout_sys_t;
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  vout_Probe     ( probedata_t *p_data );
+static int  vout_Create    ( struct vout_thread_s * );
+static int  vout_Init      ( struct vout_thread_s * );
+static void vout_End       ( struct vout_thread_s * );
+static void vout_Destroy   ( struct vout_thread_s * );
+static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Display   ( struct vout_thread_s * );
+
+static int  QNXCreateWnd   ( struct vout_thread_s * );
+static int  QNXDestroyWnd  ( struct vout_thread_s * );
+static int  QNXInitDisplay ( struct vout_thread_s * );
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void _M( vout_getfunctions )( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = vout_Probe;
+    p_function_list->functions.vout.pf_create     = vout_Create;
+    p_function_list->functions.vout.pf_init       = vout_Init;
+    p_function_list->functions.vout.pf_end        = vout_End;
+    p_function_list->functions.vout.pf_destroy    = vout_Destroy;
+    p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_display    = vout_Display;
+    p_function_list->functions.vout.pf_setpalette = NULL;
+}
+
+/*****************************************************************************
+ * vout_Probe: probe the video driver and return a score
+ *****************************************************************************
+ * This function tries to initialize SDL and returns a score to the
+ * plugin manager so that it can select the best plugin.
+ *****************************************************************************/
+static int vout_Probe( probedata_t *p_data )
+{
+    if( TestMethod( VOUT_METHOD_VAR, "qnx" ) )
+    {
+        return( 999 );
+    }
+
+    return( 100 );
+}
+
+/*****************************************************************************
+ * vout_Create: allocate QNX video thread output method
+ *****************************************************************************
+ * This function allocate and initialize a QNX vout method. It uses some of the
+ * vout properties to choose the window size, and change them according to the
+ * actual properties of the display.
+ *****************************************************************************/
+static int vout_Create( vout_thread_t *p_vout )
+{
+    /* init connection to photon */
+    if( PtInit( "/dev/photon" ) != 0 )
+    {
+        intf_ErrMsg( "vout error: unable to connect to photon" );
+        return( 1 );
+    }
+
+    /* allocate structure */
+    p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
+    if( p_vout->p_sys == NULL )
+    {
+        intf_ErrMsg( "vout error: %s", strerror( ENOMEM ) );
+        return( 1 );
+    }
+
+    memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
+
+    p_vout->b_fullscreen = 
+        main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT );
+    p_vout->p_sys->i_mode = 
+        main_GetIntVariable( VOUT_OVERLAY_VAR, VOUT_OVERLAY_DEFAULT ) ?
+        MODE_VIDEO_OVERLAY : MODE_NORMAL_MEM;
+    p_vout->p_sys->dim.w = 
+        main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT );
+    p_vout->p_sys->dim.h = 
+        main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT );
+    
+    /* init display and create window */
+    if( QNXInitDisplay( p_vout ) || QNXCreateWnd( p_vout ) )
+    {
+        free( p_vout->p_sys );
+        return( 1 );
+    }
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * vout_Init: initialize QNX video thread output method
+ *****************************************************************************
+ * This function create the buffers needed by the output thread. It is called
+ * at the beginning of the thread, but also each time the window is resized.
+ *****************************************************************************/
+static int vout_Init( vout_thread_t *p_vout )
+{
+    if( p_vout->p_sys->i_mode == MODE_NORMAL_MEM ||
+        p_vout->p_sys->i_mode == MODE_SHARED_MEM )
+    {
+        /* create images for [shared] memory blit */
+
+        if( !( p_vout->p_sys->p_image[0] = PhCreateImage( NULL,
+                    p_vout->p_sys->dim.w, p_vout->p_sys->dim.h,
+                    p_vout->p_sys->i_img_type, NULL, 0,
+                    p_vout->p_sys->i_mode == MODE_SHARED_MEM ) ) ) {
+            intf_ErrMsg( "vout error: cannot create image" );
+            return( 1 );
+        }
+
+        if( !( p_vout->p_sys->p_image[1] = PhCreateImage( NULL,
+                    p_vout->p_sys->dim.w, p_vout->p_sys->dim.h,
+                    p_vout->p_sys->i_img_type, NULL, 0,
+                    p_vout->p_sys->i_mode == MODE_SHARED_MEM ) ) ) {
+            intf_ErrMsg( "vout error: cannot create image" );
+            PhReleaseImage( p_vout->p_sys->p_image[0] );
+            free( p_vout->p_sys->p_image[0] );
+            p_vout->p_sys->p_image[0] = NULL;
+            return( 1 );
+        }
+        
+        /* set bytes per line, set buffers */
+        p_vout->i_bytes_per_line = p_vout->p_sys->p_image[0]->bpl;
+        p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_image[0]->image,
+                                 p_vout->p_sys->p_image[1]->image );
+    }
+    else if( p_vout->p_sys->i_mode == MODE_VIDEO_MEM )
+    {
+        /* create offscreen contexts for video memory blit */
+
+        if( ( p_vout->p_sys->p_ctx[0] = PdCreateOffscreenContext( 0,
+                        p_vout->p_sys->dim.w, p_vout->p_sys->dim.h,
+                        Pg_OSC_MEM_PAGE_ALIGN ) ) == NULL )
+        {
+            intf_ErrMsg( "vout error: unable to create offscreen context" );
+            return( 1 );
+        }
+
+        if( ( p_vout->p_sys->p_ctx[1] = PdCreateOffscreenContext( 0,
+                        p_vout->p_sys->dim.w, p_vout->p_sys->dim.h,
+                        Pg_OSC_MEM_PAGE_ALIGN ) ) == NULL )
+        {
+            intf_ErrMsg( "vout error: unable to create offscreen context" );
+            PhDCRelease ( p_vout->p_sys->p_ctx[0] );
+            p_vout->p_sys->p_ctx[0] = NULL;
+            return( 1 );
+        }
+
+        /* get context pointers */
+        if( ( ( p_vout->p_sys->p_buf[0] =
+            PdGetOffscreenContextPtr ( p_vout->p_sys->p_ctx[0] ) ) == NULL ) ||
+            ( p_vout->p_sys->p_buf[1] =
+            PdGetOffscreenContextPtr ( p_vout->p_sys->p_ctx[1] ) ) == NULL )
+        {
+            intf_ErrMsg( "vout error: unable to get offscreen context ptr" );
+            PhDCRelease ( p_vout->p_sys->p_ctx[0] );
+            PhDCRelease ( p_vout->p_sys->p_ctx[1] );
+            p_vout->p_sys->p_ctx[0] = NULL;
+            p_vout->p_sys->p_ctx[1] = NULL;
+            return( 1 );
+        }
+
+        /* set bytes per line, clear buffers, set buffers */
+        p_vout->i_bytes_per_line = 
+            p_vout->i_bytes_per_pixel * p_vout->p_sys->dim.w;
+        memset( p_vout->p_sys->p_buf[0], 0,
+            p_vout->i_bytes_per_line * p_vout->p_sys->dim.h );
+        memset( p_vout->p_sys->p_buf[1], 0,
+            p_vout->i_bytes_per_line * p_vout->p_sys->dim.h );
+        p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_buf[0],
+                                 p_vout->p_sys->p_buf[1] );
+    }
+    else if( p_vout->p_sys->i_mode == MODE_VIDEO_OVERLAY )
+    {
+        PgScalerProps_t props;
+
+        props.size = sizeof( props );
+        props.format = p_vout->p_sys->i_vc_format; 
+        props.viewport.ul.x = p_vout->p_sys->pos.x + 4;
+        props.viewport.ul.y = p_vout->p_sys->pos.y + 20;
+        props.viewport.lr.x = p_vout->p_sys->dim.w + props.viewport.ul.x;
+        props.viewport.lr.y = p_vout->p_sys->dim.h + props.viewport.ul.y;
+        props.src_dim.w = p_vout->p_sys->dim.w;
+        props.src_dim.h    = p_vout->p_sys->dim.h;
+        props.flags = Pg_SCALER_PROP_SCALER_ENABLE |
+                      Pg_SCALER_PROP_DOUBLE_BUFFER;
+
+        if( PgConfigScalerChannel( p_vout->p_sys->p_channel, &props ) == -1 )
+        {
+            intf_ErrMsg( "vout error: unable to configure video channel" );
+            return( 1 );
+        }
+
+        p_vout->p_sys->p_vc_y[0] =
+            PdGetOffscreenContextPtr( p_vout->p_sys->p_channel->yplane1 );
+        p_vout->p_sys->p_vc_y[1] =
+            PdGetOffscreenContextPtr( p_vout->p_sys->p_channel->yplane2 );
+
+        if( p_vout->p_sys->p_vc_y[0] == NULL ||
+            p_vout->p_sys->p_vc_y[1] == NULL )
+        {
+            intf_ErrMsg( "vout error: unable to get video channel ctx ptr" );
+            return( 1 );
+        }
+
+        if( p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_YV12 )
+        {
+            p_vout->b_need_render = 0;
+
+            p_vout->p_sys->p_vc_u[0] =
+                PdGetOffscreenContextPtr( p_vout->p_sys->p_channel->uplane1 );
+            p_vout->p_sys->p_vc_u[1] =
+                PdGetOffscreenContextPtr( p_vout->p_sys->p_channel->uplane2 );
+            p_vout->p_sys->p_vc_v[0] =
+                PdGetOffscreenContextPtr( p_vout->p_sys->p_channel->vplane1 );
+            p_vout->p_sys->p_vc_v[1] =
+                PdGetOffscreenContextPtr( p_vout->p_sys->p_channel->vplane2 );
+
+            if( p_vout->p_sys->p_vc_u[0] == NULL ||
+                p_vout->p_sys->p_vc_u[1] == NULL ||
+                p_vout->p_sys->p_vc_v[0] == NULL ||
+                p_vout->p_sys->p_vc_v[1] == NULL )
+            {
+                intf_ErrMsg( "vout error: unable to get video channel ctx ptr" );
+                return( 1 );
+            }
+        }
+        else if( p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_RGB8888 )
+        {
+            /* set bytes per line, clear buffers, set buffers */
+            p_vout->i_bytes_per_line =
+                p_vout->i_bytes_per_pixel * p_vout->p_sys->dim.w;
+            memset( p_vout->p_sys->p_vc_y[0], 0,
+                p_vout->i_bytes_per_line * p_vout->p_sys->dim.h );
+            memset( p_vout->p_sys->p_vc_y[1], 0,
+                p_vout->i_bytes_per_line * p_vout->p_sys->dim.h );
+            p_vout->pf_setbuffers( p_vout,
+                p_vout->p_sys->p_vc_y[0], p_vout->p_sys->p_vc_y[1] );
+        }
+    }
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * vout_End: terminate QNX video thread output method
+ *****************************************************************************
+ * Destroy the buffers created by vout_Init. It is called at the end of
+ * the thread, but also each time the window is resized.
+ *****************************************************************************/
+static void vout_End( vout_thread_t *p_vout )
+{
+    if( ( p_vout->p_sys->i_mode == MODE_NORMAL_MEM ||
+        p_vout->p_sys->i_mode == MODE_SHARED_MEM ) && 
+        p_vout->p_sys->p_image[0] )
+    {
+        PhReleaseImage( p_vout->p_sys->p_image[0] );
+        PhReleaseImage( p_vout->p_sys->p_image[1] );
+        free( p_vout->p_sys->p_image[0] );
+        free( p_vout->p_sys->p_image[1] );
+    }
+    else if( p_vout->p_sys->i_mode == MODE_VIDEO_MEM &&
+             p_vout->p_sys->p_ctx[0] )
+    {
+        PhDCRelease( p_vout->p_sys->p_ctx[0] );
+        PhDCRelease( p_vout->p_sys->p_ctx[1] );
+    }
+}
+
+/*****************************************************************************
+ * vout_Destroy: destroy QNX video thread output method
+ *****************************************************************************
+ * Terminate an output method created by vout_CreateOutputMethod
+ *****************************************************************************/
+static void vout_Destroy( vout_thread_t *p_vout )
+{
+    /* destroy the window */
+    QNXDestroyWnd( p_vout );
+
+    /* destroy structure */
+    free( p_vout->p_sys );
+}
+
+/*****************************************************************************
+ * vout_Manage: handle QNX events
+ *****************************************************************************
+ * This function should be called regularly by video output thread. It allows 
+ * window resizing. It returns a non null value on error.
+ *****************************************************************************/
+static int vout_Manage( vout_thread_t *p_vout )
+{
+    int i_ev, i_buflen;
+    PhEvent_t *p_event;
+    boolean_t b_repos = 0;
+
+    /* allocate buffer for event */
+    i_buflen = sizeof( PhEvent_t ) * 4;
+    if( ( p_event = malloc( i_buflen ) ) == NULL )
+    {
+        intf_ErrMsg( "vout error: %s", strerror( ENOMEM ) );
+        return( 1 );
+    }
+
+    /* event loop */
+    do
+    {
+        memset( p_event, 0, i_buflen );
+        i_ev = PhEventPeek( p_event, i_buflen );
+
+        if( i_ev == Ph_RESIZE_MSG )
+        {
+            i_buflen = PhGetMsgSize( p_event );
+            if( ( p_event = realloc( p_event, i_buflen ) ) == NULL )
+            {
+                intf_ErrMsg( "vout error: %s", strerror( ENOMEM ) );
+                return( 1 );
+            }
+        }
+        else if( i_ev == Ph_EVENT_MSG )
+        {
+            PtEventHandler( p_event );
+
+            if( p_event->type == Ph_EV_WM )
+            {
+                PhWindowEvent_t *p_ev = PhGetData( p_event );
+
+                switch( p_ev->event_f )
+                {
+                case Ph_WM_CLOSE:
+                    p_main->p_intf->b_die = 1;
+                    break;
+
+                case Ph_WM_MOVE:
+                    b_repos = 1;
+                    p_vout->p_sys->pos.x = p_ev->pos.x;
+                    p_vout->p_sys->pos.y = p_ev->pos.y;
+                    break;
+
+                case Ph_WM_RESIZE:
+                    p_vout->p_sys->old_dim.w = p_vout->p_sys->dim.w;
+                    p_vout->p_sys->old_dim.h = p_vout->p_sys->dim.h;
+                    p_vout->p_sys->dim.w = p_vout->i_width = p_ev->size.w;
+                    p_vout->p_sys->dim.h = p_vout->i_height = p_ev->size.h;
+                    p_vout->i_changes |= VOUT_SIZE_CHANGE;
+                    break;
+                }
+            }
+            else if( p_event->type == Ph_EV_KEY )
+            {
+                PhKeyEvent_t *p_ev = PhGetData( p_event );
+                long i_key = p_ev->key_sym;
+
+                if( ( p_ev->key_flags & Pk_KF_Key_Down ) &&
+                    ( p_ev->key_flags & Pk_KF_Sym_Valid ) )
+                {
+                    switch( i_key )
+                    {
+                    case Pk_q:
+                    case Pk_Q:
+                        p_main->p_intf->b_die = 1;
+                        break;
+
+                    case Pk_f:
+                    case Pk_F:
+                        p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+                        break;
+
+                    case Pk_c:
+                    case Pk_C:
+                        p_vout->b_grayscale = ! p_vout->b_grayscale;
+                        p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
+                        break;
+
+                    default:
+                        if( i_key >= Pk_0 && i_key <= Pk_9 )
+                        {
+                            network_ChannelJoin( i_key );
+                        }
+                        else if( intf_ProcessKey( p_main->p_intf,
+                                                    (char) i_key ) )
+                        {
+                            intf_DbgMsg( "vout: unhandled key '%c' (%i)",
+                                         (char) i_key, i_key );
+                        }
+                        break;
+                    }
+                }
+            }
+        }
+    } while( i_ev != -1 && i_ev != 0 );
+
+    free( p_event );
+
+    /*
+     * fullscreen
+     */ 
+    if( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
+    {
+        PhDim_t dim;
+        PhPoint_t pos;
+
+        intf_DbgMsg( "vout: changing full-screen status" );
+
+        p_vout->b_fullscreen = !p_vout->b_fullscreen;
+        p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
+
+        if( p_vout->b_fullscreen )
+        {
+            pos.x = pos.y = 0;
+            dim.w = p_vout->p_sys->screen_dim.w + 1;
+            dim.h = p_vout->p_sys->screen_dim.h + 1;
+        }
+        else
+        {
+            pos.x = p_vout->p_sys->pos.x;
+            pos.y = p_vout->p_sys->pos.y;
+            dim.w = p_vout->p_sys->old_dim.w + 1;
+            dim.h = p_vout->p_sys->old_dim.h + 1;
+        }
+
+        PtSetResource( p_vout->p_sys->p_window,
+            Pt_ARG_WINDOW_RENDER_FLAGS,
+            p_vout->b_fullscreen ? Pt_FALSE : Pt_TRUE,
+            Ph_WM_RENDER_BORDER | Ph_WM_RENDER_TITLE );
+        PtSetResource( p_vout->p_sys->p_window,
+            Pt_ARG_POS, &pos, 0 );
+        PtSetResource( p_vout->p_sys->p_window,
+            Pt_ARG_DIM, &dim, 0 );
+    }
+
+    /*
+     * vout window resizing
+     */
+    if( ( p_vout->i_width  != p_vout->p_sys->dim.w ) ||
+             ( p_vout->i_height != p_vout->p_sys->dim.h ) )
+    {
+        intf_DbgMsg( "vout: resizing output window" );
+
+        p_vout->p_sys->dim.w = p_vout->i_width;
+        p_vout->p_sys->dim.h = p_vout->i_height;
+
+        /* set new dimension */
+        PtSetResource( p_vout->p_sys->p_window,
+            Pt_ARG_DIM, &p_vout->p_sys->dim, 0 );
+    }
+
+    /*
+     * size change
+     */
+    if( p_vout->i_changes & VOUT_SIZE_CHANGE )
+    {
+        intf_DbgMsg( "vout: resizing window" );
+        p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
+
+        vout_End( p_vout );
+        if( vout_Init( p_vout ) )
+        {
+            intf_ErrMsg( "vout error: cannot resize display" );
+            return( 1 );
+        }
+
+        p_vout->i_changes |= VOUT_YUV_CHANGE;
+        intf_Msg( "vout: video display resized (%dx%d)",
+                    p_vout->i_width, p_vout->i_height );
+    }
+
+    /*
+     * position change, move video channel
+     */
+    if( b_repos && p_vout->p_sys->i_mode == MODE_VIDEO_OVERLAY )
+    {
+        intf_DbgMsg( "vout: moving video channel" );
+
+        vout_End( p_vout );
+        if( vout_Init( p_vout ) )
+        {
+            intf_ErrMsg( "vout error: unable to move video channel" );
+            return( 1 );
+        }
+    }
+
+    return( i_ev == -1 );
+}
+
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to QNX server, wait until
+ * it is displayed and switch the two rendering buffer, preparing next frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout )
+{
+    if( p_vout->p_sys->i_mode == MODE_NORMAL_MEM ||
+        p_vout->p_sys->i_mode == MODE_SHARED_MEM )
+    {
+        PhPoint_t pos = { 0, 0 };
+
+        PgSetRegion( PtWidgetRid( p_vout->p_sys->p_window ) );
+        PgDrawPhImagemx( &pos, p_vout->p_sys->p_image[p_vout->i_buffer_index], 0 );
+        PgFlush();
+    }
+    else if( p_vout->p_sys->i_mode == MODE_VIDEO_MEM )
+    {
+        PhRect_t rc = { { 0, 0 }, { 
+                p_vout->p_sys->dim.w,
+                p_vout->p_sys->dim.h
+        } };
+
+        PgSetRegion( PtWidgetRid ( p_vout->p_sys->p_window ) );
+        PgContextBlit( p_vout->p_sys->p_ctx[p_vout->i_buffer_index], &rc, NULL, &rc );
+        PgFlush();
+    }
+    else if( p_vout->p_sys->i_mode == MODE_VIDEO_OVERLAY &&
+             p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_YV12 )
+    {
+        int i_size, i_index;
+
+        /* this code has NOT been tested */
+
+        i_size = p_vout->p_rendered_pic->i_width *
+                p_vout->p_rendered_pic->i_height;
+        i_index = PgNextVideoFrame( p_vout->p_sys->p_channel );
+    
+        memcpy( p_vout->p_sys->p_vc_y[i_index],
+            p_vout->p_rendered_pic->p_y, i_size );
+        memcpy( p_vout->p_sys->p_vc_v[i_index],
+            p_vout->p_rendered_pic->p_v, i_size / 4 );
+        memcpy( p_vout->p_sys->p_vc_u[i_index],
+            p_vout->p_rendered_pic->p_u, i_size / 4 );
+    }
+}
+
+/*****************************************************************************
+ * QNXInitDisplay: check screen resolution, depth, amount of video ram, etc
+ *****************************************************************************/
+static int QNXInitDisplay( p_vout_thread_t p_vout )
+{
+    PgHWCaps_t hwcaps;
+    PgDisplaySettings_t cfg;
+    PgVideoModeInfo_t minfo;
+
+    /* get graphics card hw capabilities */
+    if( PgGetGraphicsHWCaps( &hwcaps ) != 0 )
+    {
+        intf_ErrMsg( "vout error: unable to get gfx card capabilities" );
+        return( 1 );
+    }
+
+    /* get current video mode */
+    if( PgGetVideoMode( &cfg ) != 0 )
+    {
+        intf_ErrMsg( "vout error: unable to get current video mode" );
+        return( 1 );
+    }
+
+    /* get video mode info */
+    if( PgGetVideoModeInfo( cfg.mode, &minfo ) != 0 )
+    {
+        intf_ErrMsg( "vout error: unable to get info for video mode" );
+        return( 1 );
+    }
+
+    /* use video ram if we have enough available */
+    if( p_vout->p_sys->i_mode == MODE_NORMAL_MEM &&
+        hwcaps.currently_available_video_ram >= 
+        ( ( minfo.width * minfo.height * minfo.bits_per_pixel ) / 8 ) )
+    {
+        intf_DbgMsg( "vout: using video ram" );
+        p_vout->p_sys->i_mode = MODE_VIDEO_MEM;
+    }
+
+    p_vout->p_sys->i_img_type = minfo.type;
+    p_vout->p_sys->screen_dim.w = minfo.width;
+    p_vout->p_sys->screen_dim.h = minfo.height;
+    p_vout->i_screen_depth = minfo.bits_per_pixel;
+
+    switch( minfo.type )
+    {
+        case Pg_IMAGE_PALETTE_BYTE:
+            p_vout->i_bytes_per_pixel = 1;
+            break;
+
+        case Pg_IMAGE_DIRECT_555:
+        case Pg_IMAGE_DIRECT_565:
+            p_vout->i_bytes_per_pixel = 2;
+            break;
+    
+        case Pg_IMAGE_DIRECT_8888:
+            p_vout->i_bytes_per_pixel = 4;
+            break;
+    }
+
+    switch( p_vout->i_screen_depth )
+    {
+        case 15:
+            p_vout->i_red_mask   = 0x7c00;
+            p_vout->i_green_mask = 0x03e0;
+            p_vout->i_blue_mask  = 0x001f;
+            break;
+
+        case 16:
+            p_vout->i_red_mask   = 0xf800;
+            p_vout->i_green_mask = 0x07e0;
+            p_vout->i_blue_mask  = 0x001f;
+            break;
+
+        case 24:
+        case 32:
+        default:
+            p_vout->i_red_mask   = 0xff0000;
+            p_vout->i_green_mask = 0x00ff00;
+            p_vout->i_blue_mask  = 0x0000ff;
+            break;
+    }
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * QNXCreateWnd: create and realize the main window
+ *****************************************************************************/
+static int QNXCreateWnd( p_vout_thread_t p_vout )
+{
+    PtArg_t args[8];
+    PhPoint_t pos = { 0, 0 };
+    PgColor_t color = Pg_BLACK;
+
+    /* correct way to check for overlay support:
+
+        1. call PgGetGraphicsHWCaps and check
+           the results for Pg_VIDEO_OVERLAY
+        2. check if the current graphics mode
+           has PgVM_MODE_CAP1_VIDEO_OVERLAY set
+        3. call PgGetScalerCapabilities for info
+
+        problems:
+
+        1. Pg_VIDEO_OVERLAY is not defined in any
+           header files :)
+        2. PgVM_MODE_CAP1_VIDEO_OVERLAY is not set
+           even if the current mode supports overlay
+        3. the flags (chroma, etc) do not reflect
+           the actual capabilities 
+    */
+    
+    if( p_vout->p_sys->i_mode == MODE_VIDEO_OVERLAY )
+    {
+        if( ( p_vout->p_sys->p_channel = 
+            PgCreateVideoChannel( Pg_VIDEO_CHANNEL_SCALER, 0 ) ) == NULL )
+        {
+            intf_ErrMsg( "vout error: unable to create video channel" );
+            return( 1 );
+        }
+        else
+        {
+            int i = 0;
+            PgScalerCaps_t vcaps;
+
+            vcaps.size = sizeof( vcaps );
+            while( PgGetScalerCapabilities( p_vout->p_sys->p_channel, 
+                                            i++, &vcaps ) == 0 )
+            {    
+                if( vcaps.format == Pg_VIDEO_FORMAT_YV12 ||
+                    vcaps.format == Pg_VIDEO_FORMAT_RGB8888 )
+                {
+                    p_vout->p_sys->i_vc_flags  = vcaps.flags;
+                    p_vout->p_sys->i_vc_format = vcaps.format;
+                }
+                
+                vcaps.size = sizeof( vcaps );
+            }
+
+            if( p_vout->p_sys->i_vc_format == 0 )
+            {
+                intf_ErrMsg( "vout error: need YV12 or RGB8888 overlay" );
+                return( 1 );
+            }
+            else if( vcaps.flags & Pg_SCALER_CAP_DST_CHROMA_KEY )
+            {
+                color = PgGetOverlayChromaColor();
+            }
+        }
+    }
+
+    /* fullscreen, set dimension */
+    if( p_vout->b_fullscreen )
+    {
+        p_vout->p_sys->old_dim.w = p_vout->p_sys->dim.w;
+        p_vout->p_sys->old_dim.h = p_vout->p_sys->dim.h;
+        p_vout->i_width = p_vout->p_sys->dim.w = p_vout->p_sys->screen_dim.w;
+        p_vout->i_height = p_vout->p_sys->dim.h = p_vout->p_sys->screen_dim.h;
+    }
+
+    /* set window parameters */
+    PtSetArg( &args[0], Pt_ARG_POS, &pos, 0 );
+    PtSetArg( &args[1], Pt_ARG_DIM, &p_vout->p_sys->dim, 0 );
+    PtSetArg( &args[2], Pt_ARG_FILL_COLOR, color, 0 );
+    PtSetArg( &args[3], Pt_ARG_WINDOW_TITLE, "VideoLan Client", 0 );
+    PtSetArg( &args[4], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_CLOSE );
+    PtSetArg( &args[5], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, 
+                Ph_WM_MOVE | Ph_WM_RESIZE | Ph_WM_CLOSE );
+    PtSetArg( &args[6], Pt_ARG_WINDOW_RENDER_FLAGS,
+        p_vout->b_fullscreen ? Pt_FALSE : Pt_TRUE,
+        Ph_WM_RENDER_BORDER | Ph_WM_RENDER_TITLE );
+
+    /* create window */
+    p_vout->p_sys->p_window = PtCreateWidget( PtWindow, Pt_NO_PARENT, 7, args);
+    if( p_vout->p_sys->p_window == NULL )
+    {
+        intf_ErrMsg( "vout error: unable to create window" );
+        return( 1 );
+    }
+
+    /* realize the window widget */
+    if( PtRealizeWidget( p_vout->p_sys->p_window ) != 0 )
+    {
+        intf_ErrMsg( "vout error: unable to realize window widget" );
+        PtDestroyWidget( p_vout->p_sys->p_window );
+        return( 1 );
+    }
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * QNXDestroyWnd: unrealize and destroy the main window
+ *****************************************************************************/
+static int QNXDestroyWnd( p_vout_thread_t p_vout )
+{
+    /* destroy the window widget */
+    PtUnrealizeWidget( p_vout->p_sys->p_window );
+    PtDestroyWidget( p_vout->p_sys->p_window );
+
+    /* destroy video channel */
+    if( p_vout->p_sys->i_mode == MODE_VIDEO_OVERLAY )
+    {
+        PgDestroyVideoChannel( p_vout->p_sys->p_channel );
+    }
+
+    return( 0 );
+}