[project @ 2005-02-25 14:15:53 by simonpj]
[ghc-hetmet.git] / ghc / compiler / ghci / Linker.lhs
index 5b59b9d..7df178d 100644 (file)
@@ -20,7 +20,6 @@ module Linker ( HValue, showLinkerState,
                linkPackages,
        ) where
 
-#include "../includes/ghcconfig.h"
 #include "HsVersions.h"
 
 import ObjLink         ( loadDLL, loadObj, unloadObj, resolveObjs, initObjLinker )
@@ -122,9 +121,8 @@ emptyPLS dflags = PersistentLinkerState {
   -- The linker's symbol table is populated with RTS symbols using an
   -- explicit list.  See rts/Linker.c for details.
   where init_pkgs
-         | Just rts_id <- rtsPackageId (pkgState dflags) = [rts_id]
+         | ExtPackage rts_id <- rtsPackageId (pkgState dflags) = [rts_id]
          | otherwise = []
-
 \end{code}
 
 \begin{code}
@@ -386,7 +384,7 @@ getLinkDeps dflags hpt pit mods
        -- Get the things needed for the specified module
        -- This is rather similar to the code in RnNames.importsFromImportDecl
     get_deps mod
-       | ExternalPackage p <- mi_package iface
+       | ExtPackage p <- mi_package iface
        = ([], p : dep_pkgs deps)
        | otherwise
        = (mod : [m | (m,_) <- dep_mods deps], dep_pkgs deps)
@@ -762,7 +760,7 @@ linkPackage dflags pkg
    = do 
         let dirs      =  Packages.libraryDirs pkg
         let libs      =  Packages.hsLibraries pkg ++ Packages.extraLibraries pkg
-                               ++ [ lib | '-':'l':lib <- Packages.extraLdOpts pkg ]
+                               ++ [ lib | '-':'l':lib <- Packages.ldOptions pkg ]
         classifieds   <- mapM (locateOneObj dirs) libs
 
         -- Complication: all the .so's must be loaded before any of the .o's.  
@@ -806,7 +804,7 @@ loadFrameworks pkg = return ()
 loadFrameworks pkg = mapM_ load frameworks
   where
     fw_dirs    = Packages.frameworkDirs pkg
-    frameworks = Packages.extraFrameworks pkg
+    frameworks = Packages.frameworks pkg
 
     load fw = do  r <- loadFramework fw_dirs fw
                  case r of
@@ -822,9 +820,14 @@ locateOneObj dirs lib
   = do { mb_obj_path <- findFile mk_obj_path dirs 
        ; case mb_obj_path of
            Just obj_path -> return (Object obj_path)
-           Nothing       -> return (DLL lib) }         -- We assume
+           Nothing       -> 
+                do { mb_lib_path <- findFile mk_dyn_lib_path dirs
+                   ; case mb_lib_path of
+                       Just lib_path -> return (DLL (lib ++ "_dyn"))
+                       Nothing       -> return (DLL lib) }}            -- We assume
    where
      mk_obj_path dir = dir ++ '/':lib ++ ".o"
+     mk_dyn_lib_path dir = dir ++ '/':mkSOName (lib ++ "_dyn")
 
 
 -- ----------------------------------------------------------------------------