diff --git a/configure.in b/configure.in
index 3569b8ee35136e267aeaeaba7fdc1f919479bc7a..c36b9ac29777bf9c805103723fdb273c6f8742cb 100644
--- a/configure.in
+++ b/configure.in
@@ -614,6 +614,9 @@ dnl    the order of these tests matters: bfd needs liberty
 AC_CHECK_LIB(iberty, xmalloc)
 AC_CHECK_LIB(bfd,    bfd_init)
 
+dnl ** check for readline, for Hugs
+AC_CHECK_LIB(readline, readline)
+
 dnl ################################################################
 dnl Check for libraries
 dnl ################################################################
diff --git a/mk/config.h.in b/mk/config.h.in
index 21d1533a3fdbf69d6f19fc7d8f2d7ff823cf85b5..11e7082e523c73b5680c624de3d2d02e861e6c57 100644
--- a/mk/config.h.in
+++ b/mk/config.h.in
@@ -457,3 +457,6 @@
 
 /* Define if you have the iberty library (-liberty).  */
 #undef HAVE_LIBIBERTY
+
+/* Define if you have the readline library (-lreadline).  */
+#undef HAVE_LIBREADLINE