Patch 659834 by Magnus Lie Hetland:

Check for readline 2.2 features.  This should make it possible to
compile readline.c again with GNU readline versions 2.0 or 2.1; this
ability was removed in readline.c rev. 2.49.  Apparently the older
versions are still in widespread deployment on older Solaris
installations.  With an older readline, completion behavior is subtly
different (a space is always added).
diff --git a/pyconfig.h.in b/pyconfig.h.in
index dd52efb..922147e 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -333,6 +333,9 @@
 /* Define to 1 if you have the `readlink' function. */
 #undef HAVE_READLINK
 
+/* Define if you have readline 2.2 */
+#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
+
 /* Define if you have readline 4.2 */
 #undef HAVE_RL_COMPLETION_MATCHES