diff options
author | Ian Lynagh <igloo@earth.li> | 2007-12-17 23:34:57 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2007-12-17 23:34:57 +0000 |
commit | 982bcefaed87d338adb27433d7b8c1655946a9d1 (patch) | |
tree | a46dc0be68764a5f7b1492f6d5591de0fa841539 /compiler | |
parent | b51dd448e05f28eff64906bffb5f43a4fc37407a (diff) | |
download | haskell-982bcefaed87d338adb27433d7b8c1655946a9d1.tar.gz |
Include ~/Library/Frameworks in the framework searchpath
Patch from Christian Maeder
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ghci/Linker.lhs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 03baf659e9..272d5715dc 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -1129,15 +1129,20 @@ mkSOName root = ("lib" ++ root) `joinFileExt` "so" -- name. They are searched for in different paths than normal libraries. #ifdef darwin_TARGET_OS loadFramework extraPaths rootname - = do { mb_fwk <- findFile mk_fwk (extraPaths ++ defaultFrameworkPaths) - ; case mb_fwk of - Just fwk_path -> loadDLL fwk_path - Nothing -> return (Just "not found") } - -- Tried all our known library paths, but dlopen() - -- has no built-in paths for frameworks: give up + = do { either_dir <- Control.Exception.try getHomeDirectory + ; let homeFrameworkPath = case either_dir of + Left _ -> [] + Right dir -> [dir ++ "/Library/Frameworks"] + ps = extraPaths ++ homeFrameworkPath ++ defaultFrameworkPaths + ; mb_fwk <- findFile mk_fwk ps + ; case mb_fwk of + Just fwk_path -> loadDLL fwk_path + Nothing -> return (Just "not found") } + -- Tried all our known library paths, but dlopen() + -- has no built-in paths for frameworks: give up where mk_fwk dir = dir `joinFileName` (rootname ++ ".framework/" ++ rootname) - -- sorry for the hardcoded paths, I hope they won't change anytime soon: + -- sorry for the hardcoded paths, I hope they won't change anytime soon: defaultFrameworkPaths = ["/Library/Frameworks", "/System/Library/Frameworks"] #endif \end{code} |