Skip to content

Commit

Permalink
Don't use -dylib-install-name on OS X with GHC > 7.8.
Browse files Browse the repository at this point in the history
Fixes #1660. Based on a patch by Christiaan Baaij.
  • Loading branch information
23Skidoo committed Jan 31, 2014
1 parent ae3c37e commit ee6d1cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Cabal/Distribution/Simple/GHC.hs
Expand Up @@ -119,7 +119,7 @@ import Distribution.Simple.Compiler
import Distribution.Version
( Version(..), anyVersion, orLaterVersion )
import Distribution.System
( OS(..), buildOS )
( Platform(..), OS(..), buildOS, platformFromTriple )
import Distribution.Verbosity
import Distribution.Text
( display, simpleParse )
Expand All @@ -140,7 +140,6 @@ import System.FilePath ( (</>), (<.>), takeExtension,
import System.IO (hClose, hPutStrLn)
import System.Environment (getEnv)
import Distribution.Compat.Exception (catchExit, catchIO)
import Distribution.System (Platform, platformFromTriple)


-- -----------------------------------------------------------------------------
Expand Down Expand Up @@ -688,6 +687,7 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
ifReplLib = when forRepl
comp = compiler lbi
ghcVersion = compilerVersion comp
(Platform _hostArch hostOS) = hostPlatform lbi

(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
let runGhcProg = runGHC verbosity ghcProg
Expand Down Expand Up @@ -868,8 +868,10 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
ghcOptInputFiles = dynamicObjectFiles,
ghcOptOutputFile = toFlag sharedLibFilePath,
-- For dynamic libs, Mac OS/X needs to know the install location
-- at build time.
ghcOptDylibName = if buildOS == OSX
-- at build time. This only applies to GHC < 7.8 - see the
-- discussion in #1660.
ghcOptDylibName = if (hostOS == OSX
&& ghcVersion < Version [7,8] [])
then toFlag sharedLibInstallPath
else mempty,
ghcOptPackageName = toFlag pkgid,
Expand Down

0 comments on commit ee6d1cf

Please sign in to comment.