diff --git a/programs/winetest/Makefile.PL b/programs/winetest/Makefile.PL
deleted file mode 100644
index 55578a702e4ccba98b0404a647cab3155bb39c3b..0000000000000000000000000000000000000000
--- a/programs/winetest/Makefile.PL
+++ /dev/null
@@ -1,8 +0,0 @@
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-WriteMakefile(
-    'MAKEFILE'  => 'Makefile.perl',
-    'NAME'	=> 'wine',
-    'VERSION_FROM' => 'wine.pm', # finds $VERSION
-);
diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in
index 46e5d5c44fd7d216bd29a318a9b74cc393009d1b..37f3b936570148c7b181191bc85a7e7f5a168a82 100644
--- a/programs/winetest/Makefile.in
+++ b/programs/winetest/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DSTRICT `perl -MExtUtils::Embed -e ccflags`
 EXTRALIBS = `perl -MExtUtils::Embed -e ldopts`
 EXTRAINCL = `perl -MExtUtils::Embed -e perl_inc`
+XSUBPPDIR = `perl -MConfig -e 'print $$Config::Config{privlibexp}'`/ExtUtils
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
@@ -11,15 +12,11 @@ C_SRCS = winetest.c
 
 EXTRA_OBJS = wine.o
 
-PERLMAKE = $(MAKE) -fMakefile.perl INC="$(DIVINCL)"
 
 @MAKE_PROG_RULES@
 
-wine.o: wine.xs Makefile.perl
-	$(PERLMAKE) wine.o
-
-Makefile.perl: Makefile.PL
-	perl Makefile.PL
+wine.c: wine.xs
+	perl $(XSUBPPDIR)/xsubpp -typemap $(XSUBPPDIR)/typemap $(SRCDIR)/wine.xs >wine.c || $(RM) wine.c
 
 install::
 	[ -d $(libdir) ] || $(MKDIR) $(libdir)
@@ -28,7 +25,7 @@ install::
 uninstall::
 	cd $(libdir) && $(RM) wine.pm
 
-clean:: Makefile.perl
-	$(PERLMAKE) realclean
+clean::
+	$(RM) wine.c
 
 ### Dependencies:
diff --git a/programs/winetest/wine.xs b/programs/winetest/wine.xs
index fcb2345ed7183f4425bb06e35ba91132272452d3..3b271264de96f08591bf5f29b6f85e73d6eba1da 100644
--- a/programs/winetest/wine.xs
+++ b/programs/winetest/wine.xs
@@ -15,6 +15,9 @@
 #include <perl.h>
 #include <XSUB.h>
 
+#undef WORD
+#include "winbase.h"
+
 /* API return type constants */
 enum ret_type
 {