summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7494dfb)
Detect the presence or absence of readline the right way.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- $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
--
--
-- GHC Interactive User Interface
--
{-# OPTIONS -#include "Linker.h" #-}
module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where
{-# OPTIONS -#include "Linker.h" #-}
module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where
+#include "../includes/config.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
import CompManager
import CmStaticInfo
import ByteCodeLink
import Exception
import Dynamic
import Exception
import Dynamic
-#ifndef NO_READLINE
-import Readline
+#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS
+import Readline
Nothing -> return (cmstate, True, [])
Just m -> cmLoadModule cmstate m
Nothing -> return (cmstate, True, [])
Just m -> cmLoadModule cmstate m
+#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS
Readline.initialize
#endif
Readline.initialize
#endif
Right hdl -> fileLoop hdl False
-- read commands from stdin
Right hdl -> fileLoop hdl False
-- read commands from stdin
+#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS
readlineLoop
#else
fileLoop stdin True
readlineLoop
#else
fileLoop stdin True
l -> do quit <- runCommand l
if quit then return () else stringLoop ss
l -> do quit <- runCommand l
if quit then return () else stringLoop ss
+#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS
readlineLoop :: GHCi ()
readlineLoop = do
st <- getGHCiState
readlineLoop :: GHCi ()
readlineLoop = do
st <- getGHCiState