From a17eda1fca0f0696d7ed5082287bbbd02faf7eb8 Mon Sep 17 00:00:00 2001 From: sewardj Date: Thu, 26 Apr 2001 11:08:32 +0000 Subject: [PATCH] [project @ 2001-04-26 11:08:32 by sewardj] Detect the presence or absence of readline the right way. --- ghc/compiler/ghci/InteractiveUI.hs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 6a7ffa5..e74fc87 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.62 2001/04/24 13:05:51 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.63 2001/04/26 11:08:32 sewardj Exp $ -- -- GHC Interactive User Interface -- @@ -10,14 +10,9 @@ {-# OPTIONS -#include "Linker.h" #-} module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where +#include "../includes/config.h" #include "HsVersions.h" -#if HAVE_READLINE_4_2 == 1 || HAVE_READLINE_4 == 1 -#undef NO_READLINE -#else -#define NO_READLINE -#endif - import CompManager import CmStaticInfo import ByteCodeLink @@ -34,8 +29,8 @@ import Config import Exception import Dynamic -#ifndef NO_READLINE -import Readline +#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS +import Readline #endif import IOExts @@ -127,7 +122,7 @@ interactiveUI cmstate mod cmdline_libs = do Nothing -> return (cmstate, True, []) Just m -> cmLoadModule cmstate m -#ifndef NO_READLINE +#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS Readline.initialize #endif @@ -172,7 +167,7 @@ runGHCi = do Right hdl -> fileLoop hdl False -- read commands from stdin -#ifndef NO_READLINE +#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS readlineLoop #else fileLoop stdin True @@ -206,7 +201,7 @@ stringLoop (s:ss) = do l -> do quit <- runCommand l if quit then return () else stringLoop ss -#ifndef NO_READLINE +#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS readlineLoop :: GHCi () readlineLoop = do st <- getGHCiState -- 1.7.10.4