From 4e34d4a8568db833ca544fb46d5f1e284b07b6ce Mon Sep 17 00:00:00 2001
From: sewardj <unknown>
Date: Fri, 12 Nov 1999 16:22:10 +0000
Subject: [PATCH] [project @ 1999-11-12 16:22:08 by sewardj] Add checks for
 readline library (as opposed to headers).

---
 acconfig.h      |  3 +++
 configure.in    | 12 +++++++++++-
 mk/config.mk.in |  1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/acconfig.h b/acconfig.h
index c568b0ee3dc7..691d3c527bee 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -63,6 +63,9 @@
 /* Define if you support the production (and use) of Win32 DLLs. */
 #undef HAVE_WIN32_DLL_SUPPORT
 
+/* Define if you have and want to use readline in Hugs. */
+#undef HAVE_LIBREADLINE
+
 /* Define if C Symbols have a leading underscore added by the compiler */
 #undef LEADING_UNDERSCORE
 
diff --git a/configure.in b/configure.in
index c36b9ac29777..0465ab62ca56 100644
--- a/configure.in
+++ b/configure.in
@@ -615,7 +615,17 @@ AC_CHECK_LIB(iberty, xmalloc)
 AC_CHECK_LIB(bfd,    bfd_init)
 
 dnl ** check for readline, for Hugs
-AC_CHECK_LIB(readline, readline)
+AC_CHECK_LIB(readline, readline,
+[
+AC_DEFINE(HAVE_LIBREADLINE,1)
+HaveLibReadline=YES
+],
+[
+AC_DEFINE(HAVE_LIBREADLINE,0)
+HaveLibReadline=NO
+])
+AC_SUBST(HaveLibReadline)
+
 
 dnl ################################################################
 dnl Check for libraries
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 7ce15a81540d..713b42ce4c57 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -233,6 +233,7 @@ GhcLibsWithReadline=NO
 # (no path == in standard include path)
 #
 ReadlineIncludePath=
+HaveLibReadline=@HaveLibReadline@
 
 # Strip local symbols from libraries?  This can make the libraries smaller,
 # but makes debugging somewhat more difficult.  Doesn't work with all ld's.
-- 
GitLab