Have pdynload handle hierarchical names
This commit is contained in:
parent
74c9d832f9
commit
5be5242113
@ -223,19 +223,28 @@ unify obj incs args ty sym = do
|
||||
hClose hdl1
|
||||
|
||||
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
|
||||
i = "-i" ++ dirname obj -- plugin
|
||||
|
||||
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])
|
||||
removeFile tmpf
|
||||
-- removeFile tmpf
|
||||
removeFile tmpf1
|
||||
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 =
|
||||
"module "++ modnm ++" where" ++
|
||||
"\nimport qualified " ++ plugin ++
|
||||
|
@ -134,6 +134,8 @@ recompileAll' suffices m args
|
||||
-> makeAll source args
|
||||
else return (MakeSuccess NotReq (path m))
|
||||
|
||||
-- touch.
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- | Standard make. Compile a single module, unconditionally.
|
||||
-- Behaves like ghc -c
|
||||
|
Loading…
x
Reference in New Issue
Block a user