diff -u openldap-2.4.31/debian/rules openldap-2.4.31/debian/rules
--- openldap-2.4.31/debian/rules
+++ openldap-2.4.31/debian/rules
@@ -53,6 +53,15 @@
 %:
 	dh $@ --with quilt,autoreconf --builddirectory=$(builddir)
 
+# Only contrib/ldapc++ uses Automake, so special care is needed to update
+# config.guess and config.sub at the top level.
+autoreconf:
+	autoreconf -f -i . contrib/ldapc++
+	cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub build/
+
+override_dh_autoreconf:
+	dh_autoreconf debian/rules -- autoreconf
+
 override_dh_auto_configure:
 	# Check if we include the RFCs, Internet-Drafts, or upstream schemas
 	# with RFC text (which are non DFSG-free).  You can set DFSG_NONFREE
reverted:
--- openldap-2.4.31/debian/autoreconf
+++ openldap-2.4.31.orig/debian/autoreconf
@@ -1,2 +0,0 @@
-.
-contrib/ldapc++
diff -u openldap-2.4.31/debian/changelog openldap-2.4.31/debian/changelog
--- openldap-2.4.31/debian/changelog
+++ openldap-2.4.31/debian/changelog
@@ -1,3 +1,10 @@
+openldap (2.4.31-1+nmu2+cfg) unreleased; urgency=low
+
+  * Non-maintainer upload.
+  * Ensure autoreconf fixes all the config.{guess,sub} (closes: #725824)
+
+ -- Wookey <wookey@debian.org>  Wed, 13 Nov 2013 01:34:16 +0000
+
 openldap (2.4.31-1+nmu2) unstable; urgency=high
 
   * Non-maintainer upload.
