summaryrefslogtreecommitdiff
path: root/Build/OSXMkLibs.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-09 13:17:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-09 13:17:55 -0400
commit8a92fbcc1b6da89082f54ca06b9f237c37633b9f (patch)
tree586e8e6cfe1170295f11d652850a3bafa06a52be /Build/OSXMkLibs.hs
parent63b4d134a253acd21b148ce0be41701dc62a810d (diff)
use full path name to generate library filename
avoids overlaps
Diffstat (limited to 'Build/OSXMkLibs.hs')
-rw-r--r--Build/OSXMkLibs.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs
index c03fb81be..6462cb14e 100644
--- a/Build/OSXMkLibs.hs
+++ b/Build/OSXMkLibs.hs
@@ -15,6 +15,7 @@ import System.Directory
import System.IO
import Control.Monad
import Data.List
+import Data.String.Utils
import Utility.PartialPrelude
import Utility.Directory
@@ -41,7 +42,8 @@ installLibs appbase libmap = do
(needlibs, libmap') <- otool appbase libmap
libs <- forM needlibs $ \lib -> do
let shortlib = fromMaybe (error "internal") (M.lookup lib libmap')
- let dest = appbase </> takeFileName lib
+ let fulllib = replace "/" "_" lib
+ let dest = appbase </> fulllib
let symdest = appbase </> shortlib
ifM (doesFileExist dest)
( return Nothing
@@ -50,7 +52,7 @@ installLibs appbase libmap = do
putStrLn $ "installing " ++ lib ++ " as " ++ shortlib
_ <- boolSystem "cp" [File lib, File dest]
_ <- boolSystem "chmod" [Param "644", File dest]
- _ <- boolSystem "ln" [Param "-s", File (takeFileName lib), File symdest]
+ _ <- boolSystem "ln" [Param "-s", File fulllib, File symdest]
return $ Just appbase
)
return (catMaybes libs, libmap')