diff --git a/src/maketools/plumedcheck b/src/maketools/plumedcheck
index 0fcec6571a062eb4fc36a0355e74a4f7688d02a6..864804daef3932f1e74539d5c9091eaedc7503e3 100755
--- a/src/maketools/plumedcheck
+++ b/src/maketools/plumedcheck
@@ -67,6 +67,7 @@ BEGIN{
   pre=""
   opt_global_check=0
   astyle="astyle"
+  autoconf="autoconf"
   for(i=1;i<ARGC;i++){
     opt=pre ARGV[i]
     pre=""
@@ -84,6 +85,9 @@ BEGIN{
         astyle_options=opt;
         break;
         break;
+      case /--autoconf=.*/:
+        sub("^--autoconf=","",opt);
+        autoconf=opt;
       case /-.*/:
         print "Unknown option " opt; exit(1)
       default:
@@ -209,6 +213,23 @@ BEGINFILE{
     system("rm " tempfile)
   }
 
+# check if configure.ac is consistent with configure
+  if(filetype=="autoconf"){
+    tempfile = tmpdir "/configure"
+    configurefile = FILENAME
+    sub("\\.ac","",configurefile)
+    system("autoconf " FILENAME " > " tempfile)
+    s=system("diff -q " configurefile " " tempfile ">/dev/null 2>/dev/null")
+# check if autoconf has been applied correctly
+# DOC: :autoconf:
+# DOC: In our git repository we distribute both `./configure` and `./configure.ac` files.
+# DOC: When you modify the latter, the former should be regenerated using `autoconf` and
+# DOC: committed to git. This error indicates that the `./configure.ac` and `./configure` files
+# DOC: in the repository are not consistent.
+    if(s!=0) error("autoconf","autoconf not satisfied")
+    system("rm " tempfile)
+  }
+
 }
 
 # line by line analysis