%
-% (c) The University of Glasgow 2000
+% (c) The University of Glasgow 2005
%
-- --------------------------------------
import Packages
import DriverPhases ( isObjectFilename, isDynLibFilename )
import Util ( getFileSuffix )
-import Finder ( findModule, findLinkable, FindResult(..) )
+import Finder ( findModule, findObjectLinkableMaybe, FindResult(..) )
import HscTypes
import Name ( Name, nameModule, isExternalName, isWiredInName )
import NameEnv
import System.Directory ( doesFileExist )
import Control.Exception ( block, throwDyn )
+import Maybe ( isJust, fromJust )
#if __GLASGOW_HASKELL__ >= 503
import GHC.IOBase ( IO(..) )
-- (e) Link any MacOS frameworks
#ifdef darwin_TARGET_OS
- ; framework_paths <- readIORef v_Framework_paths
- ; frameworks <- readIORef v_Cmdline_frameworks
+ ; let framework_paths = frameworkPaths dflags
+ ; let frameworks = cmdlineFrameworks dflags
#else
; let frameworks = []
; let framework_paths = []
get_linkable mod_name -- A home-package module
| Just mod_info <- lookupModuleEnv hpt mod_name
- = return (hm_linkable mod_info)
+ = ASSERT(isJust (hm_linkable mod_info))
+ return (fromJust (hm_linkable mod_info))
| otherwise
= -- It's not in the HPT because we are in one shot mode,
-- so use the Finder to get a ModLocation...
found loc mod_name = do {
-- ...and then find the linkable for it
- mb_lnk <- findLinkable mod_name loc ;
+ mb_lnk <- findObjectLinkableMaybe mod_name loc ;
case mb_lnk of {
Nothing -> no_obj mod_name ;
Just lnk -> return lnk