projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Get building GHC itself with Cabal more-or-less working
[ghc-hetmet.git]
/
compiler
/
utils
/
Util.lhs
diff --git
a/compiler/utils/Util.lhs
b/compiler/utils/Util.lhs
index
217a450
..
7057d32
100644
(file)
--- a/
compiler/utils/Util.lhs
+++ b/
compiler/utils/Util.lhs
@@
-6,7
+6,8
@@
\begin{code}
module Util (
\begin{code}
module Util (
- debugIsOn, isWindowsHost,
+ ghciSupported, debugIsOn, ghciTablesNextToCode, picIsOn,
+ isWindowsHost, isWindowsTarget, isDarwinTarget,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
@@
-93,7
+94,7
@@
import FastTypes
#endif
import Control.Monad ( unless )
#endif
import Control.Monad ( unless )
-import SYSTEM_IO_ERROR as IO ( catch, isDoesNotExistError )
+import System.IO.Error as IO ( catch, isDoesNotExistError )
import System.Directory ( doesDirectoryExist, createDirectory,
getModificationTime )
import System.FilePath hiding ( searchPathSeparator )
import System.Directory ( doesDirectoryExist, createDirectory,
getModificationTime )
import System.FilePath hiding ( searchPathSeparator )
@@
-106,11
+107,18
@@
infixr 9 `thenCmp`
%************************************************************************
%* *
%************************************************************************
%* *
-\subsection{Is DEBUG on, are we on Windows?}
+\subsection{Is DEBUG on, are we on Windows, etc?}
%* *
%************************************************************************
\begin{code}
%* *
%************************************************************************
\begin{code}
+ghciSupported :: Bool
+#ifdef GHCI
+ghciSupported = True
+#else
+ghciSupported = False
+#endif
+
debugIsOn :: Bool
#ifdef DEBUG
debugIsOn = True
debugIsOn :: Bool
#ifdef DEBUG
debugIsOn = True
@@
-118,12
+126,40
@@
debugIsOn = True
debugIsOn = False
#endif
debugIsOn = False
#endif
+ghciTablesNextToCode :: Bool
+#ifdef GHCI_TABLES_NEXT_TO_CODE
+ghciTablesNextToCode = True
+#else
+ghciTablesNextToCode = False
+#endif
+
+picIsOn :: Bool
+#ifdef __PIC__
+picIsOn = True
+#else
+picIsOn = False
+#endif
+
isWindowsHost :: Bool
#ifdef mingw32_HOST_OS
isWindowsHost = True
#else
isWindowsHost = False
#endif
isWindowsHost :: Bool
#ifdef mingw32_HOST_OS
isWindowsHost = True
#else
isWindowsHost = False
#endif
+
+isWindowsTarget :: Bool
+#ifdef mingw32_TARGET_OS
+isWindowsTarget = True
+#else
+isWindowsTarget = False
+#endif
+
+isDarwinTarget :: Bool
+#ifdef darwin_TARGET_OS
+isDarwinTarget = True
+#else
+isDarwinTarget = False
+#endif
\end{code}
%************************************************************************
\end{code}
%************************************************************************
@@
-376,16
+412,6
@@
isn'tIn msg x ys
# endif /* DEBUG */
\end{code}
# endif /* DEBUG */
\end{code}
-foldl1' was added in GHC 6.4
-
-\begin{code}
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 604
-foldl1' :: (a -> a -> a) -> [a] -> a
-foldl1' f (x:xs) = foldl' f x xs
-foldl1' _ [] = panic "foldl1'"
-#endif
-\end{code}
-
%************************************************************************
%* *
\subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten}
%************************************************************************
%* *
\subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten}