Commit e440a5e2 authored by simonpj's avatar simonpj

[project @ 2003-02-21 13:26:58 by simonpj]

Import pruning, use mingw32_TARGET not HOST, use old-style foreign import (for 4.08 compat)
parent 4e94cbc4
-----------------------------------------------------------------------------
-- $Id: DriverFlags.hs,v 1.112 2003/02/07 09:39:02 simonpj Exp $
-- $Id: DriverFlags.hs,v 1.113 2003/02/21 13:26:58 simonpj Exp $
--
-- Driver flags
--
......@@ -362,7 +362,7 @@ dynamic_flags = [
-- on all other systems, quoting is necessary, to avoid interpretation
-- of shell metacharacters in the arguments (e.g. green-card's
-- -DBEGIN_GHC_ONLY='}-' trick).
#ifndef mingw32_HOST_OS
#ifndef mingw32_TARGET_OS
, ( "D", Prefix (\s -> addOpt_P ("-D'"++s++"'") ) )
, ( "U", Prefix (\s -> addOpt_P ("-U'"++s++"'") ) )
#else
......
......@@ -74,7 +74,7 @@ import MkExternalCore ( emitExternalCore )
import ParserCore
import ParserCoreUtils
import FiniteMap ( emptyFM )
import Name ( nameModule, getName )
import Name ( nameModule )
import NameEnv ( emptyNameEnv, mkNameEnv )
import NameSet ( emptyNameSet )
import Module ( Module, ModLocation(..), showModMsg )
......
......@@ -53,7 +53,7 @@ import TyCon ( DataConDetails(..), tyConTyVars, tyConDataCons, tyConTheta,
isFunTyCon, isPrimTyCon, isNewTyCon, isClassTyCon,
isSynTyCon, isAlgTyCon, isForeignTyCon,
getSynTyConDefn, tyConGenInfo, tyConDataConDetails, tyConArity )
import Class ( classExtraBigSig, classTyCon, DefMeth(..) )
import Class ( classExtraBigSig, classTyCon )
import FieldLabel ( fieldLabelType )
import TcType ( tcSplitForAllTys, tcFunResultTy, tidyTopType, deNoteType, tyClsNamesOfDFunHead )
import SrcLoc ( noSrcLoc )
......
......@@ -86,11 +86,11 @@ import Directory ( doesFileExist, removeFile )
-- GHC <= 4.08 didn't have rawSystem, and runs into problems with long command
-- lines on mingw32, so we disallow it now.
#if defined(mingw32_HOST_OS) && (__GLASGOW_HASKELL__ <= 408)
#if defined(mingw32_TARGET_OS) && (__GLASGOW_HASKELL__ <= 408)
#error GHC <= 4.08 is not supported for bootstrapping GHC on i386-unknown-mingw32
#endif
#ifndef mingw32_HOST_OS
#ifndef mingw32_TARGET_OS
#if __GLASGOW_HASKELL__ > 504
import qualified GHC.Posix
#else
......@@ -103,7 +103,7 @@ import Foreign
import CString ( CString, peekCString )
#endif
#ifdef mingw32_HOST_OS
#ifdef mingw32_TARGET_OS
#if __GLASGOW_HASKELL__ > 504
import System.Cmd ( rawSystem )
#else
......@@ -272,7 +272,7 @@ initSysTools minusB_args
| am_installed = installed_bin cGHC_MANGLER_PGM
| otherwise = inplace cGHC_MANGLER_DIR_REL cGHC_MANGLER_PGM
#ifndef mingw32_HOST_OS
#ifndef mingw32_TARGET_OS
-- check whether TMPDIR is set in the environment
; IO.try (do dir <- getEnv "TMPDIR" -- fails if not set
setTmpDir dir
......@@ -314,7 +314,7 @@ initSysTools minusB_args
throwDyn (InstallationError
("Can't find package.conf as " ++ pkgconfig_path))
#if defined(mingw32_HOST_OS)
#if defined(mingw32_TARGET_OS)
-- WINDOWS-SPECIFIC STUFF
-- On Windows, gcc and friends are distributed with GHC,
-- so when "installed" we look in TopDir/bin
......@@ -417,8 +417,8 @@ initSysTools minusB_args
; return ()
}
#if defined(mingw32_HOST_OS)
foreign import stdcall unsafe "GetTempPathA" getTempPath :: Int -> CString -> IO Int32
#if defined(mingw32_TARGET_OS)
foreign import stdcall "GetTempPathA" unsafe getTempPath :: Int -> CString -> IO Int32
#endif
\end{code}
......@@ -701,7 +701,7 @@ runSomething :: String -- For -v message
runSomething phase_name pgm args
= traceCmd phase_name cmd_line $
do {
#ifndef mingw32_HOST_OS
#ifndef mingw32_TARGET_OS
exit_code <- system cmd_line
#else
exit_code <- rawSystem cmd_line
......@@ -772,7 +772,7 @@ pgmPath :: String -- Directory string in Unix format
#if defined(mingw32_HOST_OS)
#if defined(mingw32_TARGET_OS)
--------------------- Windows version ------------------
dosifyPaths xs = map dosifyPath xs
......@@ -832,7 +832,7 @@ slash s1 s2 = s1 ++ ('/' : s2)
-----------------------------------------------------------------------------
-- Define getExecDir :: IO (Maybe String)
#if defined(mingw32_HOST_OS)
#if defined(mingw32_TARGET_OS)
getExecDir :: IO (Maybe String)
getExecDir = do let len = (2048::Int) -- plenty, PATH_MAX is 512 under Win32.
buf <- mallocArray len
......@@ -843,14 +843,14 @@ getExecDir = do let len = (2048::Int) -- plenty, PATH_MAX is 512 under Win32.
return (Just (reverse (dropList "/bin/ghc.exe" (reverse (unDosifyPath s)))))
foreign import stdcall unsafe "GetModuleFileNameA"
foreign import stdcall "GetModuleFileNameA" unsafe
getModuleFileName :: Ptr () -> CString -> Int -> IO Int32
#else
getExecDir :: IO (Maybe String) = do return Nothing
#endif
#ifdef mingw32_HOST_OS
foreign import ccall unsafe "_getpid" getProcessID :: IO Int -- relies on Int == Int32 on Windows
#ifdef mingw32_TARGET_OS
foreign import ccall "_getpid" unsafe getProcessID :: IO Int -- relies on Int == Int32 on Windows
#elif __GLASGOW_HASKELL__ > 504
getProcessID :: IO Int
getProcessID = GHC.Posix.c_getpid >>= return . fromIntegral
......@@ -860,7 +860,7 @@ getProcessID = Posix.getProcessID
#endif
quote :: String -> String
#if defined(mingw32_HOST_OS)
#if defined(mingw32_TARGET_OS)
quote "" = ""
quote s = "\"" ++ s ++ "\""
#else
......
......@@ -26,20 +26,19 @@ import Id ( idType, idInfo, idName, idCoreRules,
import IdInfo {- loads of stuff -}
import NewDemand ( isBottomingSig, topSig )
import BasicTypes ( isNeverActive )
import Name ( getOccName, nameOccName, mkInternalName, mkExternalName,
import Name ( getOccName, nameOccName, mkInternalName,
localiseName, isExternalName, nameSrcLoc
)
import RnEnv ( lookupOrigNameCache, newExternalName )
import NameEnv ( filterNameEnv )
import OccName ( TidyOccEnv, initTidyOccEnv, tidyOccName )
import Type ( tidyTopType )
import Module ( Module, moduleName )
import Module ( Module )
import HscTypes ( PersistentCompilerState( pcs_nc ),
NameCache( nsNames, nsUniqs ),
TypeEnv, extendTypeEnvList, typeEnvIds,
ModGuts(..), ModGuts, TyThing(..)
)
import FiniteMap ( lookupFM, addToFM )
import Maybes ( orElse )
import ErrUtils ( showPass, dumpIfSet_core )
import UniqFM ( mapUFM )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment