DOpt(..),
DynFlag(..),
ExtensionFlag(..),
+ glasgowExtsFlags,
flattenExtensionFlags,
ensureFlattenedExtensionFlags,
lopt_set_flattened,
-- * Compiler configuration suitable for display to the user
Printable(..),
- compilerInfo, rtsIsProfiled
+ compilerInfo
+#ifdef GHCI
+-- Only in stage 2 can we be sure that the RTS
+-- exposes the appropriate runtime boolean
+ , rtsIsProfiled
+#endif
) where
#include "HsVersions.h"
data DynLibLoader
= Deployable
- | Wrapped (Maybe String)
| SystemDependent
deriving Eq
case splitAt 8 f of
("deploy", "") -> d{ dynLibLoader = Deployable }
("sysdep", "") -> d{ dynLibLoader = SystemDependent }
- ("wrapped", "") -> d{ dynLibLoader = Wrapped Nothing }
- ("wrapped:", "hard") -> d{ dynLibLoader = Wrapped Nothing }
- ("wrapped:", flex) -> d{ dynLibLoader = Wrapped (Just flex) }
_ -> ghcError (CmdLineError ("Unknown dynlib loader: " ++ f))
setDumpPrefixForce f d = d { dumpPrefixForce = f}
, Opt_GeneralizedNewtypeDeriving
, Opt_TypeFamilies ]
+#ifdef GHCI
-- Consult the RTS to find whether GHC itself has been built profiled
-- If so, you can't use Template Haskell
foreign import ccall unsafe "rts_isProfiled" rtsIsProfiledIO :: IO CInt
rtsIsProfiled :: Bool
-rtsIsProfiled = False -- unsafePerformIO rtsIsProfiledIO /= 0
+rtsIsProfiled = unsafePerformIO rtsIsProfiledIO /= 0
checkTemplateHaskellOk :: Bool -> DynP ()
checkTemplateHaskellOk turn_on
= addErr "You can't use Template Haskell with a profiled compiler"
| otherwise
= return ()
+#else
+-- In stage 1 we don't know that the RTS has rts_isProfiled,
+-- so we simply say "ok". It doesn't matter because TH isn't
+-- available in stage 1 anyway.
+checkTemplateHaskellOk turn_on = return ()
+#endif
{- **********************************************************************
%* *