--- gnupg-2.1.6/m4/ldap.m4.orig	2015-07-31 12:17:00.169622000 +0300
+++ gnupg-2.1.6/m4/ldap.m4	2015-07-31 12:17:29.495689100 +0300
@@ -34,7 +34,7 @@
   _ldap_save_ldflags=$LDFLAGS
   LDFLAGS="${LDAP_LDFLAGS} ${LDFLAGS}"
 
-  for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv" "-lwldap32"; do
+  for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lwldap32" "-lldap" "-lldap -llber" "-lldap -llber -lresolv"; do
     _ldap_save_libs=$LIBS
     LIBS="$MY_LDAPLIBS $1 $LIBS"
 
