{- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 2001-2003 -- -- Access to system tools: gcc, cp, rm etc -- ----------------------------------------------------------------------------- -} {-# LANGUAGE CPP, MultiWayIf, ScopedTypeVariables #-} module SysTools ( -- Initialisation initSysTools, initLlvmTargets, -- Interface to system tools module SysTools.Tasks, module SysTools.Info, linkDynLib, copy, copyWithHeader, Option(..), -- platform-specifics libmLinkOpts, -- frameworks getPkgFrameworkOpts, getFrameworkOpts ) where #include "HsVersions.h" import GhcPrelude import Module import Packages import Config import Outputable import ErrUtils import Panic import Platform import Util import DynFlags import System.FilePath import System.IO import System.Directory import SysTools.ExtraObj import SysTools.Info import SysTools.Tasks import Data.List #if defined(mingw32_HOST_OS) #if MIN_VERSION_Win32(2,5,0) import qualified System.Win32.Types as Win32 #else import qualified System.Win32.Info as Win32 #endif import Data.Char import Exception import Foreign import Foreign.C.String import System.Win32.Types (DWORD, LPTSTR, HANDLE) import System.Win32.Types (failIfNull, failIf, iNVALID_HANDLE_VALUE) import System.Win32.File (createFile,closeHandle, gENERIC_READ, fILE_SHARE_READ, oPEN_EXISTING, fILE_ATTRIBUTE_NORMAL, fILE_FLAG_BACKUP_SEMANTICS ) import System.Win32.DLL (loadLibrary, getProcAddress) #endif #if defined(mingw32_HOST_OS) # if defined(i386_HOST_ARCH) # define WINDOWS_CCONV stdcall # elif defined(x86_64_HOST_ARCH) # define WINDOWS_CCONV ccall # else # error Unknown mingw32 arch # endif #endif {- How GHC finds its files ~~~~~~~~~~~~~~~~~~~~~~~ [Note topdir] GHC needs various support files (library packages, RTS etc), plus various auxiliary programs (cp, gcc, etc). It starts by finding topdir, the root of GHC's support files On Unix: - ghc always has a shell wrapper that passes a -B