Commit af3da760 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Simplify OSX ranlib madness

parent 73faaba4
...@@ -859,16 +859,14 @@ installLib flags lbi targetDir dynlibTargetDir builtDir ...@@ -859,16 +859,14 @@ installLib flags lbi targetDir dynlibTargetDir builtDir
installLib _ _ _ _ _ PackageDescription{library=Nothing} installLib _ _ _ _ _ PackageDescription{library=Nothing}
= die $ "Internal Error. installLibGHC called with no library." = die $ "Internal Error. installLibGHC called with no library."
-- | use @ranlib@ or @ar -s@ to build an index. This is necessary on systems -- | On MacOS X we have to call @ranlib@ to regenerate the archive index after
-- like MacOS X. If we can't find those, don't worry too much about it. -- copying. This is because the silly MacOS X linker checks that the archive
-- index is not older than the file itself, which means simply
-- copying/installing the file breaks it!!
-- --
updateLibArchive :: Verbosity -> LocalBuildInfo -> FilePath -> IO () updateLibArchive :: Verbosity -> LocalBuildInfo -> FilePath -> IO ()
updateLibArchive verbosity lbi path = updateLibArchive verbosity lbi path
case lookupProgram ranlibProgram (withPrograms lbi) of | buildOS == OSX = do
Just ranlib -> rawSystemProgram verbosity ranlib [path] (ranlib, _) <- requireProgram verbosity ranlibProgram (withPrograms lbi)
Nothing -> case lookupProgram arProgram (withPrograms lbi) of rawSystemProgram verbosity ranlib [path]
Just ar -> rawSystemProgram verbosity ar ["-s", path] | otherwise = return ()
Nothing -> warn verbosity $
"Unable to generate a symbol index for the static "
++ "library '" ++ path
++ "' (missing the 'ranlib' and 'ar' programs)"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment