--- Makefile.in	2002-10-08 18:09:12.000000000 +0200
+++ Makefile.in.mingw	2003-01-31 13:53:04.000000000 +0100
@@ -131,12 +131,9 @@
 		$(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
 		$(INSTALL_ROOT)$(infodir)
 	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
-		$(INSTALL_ROOT)$(includedir)/gdbm.h
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
-		$(INSTALL_ROOT)$(man3dir)/gdbm.3
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
-		$(INSTALL_ROOT)$(infodir)/gdbm.info
+	$(INSTALL_DATA) gdbm.h $(includedir)/gdbm.h
+	$(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3
+	$(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info
 
 install-compat:
 	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
--- systems.h	2002-10-07 20:44:31.000000000 +0200
+++ systems.h.mingw	2003-01-31 13:53:17.000000000 +0100
@@ -146,3 +146,27 @@
 #ifndef STDERR_FILENO
 #define STDERR_FILENO 2
 #endif
+
+	//	Added by "Dave Roth" rothd@roth.net 970829
+	//	Modifications made by "Sergei Romanenko" <roman@spp.Keldysh.ru> 980602
+
+#ifdef	WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <io.h>
+int	lock_val;
+#undef	UNLOCK_FILE
+#define	UNLOCK_FILE(dbf) lock_val = !UnlockFile((HANDLE) _get_osfhandle((int) dbf->desc ), 0, 0, 0xffffffff, 0xffffffff);
+#undef	WRITELOCK_FILE
+#define	WRITELOCK_FILE(dbf)	 lock_val = !LockFile((HANDLE) _get_osfhandle((int) dbf->desc ), 0, 0, 0xffffffff, 0xffffffff);
+#undef	READLOCK_FILE
+#define	READLOCK_FILE(dbf)	lock_val = !LockFile((HANDLE) _get_osfhandle((int) dbf->desc ), 0, 0, 0xffffffff, 0xffffffff);
+
+#undef	fsync
+#define fsync(dbf)  _commit(dbf)
+
+	//	Redefine open() so files are opened in binary mode
+#define	open(x, y, z)	open(x, y | O_BINARY, z)
+#define link(x, y) 0
+
+#endif	//	WIN32
