Have pdynload handle hierarchical names

This commit is contained in:
Don Stewart 2005-06-09 01:34:43 +00:00
parent 74c9d832f9
commit 5be5242113
2 changed files with 15 additions and 4 deletions

View File

@ -223,19 +223,28 @@ unify obj incs args ty sym = do
hClose hdl1 hClose hdl1
let nm = mkModid (basename tmpf) let nm = mkModid (basename tmpf)
src = mkTest nm (mkModid obj) (fst $ break (=='.') ty) ty sym src = mkTest nm (hierize' . mkModid . hierize $ obj)
(fst $ break (=='.') ty) ty sym
is = map (\s -> "-i"++s) incs -- api is = map (\s -> "-i"++s) incs -- api
i = "-i" ++ dirname obj -- plugin i = "-i" ++ dirname obj -- plugin
hWrite hdl src hWrite hdl src
-- was need for cygwin, should be ok now:
-- e <- build tmpf "nul" (i:is++args++["-fno-code","-ohi nul"])
e <- build tmpf tmpf1 (i:is++args++["-fno-code","-ohi "++tmpf1]) e <- build tmpf tmpf1 (i:is++args++["-fno-code","-ohi "++tmpf1])
removeFile tmpf -- removeFile tmpf
removeFile tmpf1 removeFile tmpf1
return e return e
where
-- fix up hierarchical names
hierize [] = []
hierize ('/':cs) = '\\' : hierize cs
hierize (c:cs) = c : hierize cs
hierize'[] = []
hierize' ('\\':cs) = '.' : hierize' cs
hierize' (c:cs) = c : hierize' cs
mkTest modnm plugin api ty sym = mkTest modnm plugin api ty sym =
"module "++ modnm ++" where" ++ "module "++ modnm ++" where" ++
"\nimport qualified " ++ plugin ++ "\nimport qualified " ++ plugin ++

View File

@ -134,6 +134,8 @@ recompileAll' suffices m args
-> makeAll source args -> makeAll source args
else return (MakeSuccess NotReq (path m)) else return (MakeSuccess NotReq (path m))
-- touch.
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- | Standard make. Compile a single module, unconditionally. -- | Standard make. Compile a single module, unconditionally.
-- Behaves like ghc -c -- Behaves like ghc -c