From 6509fa93f9b8f6b0cacdce8a46dca5f36f725360 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Date: Tue, 26 Jun 2001 21:06:07 +0000
Subject: [PATCH] Added /dev/parport support for direct port access.

---
 configure                    | 301 +++++++++++++++++++----------------
 configure.in                 |  13 ++
 documentation/samples/config |   8 +
 include/config.h.in          |   6 +-
 include/miscemu.h            |   6 +
 msdos/Makefile.in            |   1 +
 msdos/ioports.c              |  21 ++-
 msdos/ppdev.c                | 288 +++++++++++++++++++++++++++++++++
 8 files changed, 507 insertions(+), 137 deletions(-)
 create mode 100644 msdos/ppdev.c

diff --git a/configure b/configure
index 595cb47e080..115c7f9aadd 100755
--- a/configure
+++ b/configure
@@ -4812,13 +4812,48 @@ fi
 
 
 
+echo $ac_n "checking "for parport header/ppdev.h"""... $ac_c" 1>&6
+echo "configure:4817: checking "for parport header/ppdev.h"" >&5
+if eval "test \"`echo '$''{'ac_cv_c_ppdev'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4822 "configure"
+#include "confdefs.h"
+#include <linux/ppdev.h>
+int main() {
+ioctl (1,PPCLAIM,0)
+; return 0; }
+EOF
+if { (eval echo configure:4829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_ppdev="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_ppdev="no"
+fi
+rm -f conftest*
+ 
+fi
+
+echo "$ac_t""$ac_cv_c_ppdev" 1>&6
+if test "$ac_cv_c_ppdev" = "yes"
+then
+    cat >> confdefs.h <<\EOF
+#define HAVE_PPDEV 1
+EOF
+
+fi
+
 echo $ac_n "checking "for GNU style IPX support"""... $ac_c" 1>&6
-echo "configure:4817: checking "for GNU style IPX support"" >&5
+echo "configure:4852: checking "for GNU style IPX support"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_ipx_gnu'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4822 "configure"
+#line 4857 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
     #include <netipx/ipx.h>
@@ -4826,7 +4861,7 @@ int main() {
 ((struct sockaddr_ipx *)0)->sipx_family == AF_IPX
 ; return 0; }
 EOF
