--- libgpg-error-1.16/src/Makefile.am.orig	2014-09-23 23:35:27.832600000 +0500
+++ libgpg-error-1.16/src/Makefile.am	2014-09-24 00:08:20.985200000 +0500
@@ -301,10 +301,15 @@
 mkheader_opts =
 parts_of_gpg_error_h += ./lock-obj-pub.native.h
 
+if HAVE_W32_SYSTEM
+./lock-obj-pub.native.h: Makefile gen-w32-lock-obj$(EXEEXT) w32-lock-obj.h
+	./gen-w32-lock-obj >$@
+else
 ./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
 	./gen-posix-lock-obj >$@
 endif
 endif
+endif
 
 # We also depend on versioninfo.rc because that is build by
 # config.status and thus has up-to-date version numbers.
