Add check for the PyArg_ParseTuple format, and declare
it if it is supported.
diff --git a/configure.in b/configure.in
index 14f2918..4ab84dd 100644
--- a/configure.in
+++ b/configure.in
@@ -890,6 +890,21 @@
   fi
 fi
 
+# Check whether GCC supports PyArg_ParseTuple format
+if test "$GCC" = "yes"
+then
+  AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
+  save_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -Werror"
+  AC_TRY_COMPILE([
+    void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
+  ],,
+  AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
+  AC_MSG_RESULT(yes),
+  AC_MSG_RESULT(no)
+  )
+fi
+
 # On some compilers, pthreads are available without further options
 # (e.g. MacOS X). On some of these systems, the compiler will not
 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).