fix-topdir-and-windll-loading-2
This commit is contained in:
parent
ab72dff6c4
commit
908385396b
@ -309,7 +309,8 @@ lookupPkg' p = withPkgEnvs env $ \fms -> go fms p
|
|||||||
hslibs = hsLibraries package
|
hslibs = hsLibraries package
|
||||||
extras = extraLibraries package
|
extras = extraLibraries package
|
||||||
deppkgs = packageDeps package
|
deppkgs = packageDeps package
|
||||||
libs <- mapM (findHSlib libdirs) (hslibs ++ extras)
|
libs <- mapM (findHSlib $ fix_topdir libdirs) (hslibs ++ extras)
|
||||||
|
libs' <- mapM (findDLL $ "C:/WINDOWS/SYSTEM") extras
|
||||||
|
|
||||||
-- don't care if there are 'Nothings', that usually
|
-- don't care if there are 'Nothings', that usually
|
||||||
-- means that they refer to system libraries. Can't do
|
-- means that they refer to system libraries. Can't do
|
||||||
|
@ -476,7 +476,8 @@ unloadObj (Module { path = p, kind = k, key = ky }) = case k of
|
|||||||
--
|
--
|
||||||
loadShared :: FilePath -> IO Module
|
loadShared :: FilePath -> IO Module
|
||||||
loadShared str = do
|
loadShared str = do
|
||||||
maybe_errmsg <- withCString str $ \dll -> c_addDLL dll
|
str' <- return $ (reverse . drop 1 . dropWhile (/= '.') . reverse) str
|
||||||
|
maybe_errmsg <- withCString str' $ \dll -> c_addDLL dll
|
||||||
if maybe_errmsg == nullPtr
|
if maybe_errmsg == nullPtr
|
||||||
then return (Module str (mkModid str) Shared emptyIface (Package (mkModid str)))
|
then return (Module str (mkModid str) Shared emptyIface (Package (mkModid str)))
|
||||||
else do e <- peekCString maybe_errmsg
|
else do e <- peekCString maybe_errmsg
|
||||||
@ -496,7 +497,7 @@ loadPackage p = do
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
putStr (' ':p) >> hFlush stdout
|
putStr (' ':p) >> hFlush stdout
|
||||||
#endif
|
#endif
|
||||||
libs <- lookupPkg p
|
(libs,dlls) <- lookupPkg p
|
||||||
mapM_ (\l -> loadObject l (Package (mkModid l))) libs
|
mapM_ (\l -> loadObject l (Package (mkModid l))) libs
|
||||||
mapM_ loadShared dlls
|
mapM_ loadShared dlls
|
||||||
--
|
--
|
||||||
|
Loading…
x
Reference in New Issue
Block a user