-if { (eval echo configure:4830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_ipx_gnu="yes"
 else
@@ -4851,12 +4886,12 @@ fi
 if test "$ac_cv_c_ipx_gnu" = "no"
 then
  echo $ac_n "checking "for linux style IPX support"""... $ac_c" 1>&6
-echo "configure:4855: checking "for linux style IPX support"" >&5
+echo "configure:4890: checking "for linux style IPX support"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_ipx_linux'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4860 "configure"
+#line 4895 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
      #include <asm/types.h>
@@ -4865,7 +4900,7 @@ int main() {
 ((struct sockaddr_ipx *)0)->sipx_family == AF_IPX
 ; return 0; }
 EOF
-if { (eval echo configure:4869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_ipx_linux="yes"
 else
@@ -4892,17 +4927,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h soundcard.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4896: checking for $ac_hdr" >&5
+echo "configure:4931: 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 4901 "configure"
+#line 4936 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4941: \"$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*
@@ -4930,12 +4965,12 @@ done
 
 
 echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6
-echo "configure:4934: checking "for Open Sound System"" >&5
+echo "configure:4969: checking "for Open Sound System"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4939 "configure"
+#line 4974 "configure"
 #include "confdefs.h"
 
 	#if defined(HAVE_SYS_SOUNDCARD_H)
@@ -4956,7 +4991,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_opensoundsystem="yes"
 else
@@ -4979,12 +5014,12 @@ EOF
 fi
 
 echo $ac_n "checking "for Open Sound System/MIDI interface"""... $ac_c" 1>&6
-echo "configure:4983: checking "for Open Sound System/MIDI interface"" >&5
+echo "configure:5018: checking "for Open Sound System/MIDI interface"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem_midi'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4988 "configure"
+#line 5023 "configure"
 #include "confdefs.h"
 
 	#if defined(HAVE_SYS_SOUNDCARD_H)
@@ -5005,7 +5040,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_opensoundsystem_midi="yes"
 else
@@ -5031,7 +5066,7 @@ if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
 
 
 echo $ac_n "checking "whether mmap64 works defined as mmap"""... $ac_c" 1>&6
-echo "configure:5035: checking "whether mmap64 works defined as mmap"" >&5
+echo "configure:5070: checking "whether mmap64 works defined as mmap"" >&5
 if eval "test \"`echo '$''{'ac_cv_mmap64_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5039,7 +5074,7 @@ else
   ac_cv_mmap64_works="no"
 else
   cat > conftest.$ac_ext <<EOF
-#line 5043 "configure"
+#line 5078 "configure"
 #include "confdefs.h"
 
 		#define _FILE_OFFSET_BITS 64
@@ -5069,7 +5104,7 @@ else
 
 	
 EOF
-if { (eval echo configure:5073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_mmap64_works="yes"
 else
@@ -5098,7 +5133,7 @@ if test "x${GCC}" = "xyes"
 then
   CFLAGS="$CFLAGS -Wall"
   echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
-echo "configure:5102: checking "for gcc strength-reduce bug"" >&5
+echo "configure:5137: checking "for gcc strength-reduce bug"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5106,7 +5141,7 @@ else
   ac_cv_c_gcc_strength_bug="yes"
 else
   cat > conftest.$ac_ext <<EOF
-#line 5110 "configure"
+#line 5145 "configure"
 #include "confdefs.h"
 
 int	L[4] = {0,1,2,3};
@@ -5121,7 +5156,7 @@ int main(void) {
   exit( Array[1] != -2 || L[2] != 3);
 }
 EOF
-if { (eval echo configure:5125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_gcc_strength_bug="no"
 else
@@ -5142,21 +5177,21 @@ echo "$ac_t""$ac_cv_c_gcc_strength_bug" 1>&6
   fi
 
     echo $ac_n "checking "for gcc -mpreferred-stack-boundary=2 support"""... $ac_c" 1>&6
-echo "configure:5146: checking "for gcc -mpreferred-stack-boundary=2 support"" >&5
+echo "configure:5181: checking "for gcc -mpreferred-stack-boundary=2 support"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_gcc_stack_boundary'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   saved_cflags=$CFLAGS
   CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
   cat > conftest.$ac_ext <<EOF
-#line 5153 "configure"
+#line 5188 "configure"
 #include "confdefs.h"
 
 int main() {
 return 0
 ; return 0; }
 EOF
-if { (eval echo configure:5160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_gcc_stack_boundary="yes"
 else
@@ -5179,7 +5214,7 @@ fi
 
 
 echo $ac_n "checking "whether .type must sit inside a .def directive"""... $ac_c" 1>&6
-echo "configure:5183: checking "whether .type must sit inside a .def directive"" >&5
+echo "configure:5218: checking "whether .type must sit inside a .def directive"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_type_in_def'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5192,14 +5227,14 @@ _ac_test:
 	.long 0
 EOF
 cat > conftest.$ac_ext <<EOF
-#line 5196 "configure"
+#line 5231 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_type_in_def="yes"
 else
@@ -5223,7 +5258,7 @@ fi
  
 
 echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
-echo "configure:5227: checking "whether external symbols need an underscore prefix"" >&5
+echo "configure:5262: checking "whether external symbols need an underscore prefix"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5235,14 +5270,14 @@ _ac_test:
 	.long 0
 EOF
 cat > conftest.$ac_ext <<EOF
-#line 5239 "configure"
+#line 5274 "configure"
 #include "confdefs.h"
 extern int ac_test;
 int main() {
 if (ac_test) return 1
 ; return 0; }
 EOF
-if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_extern_prefix="yes"
 else
@@ -5266,7 +5301,7 @@ fi
 
 
 echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6
-echo "configure:5270: checking "whether assembler accepts .string"" >&5
+echo "configure:5305: checking "whether assembler accepts .string"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5276,14 +5311,14 @@ cat > conftest_asm.s <<EOF
 	.string "test"
 EOF
 cat > conftest.$ac_ext <<EOF
-#line 5280 "configure"
+#line 5315 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_asm_string="yes"
 else
@@ -5311,21 +5346,21 @@ LDDLLFLAGS=""
 if test "$LIBEXT" = "so"
 then
   echo $ac_n "checking "whether we can build a GNU style ELF dll"""... $ac_c" 1>&6
-echo "configure:5315: checking "whether we can build a GNU style ELF dll"" >&5
+echo "configure:5350: checking "whether we can build a GNU style ELF dll"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_dll_gnuelf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   saved_cflags=$CFLAGS
   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
   cat > conftest.$ac_ext <<EOF
-#line 5322 "configure"
+#line 5357 "configure"
 #include "confdefs.h"
 
 int main() {
 return 1
 ; return 0; }
 EOF
-if { (eval echo configure:5329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_dll_gnuelf="yes"
 else
@@ -5346,21 +5381,21 @@ echo "$ac_t""$ac_cv_c_dll_gnuelf" 1>&6
     LDDLLFLAGS="-Wl,-Bsymbolic"
   else
     echo $ac_n "checking whether we can build a UnixWare (Solaris) dll""... $ac_c" 1>&6
-echo "configure:5350: checking whether we can build a UnixWare (Solaris) dll" >&5
+echo "configure:5385: checking whether we can build a UnixWare (Solaris) dll" >&5
 if eval "test \"`echo '$''{'ac_cv_c_dll_unixware'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   saved_cflags=$CFLAGS
     CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
     cat > conftest.$ac_ext <<EOF
-#line 5357 "configure"
+#line 5392 "configure"
 #include "confdefs.h"
 
 int main() {
 return 1
 ; return 0; }
 EOF
-if { (eval echo configure:5364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_dll_unixware="yes"
 else
@@ -5415,21 +5450,21 @@ elif test "$LIBEXT" = "dll"; then
 else
     DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) \$(LIBWINE) \$(LIBUNICODE) \$(X_LIBS) \$(XLIB)"
     echo $ac_n "checking whether the linker supports --[no]-whole-archive (Linux)""... $ac_c" 1>&6
-echo "configure:5419: checking whether the linker supports --[no]-whole-archive (Linux)" >&5
+echo "configure:5454: checking whether the linker supports --[no]-whole-archive (Linux)" >&5
 if eval "test \"`echo '$''{'ac_cv_c_whole_archive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   saved_cflags=$CFLAGS
             CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive"
             cat > conftest.$ac_ext <<EOF
-#line 5426 "configure"
+#line 5461 "configure"
 #include "confdefs.h"
 
 int main() {
 return 1
 ; return 0; }
 EOF
-if { (eval echo configure:5433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_whole_archive="yes"
 else
@@ -5449,21 +5484,21 @@ echo "$ac_t""$ac_cv_c_whole_archive" 1>&6
         DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive"
     else
         echo $ac_n "checking whether the linker supports -z {all,default}extract (Linux)""... $ac_c" 1>&6
-echo "configure:5453: checking whether the linker supports -z {all,default}extract (Linux)" >&5
+echo "configure:5488: checking whether the linker supports -z {all,default}extract (Linux)" >&5
 if eval "test \"`echo '$''{'ac_cv_c_allextract'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   saved_cflags=$CFLAGS
 		CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract"
 		cat > conftest.$ac_ext <<EOF
-#line 5460 "configure"
+#line 5495 "configure"
 #include "confdefs.h"
 
 int main() {
 return 1
 ; return 0; }
 EOF
-if { (eval echo configure:5467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_c_allextract="yes"
 else
@@ -5498,7 +5533,7 @@ fi
 wine_cv_libc_reentrant=no 
 
   echo $ac_n "checking for reentrant libc: __errno_location""... $ac_c" 1>&6
-echo "configure:5502: checking for reentrant libc: __errno_location" >&5
+echo "configure:5537: checking for reentrant libc: __errno_location" >&5
 if eval "test \"`echo '$''{'wine_cv_libc_r___errno_location'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5506,14 +5541,14 @@ else
   wine_cv_libc_r___errno_location=yes 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5510 "configure"
+#line 5545 "configure"
 #include "confdefs.h"
 int myerrno = 0;
 char buf[256];
 int *__errno_location(){return &myerrno;}
 main(){connect(0,buf,255); exit(!myerrno);}
 EOF
-if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   wine_cv_libc_r___errno_location=yes
 else
@@ -5536,7 +5571,7 @@ fi
 
 
   echo $ac_n "checking for reentrant libc: __error""... $ac_c" 1>&6
-echo "configure:5540: checking for reentrant libc: __error" >&5
+echo "configure:5575: checking for reentrant libc: __error" >&5
 if eval "test \"`echo '$''{'wine_cv_libc_r___error'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5544,14 +5579,14 @@ else
   wine_cv_libc_r___error=yes 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5548 "configure"
+#line 5583 "configure"
 #include "confdefs.h"
 int myerrno = 0;
 char buf[256];
 int *__error(){return &myerrno;}
 main(){connect(0,buf,255); exit(!myerrno);}
 EOF
-if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   wine_cv_libc_r___error=yes
 else
@@ -5574,7 +5609,7 @@ fi
 
 
   echo $ac_n "checking for reentrant libc: ___errno""... $ac_c" 1>&6
-echo "configure:5578: checking for reentrant libc: ___errno" >&5
+echo "configure:5613: checking for reentrant libc: ___errno" >&5
 if eval "test \"`echo '$''{'wine_cv_libc_r____errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5582,14 +5617,14 @@ else
   wine_cv_libc_r____errno=yes 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5586 "configure"
+#line 5621 "configure"
 #include "confdefs.h"
 int myerrno = 0;
 char buf[256];
 int *___errno(){return &myerrno;}
 main(){connect(0,buf,255); exit(!myerrno);}
 EOF
-if { (eval echo configure:5593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   wine_cv_libc_r____errno=yes
 else
@@ -5612,7 +5647,7 @@ fi
 
 
   echo $ac_n "checking for reentrant libc: __thr_errno""... $ac_c" 1>&6
-echo "configure:5616: checking for reentrant libc: __thr_errno" >&5
+echo "configure:5651: checking for reentrant libc: __thr_errno" >&5
 if eval "test \"`echo '$''{'wine_cv_libc_r___thr_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5620,14 +5655,14 @@ else
   wine_cv_libc_r___thr_errno=yes 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5624 "configure"
+#line 5659 "configure"
 #include "confdefs.h"
 int myerrno = 0;
 char buf[256];
 int *__thr_errno(){return &myerrno;}
 main(){connect(0,buf,255); exit(!myerrno);}
 EOF
-if { (eval echo configure:5631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   wine_cv_libc_r___thr_errno=yes
 else
@@ -5650,7 +5685,7 @@ fi
 
 
   echo $ac_n "checking for reentrant libc: __errno""... $ac_c" 1>&6
-echo "configure:5654: checking for reentrant libc: __errno" >&5
+echo "configure:5689: checking for reentrant libc: __errno" >&5
 if eval "test \"`echo '$''{'wine_cv_libc_r___errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5658,14 +5693,14 @@ else
   wine_cv_libc_r___errno=yes 
 else
   cat > conftest.$ac_ext <<EOF
-#line 5662 "configure"
+#line 5697 "configure"
 #include "confdefs.h"
 int myerrno = 0;
 char buf[256];
 int *__errno(){return &myerrno;}
 main(){connect(0,buf,255); exit(!myerrno);}
 EOF
-if { (eval echo configure:5669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   wine_cv_libc_r___errno=yes
 else
@@ -5699,7 +5734,7 @@ fi
 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
 then
 echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6
-echo "configure:5703: checking "for reentrant X libraries"" >&5
+echo "configure:5738: checking "for reentrant X libraries"" >&5
 if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5748,19 +5783,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:5752: checking for working alloca.h" >&5
+echo "configure:5787: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5757 "configure"
+#line 5792 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:5764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -5781,12 +5816,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5785: checking for alloca" >&5
+echo "configure:5820: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5790 "configure"
+#line 5825 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -5814,7 +5849,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:5818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -5846,12 +5881,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5850: checking whether alloca needs Cray hooks" >&5
+echo "configure:5885: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5855 "configure"
+#line 5890 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -5876,12 +5911,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5880: checking for $ac_func" >&5
+echo "configure:5915: 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 5885 "configure"
+#line 5920 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5904,7 +5939,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5943: \"$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
@@ -5931,7 +5966,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:5935: checking stack direction for C alloca" >&5
+echo "configure:5970: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5939,7 +5974,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 5943 "configure"
+#line 5978 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -5958,7 +5993,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:5962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -6018,12 +6053,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6022: checking for $ac_func" >&5
+echo "configure:6057: 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 6027 "configure"
+#line 6062 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6046,7 +6081,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6085: \"$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
@@ -6128,17 +6163,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6132: checking for $ac_hdr" >&5
+echo "configure:6167: 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 6137 "configure"
+#line 6172 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6177: \"$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*
@@ -6165,12 +6200,12 @@ fi
 done
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:6169: checking whether stat file-mode macros are broken" >&5
+echo "configure:6204: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6174 "configure"
+#line 6209 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -6223,12 +6258,12 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:6227: checking for working const" >&5
+echo "configure:6262: 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 6232 "configure"
+#line 6267 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -6277,7 +6312,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -6298,21 +6333,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:6302: checking for inline" >&5
+echo "configure:6337: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 6309 "configure"
+#line 6344 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:6316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -6338,12 +6373,12 @@ EOF
 esac
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6342: checking for ANSI C header files" >&5
+echo "configure:6377: 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 6347 "configure"
+#line 6382 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6351,7 +6386,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6390: \"$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*
@@ -6368,7 +6403,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 6372 "configure"
+#line 6407 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -6386,7 +6421,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 6390 "configure"
+#line 6425 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -6407,7 +6442,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 6411 "configure"
+#line 6446 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -6418,7 +6453,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:6422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -6442,12 +6477,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:6446: checking for size_t" >&5
+echo "configure:6481: 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 6451 "configure"
+#line 6486 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6475,7 +6510,7 @@ EOF
 fi
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:6479: checking size of long long" >&5
+echo "configure:6514: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6483,7 +6518,7 @@ else
   ac_cv_sizeof_long_long=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 6487 "configure"
+#line 6522 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <sys/types.h>
@@ -6495,7 +6530,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:6499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -6516,12 +6551,12 @@ EOF
 
 
 echo $ac_n "checking "whether linux/input.h is for real"""... $ac_c" 1>&6
-echo "configure:6520: checking "whether linux/input.h is for real"" >&5
+echo "configure:6555: checking "whether linux/input.h is for real"" >&5
 if eval "test \"`echo '$''{'wine_cv_linux_input_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6525 "configure"
+#line 6560 "configure"
 #include "confdefs.h"
 
 	    #include <linux/input.h>
@@ -6534,7 +6569,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_linux_input_h=yes
 else
@@ -6558,12 +6593,12 @@ EOF
 
    
 echo $ac_n "checking "whether we can use re-entrant gethostbyname_r Linux style"""... $ac_c" 1>&6
-echo "configure:6562: checking "whether we can use re-entrant gethostbyname_r Linux style"" >&5
+echo "configure:6597: checking "whether we can use re-entrant gethostbyname_r Linux style"" >&5
 if eval "test \"`echo '$''{'wine_cv_linux_gethostbyname_r_6'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6567 "configure"
+#line 6602 "configure"
 #include "confdefs.h"
 
 #include <netdb.h>
@@ -6584,7 +6619,7 @@ int main() {
     
 ; return 0; }
 EOF
-if { (eval echo configure:6588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_linux_gethostbyname_r_6=yes
 else
@@ -6610,12 +6645,12 @@ EOF
 if test "$ac_cv_header_linux_joystick_h" = "yes"
 then
    echo $ac_n "checking "whether linux/joystick.h uses the Linux 2.2+ API"""... $ac_c" 1>&6
-echo "configure:6614: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5
+echo "configure:6649: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5
 if eval "test \"`echo '$''{'wine_cv_linux_joystick_22_api'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6619 "configure"
+#line 6654 "configure"
 #include "confdefs.h"
 
 	#include <sys/ioctl.h>
@@ -6630,7 +6665,7 @@ int main() {
 /*empty*/
 ; return 0; }
 EOF
-if { (eval echo configure:6634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_linux_joystick_22_api=yes
 else
@@ -6657,12 +6692,12 @@ fi
 if test "$ac_cv_header_sys_vfs_h" = "yes"
 then
     echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6
-echo "configure:6661: checking "whether sys/vfs.h defines statfs"" >&5
+echo "configure:6696: checking "whether sys/vfs.h defines statfs"" >&5
 if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6666 "configure"
+#line 6701 "configure"
 #include "confdefs.h"
 
 	#include <sys/types.h>
@@ -6679,7 +6714,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_sys_vfs_has_statfs=yes
 else
@@ -6706,12 +6741,12 @@ fi
 if test "$ac_cv_header_sys_statfs_h" = "yes"
 then
     echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6
-echo "configure:6710: checking "whether sys/statfs.h defines statfs"" >&5
+echo "configure:6745: checking "whether sys/statfs.h defines statfs"" >&5
 if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6715 "configure"
+#line 6750 "configure"
 #include "confdefs.h"
 
 	#include <sys/types.h>
@@ -6726,7 +6761,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_sys_statfs_has_statfs=yes
 else
@@ -6753,12 +6788,12 @@ fi
 if test "$ac_cv_header_sys_mount_h" = "yes"
 then
     echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6
-echo "configure:6757: checking "whether sys/mount.h defines statfs"" >&5
+echo "configure:6792: checking "whether sys/mount.h defines statfs"" >&5
 if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6762 "configure"
+#line 6797 "configure"
 #include "confdefs.h"
 
 	#include <sys/types.h>
@@ -6773,7 +6808,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_sys_mount_has_statfs=yes
 else
@@ -6799,7 +6834,7 @@ fi
 
 
 echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
-echo "configure:6803: checking "for statfs.f_bfree"" >&5
+echo "configure:6838: checking "for statfs.f_bfree"" >&5
 if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6808,7 +6843,7 @@ else
         wine_cv_statfs_bfree=no
     else
     	cat > conftest.$ac_ext <<EOF
-#line 6812 "configure"
+#line 6847 "configure"
 #include "confdefs.h"
 
 	#include <sys/types.h>
@@ -6835,7 +6870,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_statfs_bfree=yes
 else
@@ -6859,7 +6894,7 @@ EOF
 fi
 
 echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6
-echo "configure:6863: checking "for statfs.f_bavail"" >&5
+echo "configure:6898: checking "for statfs.f_bavail"" >&5
 if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6868,7 +6903,7 @@ else
         wine_cv_statfs_bavail=no
     else
     	cat > conftest.$ac_ext <<EOF
-#line 6872 "configure"
+#line 6907 "configure"
 #include "confdefs.h"
 
 	#include <sys/types.h>
@@ -6895,7 +6930,7 @@ int main() {
 	
 ; return 0; }
 EOF
-if { (eval echo configure:6899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   wine_cv_statfs_bavail=yes
 else
@@ -6920,12 +6955,12 @@ fi
 
 
 echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6
-echo "configure:6924: checking "for msg_accrights in struct msghdr"" >&5
+echo "configure:6959: checking "for msg_accrights in struct msghdr"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6929 "configure"
+#line 6964 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6933,7 +6968,7 @@ int main() {
 struct msghdr hdr; hdr.msg_accrights=0
 ; return 0; }
 EOF
-if { (eval echo configure:6937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_msg_accrights="yes"
 else
@@ -6956,12 +6991,12 @@ fi
 
 
 echo $ac_n "checking "for sun_len in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:6960: checking "for sun_len in struct sockaddr_un"" >&5
+echo "configure:6995: checking "for sun_len in struct sockaddr_un"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_sun_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6965 "configure"
+#line 7000 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6970,7 +7005,7 @@ int main() {
 static struct sockaddr_un addr; addr.sun_len = 1
 ; return 0; }
 EOF
-if { (eval echo configure:6974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_sun_len="yes"
 else
@@ -6993,12 +7028,12 @@ fi
 
 
 echo $ac_n "checking "whether we need to define __i386__"""... $ac_c" 1>&6
-echo "configure:6997: checking "whether we need to define __i386__"" >&5
+echo "configure:7032: checking "whether we need to define __i386__"" >&5
 if eval "test \"`echo '$''{'ac_cv_cpp_def_i386'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7002 "configure"
+#line 7037 "configure"
 #include "confdefs.h"
 #if (defined(i386) || defined(__i386)) && !defined(__i386__)
 yes
diff --git a/configure.in b/configure.in
index df3a575afb8..9e34ffa75d2 100644
--- a/configure.in
+++ b/configure.in
@@ -430,6 +430,19 @@ fi
 AC_SUBST(FREETYPELIBS)
 AC_SUBST(FREETYPEINCL)
 
+dnl **** Check for parport (currently Linux only) ****
+AC_CACHE_CHECK("for parport header/ppdev.h", ac_cv_c_ppdev,
+ AC_TRY_COMPILE(
+   [#include <linux/ppdev.h>],
+   [ioctl (1,PPCLAIM,0)],
+   [ac_cv_c_ppdev="yes"],
+   [ac_cv_c_ppdev="no"])
+ )
+if test "$ac_cv_c_ppdev" = "yes"
+then
+    AC_DEFINE(HAVE_PPDEV,1,[Define if we can use ppdev.h for parallel port access])
+fi
+
 dnl **** Check for IPX (currently Linux only) ****
 AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
  AC_TRY_COMPILE(
diff --git a/documentation/samples/config b/documentation/samples/config
index 477741c5ae6..73be5265fb1 100644
--- a/documentation/samples/config
+++ b/documentation/samples/config
@@ -167,6 +167,14 @@ WINE REGISTRY Version 2
 [parallelports]
 "Lpt1" = "/dev/lp0"
 
+[ppdev]
+;; key:  io-base of the emulated port
+;; value : parport-device{,timeout}
+;; timeout for auto closing an open device ( not yet implemented)
+;"378" = "/dev/parport0"
+;"278" = "/dev/parport1"
+;"3bc" = "/dev/parport2"
+
 [spooler]
 "FILE:" = "tmp.ps"
 "LPT1:" = "|lpr"
diff --git a/include/config.h.in b/include/config.h.in
index 870dc716fdc..52ba4962856 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -40,9 +40,6 @@
 /* Define if the X Window System is missing or not being used.  */
 #undef X_DISPLAY_MISSING
 
-/* Define if lex declares yytext as a char * by default, not a char[].  */
-#undef YYTEXT_POINTER
-
 /* Define if .type asm directive must be inside a .def directive */
 #undef NEED_TYPE_IN_DEF
 
@@ -526,6 +523,9 @@
 /* Define if you have the xpg4 library (-lxpg4).  */
 #undef HAVE_LIBXPG4
 
+/* Define if we can use ppdev.h for parallel port access */
+#undef HAVE_PPDEV
+
 /* Set this to 64 to enable 64-bit file support on Linux */
 #undef _FILE_OFFSET_BITS
 
diff --git a/include/miscemu.h b/include/miscemu.h
index d8ff0159599..eea5483c2bd 100644
--- a/include/miscemu.h
+++ b/include/miscemu.h
@@ -249,6 +249,12 @@ extern void WINAPI XMS_Handler(CONTEXT86*);
 /* misc/aspi.c */
 extern void ASPI_DOS_HandleInt(CONTEXT86 *context);
 
+/* misc/ppdev.c */
+
+extern BOOL IO_pp_outp(int port, DWORD* res);
+extern int IO_pp_inp(int port, DWORD* res);
+extern char IO_pp_init(void);
+
 #define PTR_REAL_TO_LIN(seg,off) \
    ((void*)(((unsigned int)(seg) << 4) + LOWORD(off)))
 
diff --git a/msdos/Makefile.in b/msdos/Makefile.in
index 44f14a0f679..e77eb15e161 100644
--- a/msdos/Makefile.in
+++ b/msdos/Makefile.in
@@ -36,6 +36,7 @@ C_SRCS = \
 	int5c.c \
 	interrupts.c \
 	ioports.c \
+	ppdev.c \
 	vga.c \
 	vxd.c
 
diff --git a/msdos/ioports.c b/msdos/ioports.c
index 18a73cf33bf..ec2cb9ac394 100644
--- a/msdos/ioports.c
+++ b/msdos/ioports.c
@@ -62,13 +62,17 @@ static BYTE cmosimage[64] =
 # define DIRECT_IO_ACCESS
 #else
 # undef DIRECT_IO_ACCESS
+# undef PP_IO_ACCESS
 #endif  /* linux && __i386__ */
 
 #ifdef DIRECT_IO_ACCESS
 
 extern int iopl(int level);
-
 static char do_direct_port_access = -1;
+#ifdef HAVE_PPDEV
+static char do_pp_port_access = -1; /* -1: uninitialized, 1: not available
+				       0: available);*/
+#endif
 static char port_permissions[0x10000];
 
 #define IO_READ  1
@@ -258,6 +262,13 @@ DWORD IO_inport( int port, int size )
 
     TRACE("%d-byte value from port 0x%02x\n", size, port );
 
+#ifdef HAVE_PPDEV
+    if (do_pp_port_access == -1) 
+      do_pp_port_access =IO_pp_init();
+    if ((do_pp_port_access == 0 ) && (size == 1))
+      if (!IO_pp_inp(port,&res))
+         return res;
+#endif
 #ifdef DIRECT_IO_ACCESS
     if (do_direct_port_access == -1) IO_port_init();
     if ((do_direct_port_access)
@@ -371,7 +382,15 @@ void IO_outport( int port, int size, DWORD value )
     TRACE("IO: 0x%lx (%d-byte value) to port 0x%02x\n",
                  value, size, port );
 
+#ifdef HAVE_PPDEV
+    if (do_pp_port_access == -1) 
+      do_pp_port_access = IO_pp_init();
+    if ((do_pp_port_access == 0) && (size == 1))
+      if (!IO_pp_outp(port,&value))
+         return;
+#endif
 #ifdef DIRECT_IO_ACCESS
+
     if (do_direct_port_access == -1) IO_port_init();
     if ((do_direct_port_access)
         /* Make sure we have access to the port */
diff --git a/msdos/ppdev.c b/msdos/ppdev.c
new file mode 100644
index 00000000000..6be95ec9fe6
--- /dev/null
+++ b/msdos/ppdev.c
@@ -0,0 +1,288 @@
+/*
+ * Parallel-port device support
+ */
+
+#include "config.h"
+
+#include "debugtools.h"
+
+DEFAULT_DEBUG_CHANNEL(int);
+
+#ifdef  HAVE_PPDEV
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <linux/ppdev.h>
+
+#include "winerror.h"
+#include "winreg.h"
+
+
+typedef struct _PPDEVICESTRUCT{
+  int fd; /* NULL if device not available */
+  char *devicename;
+  int userbase; /* where wine thinks the ports are*/
+  DWORD lastaccess; /* or NULL if release */
+  int timeout; /* time in second of inactivity to release the port*/
+} PPDeviceStruct;
+
+static PPDeviceStruct PPDeviceList[5];
+static int PPDeviceNum=0;
+
+static int IO_pp_sort(const void *p1,const  void *p2)
+{
+  return ((PPDeviceStruct*)p1)->userbase - ((PPDeviceStruct*)p2)->userbase;
+}
+
+/* IO_pp_init 
+ *
+ * Read the ppdev entries from wine.conf, open the device and check
+ * for nescessary IOCTRL
+ * Report verbose about possible errors
+ */
+char IO_pp_init(void)
+{
+    char name[80];
+    char buffer[1024];
+    HKEY hkey;
+    char temp[256];
+    int i,idx=0,fd,res,userbase,nports=0;
+    char * timeout;
+    char ret=1;
+    int lasterror;
+
+    TRACE("\n");
+    if (RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\ppdev", &hkey ) != ERROR_SUCCESS)
+      return 1;
+
+    for (;;)
+    {
+        DWORD type, count = sizeof(buffer), name_len = sizeof(name);
+
+        if (RegEnumValueA( hkey, idx, name, &name_len, NULL, &type, buffer, &count )!= ERROR_SUCCESS) 
+	  break;
+	
+	idx++;
+	if(nports >4)
+	  {
+	    FIXME("Make the PPDeviceList larger then 5 elements\n");
+	    break;
+	  }
+	TRACE("Device '%s' at virtual userbase '%s'\n", buffer,name);
+	timeout = strchr(buffer,',');
+	if (timeout)
+	  *timeout++=0;
+	fd=open(buffer,O_RDWR);
+	lasterror=errno;
+	if (fd == -1)
+	  {
+	    WARN("Configuration: No access to %s Cause: %s\n",buffer,strerror(lasterror));
+	    WARN("Rejecting configuration item\n");
+	    if (lasterror == ENODEV)
+	      FIXME("Is the ppdev module loaded?\n");
+	    continue;
+	  }
+	userbase = strtol(name,(char **)NULL, 16);
+	if ( errno == ERANGE)
+	  {
+	    WARN("Configuration: Invalid base %s for %s\n",name,buffer);
+	    WARN("Rejecting configuration item\n");
+	    continue;
+	  }
+	if (ioctl (fd,PPEXCL,0)) 
+	  {
+	    ERR("PPEXCL IOCTL rejected for device %s\n",buffer);
+	    ERR("Check that PPDEV module is loaded!\n");
+	    ERR("Perhaps the device is already in use or non-existant\n");
+	    continue;
+	  }
+	if (ioctl (fd,PPCLAIM,0)) 
+	  {
+	    ERR("PPCLAIM rejected %s\n",buffer);
+	    ERR("Perhaps the device is already in use or non-existant\n");
+	    continue;
+	  }
+	if (nports > 0)
+	  {
+	    for (i=0; i<= nports; i++)
+	      {
+		if (PPDeviceList[i].userbase == userbase)
+		  {
+		    WARN("Configuration: %s uses the same virtual ports as %s\n",
+			 buffer,PPDeviceList[0].devicename);
+		    WARN("Configuration: Rejecting configuration item");
+		    userbase = 0;
+		    break;
+		  }
+	      }
+	    if (!userbase) continue;
+	  }
+	/* Check for the minimum required IOCTLS */
+	if ((ioctl(fd,PPRDATA,&res))||
+	    (ioctl(fd,PPRCONTROL,&res))||
+	    (ioctl(fd,PPRCONTROL,&res)))
+	  {
+	    ERR("PPUSER IOCTL not available for parport device %s\n",temp);
+	    continue;
+	  }
+	PPDeviceList[nports].devicename = malloc(sizeof(buffer)+1);
+	if (!PPDeviceList[nports].devicename)
+	  {
+	    ERR("No (more)space for devicename\n");
+	    break;
+	  }
+	strcpy(PPDeviceList[nports].devicename,buffer);
+	PPDeviceList[nports].fd = fd;
+	PPDeviceList[nports].userbase = userbase;
+	PPDeviceList[nports].lastaccess=GetTickCount();
+	if (timeout)
+	  {
+	    PPDeviceList[nports].timeout = strtol(timeout,(char **)NULL, 10);
+	    if (errno == ERANGE)
+	      {
+		WARN("Configuration:Invalid timeout %s in configuration for %s, Setting to 0\n",
+		     timeout,buffer);
+		PPDeviceList[nports].timeout = 0;
+	      }
+	  }
+	else
+	  PPDeviceList[nports].timeout = 0;
+	nports++;
+    }
+    TRACE("found %d ports\n",nports);
+    RegCloseKey( hkey );
+
+    PPDeviceNum= nports;
+    if (nports > 1)
+      /* sort in accending order for userbase for faster access*/
+      qsort (PPDeviceList,PPDeviceNum,sizeof(PPDeviceStruct),IO_pp_sort);
+    
+    if (nports)
+      ret=0;
+    for (idx= 0;idx<PPDeviceNum; idx++)
+      TRACE("found device %s userbase %x fd %x timeout %d\n",
+	    PPDeviceList[idx].devicename, PPDeviceList[idx].userbase,
+	    PPDeviceList[idx].fd,PPDeviceList[idx].timeout);
+    /* FIXME:
+       register a timer callback perhaps every 30 second to release unused ports
+       Set lastaccess = 0 as indicator when port was released
+    */
+    return ret;
+}
+
+/* IO_pp_do_access
+ *
+ * Do the actual IOCTL
+ * Return NULL on success
+ */
+static int IO_pp_do_access(int idx,int ppctl, DWORD* res)
+{
+    if (!PPDeviceList[idx].lastaccess)
+      /* TIMER callback has released the device after some time of inactivity
+          Reclaim the device
+          !!!!!!THIS MAY UNINTERRUPTIPLE BLOCK IF SOME OTHER DEVICE
+           !!!!!! HAS CLAIMED THE SAME PORT
+      */
+      if (ioctl(PPDeviceList[idx].fd,PPCLAIM,0))
+       {
+         ERR("Can't reclaim device %s, PPUSER/PPDEV handling confused\n",
+             PPDeviceList[idx].devicename);
+         return 1;
+       }
+    PPDeviceList[idx].lastaccess=GetTickCount();
+    return ioctl(PPDeviceList[idx].fd,ppctl,res);
+}
+
+/* IO_pp_inp
+ *
+ * Check if we can satisfy the INP command with some of the configured PPDEV deviced
+ * Return NULL on success
+ */
+int IO_pp_inp(int port, DWORD* res)
+{
+    int idx,j=0;
+    
+    for (idx=0;idx<PPDeviceNum ;idx++)
+      {
+       j = port - PPDeviceList[idx].userbase;
+       if (j <0) return 1;
+       switch (j)
+         {
+         case 0:
+           return IO_pp_do_access(idx,PPRDATA,res);
+         case 1:
+           return IO_pp_do_access(idx,PPRSTATUS,res);
+         case 2:
+           return IO_pp_do_access(idx,PPRCONTROL,res);
+         case 0x400:
+         case 0x402:
+         case 3:
+         case 4:
+         case 0x401:
+           FIXME("Port 0x%x not accessible for reading with ppdev\n",port);
+           FIXME("If this is causing problems, try direct port access\n");
+           return 1;
+         default:
+           break;
+         }
+      }
+    return 1;
+}
+
+/* IO_pp_outp
+ *
+ * Check if we can satisfy the INP command with some of the configured PPDEV deviced
+ * Return NULL on success
+ */
+BOOL IO_pp_outp(int port, DWORD* res)
+{
+    int idx,j=0;
+    
+    for (idx=0;idx<PPDeviceNum ;idx++)
+      {
+       j = port - PPDeviceList[idx].userbase;
+       if (j <0) return 1;
+       switch (j)
+         {
+         case 0:
+           return IO_pp_do_access(idx,PPWDATA,res);
+         case 2:
+           return IO_pp_do_access(idx,PPWCONTROL,res);
+         case 1:
+         case 0x400:
+         case 0x402:
+         case 3:
+         case 4:
+         case 0x401:
+           FIXME("Port %d not accessible for writing with ppdev\n",port);
+           FIXME("If this is causing problems, try direct port access\n");
+           return 1;
+         default:
+           break;
+         }
+      }
+    return TRUE;
+}
+
+
+#else /* HAVE_PPDEV */
+
+char IO_pp_init(void)
+{
+  return 1;
+}
+
+int IO_pp_inp(int port, DWORD* res)
+{
+  return 1;
+}
+
+BOOL IO_pp_outp(int port, DWORD* res)
+{
+  return TRUE;
+}
+#endif  /* HAVE_PPDEV */
-- 
GitLab