diff --git a/Cabal/Distribution/Simple/GHC/Internal.hs b/Cabal/Distribution/Simple/GHC/Internal.hs index b53da0e6296735b730bc9769733beb8341215ca2..0dc5caa886e19abe1dbe2c21b9029082bbae4bab 100644 --- a/Cabal/Distribution/Simple/GHC/Internal.hs +++ b/Cabal/Distribution/Simple/GHC/Internal.hs @@ -346,7 +346,9 @@ componentCcGhcOptions verbosity implInfo lbi bi clbi pref filename = ghcOptInputFiles = toNubListR [filename], ghcOptCppIncludePath = toNubListR $ [autogenModulesDir lbi, odir] - ++ PD.includeDirs bi, + ++ PD.includeDirs bi + ++ ["/System/Library/Frameworks/"++fw++"/Headers" + | isOSX, fw <- PD.frameworks bi ], ghcOptPackageDBs = withPackageDB lbi, ghcOptPackages = toNubListR $ mkGhcOptPackages clbi, ghcOptCcOptions = toNubListR $ @@ -362,6 +364,7 @@ componentCcGhcOptions verbosity implInfo lbi bi clbi pref filename = ghcOptObjDir = toFlag odir } where + isOSX = case buildOS of OSX -> True; _ -> False odir | hasCcOdirBug implInfo = pref </> takeDirectory filename | otherwise = pref -- ghc 6.4.0 had a bug in -odir handling for C compilations. @@ -385,7 +388,9 @@ componentGhcOptions verbosity lbi bi clbi odir = ghcOptSourcePath = toNubListR $ [odir] ++ (hsSourceDirs bi) ++ [autogenModulesDir lbi], ghcOptCppIncludePath = toNubListR $ [autogenModulesDir lbi, odir] - ++ PD.includeDirs bi, + ++ PD.includeDirs bi + ++ ["/System/Library/Frameworks/"++fw++"/Headers" + | isOSX, fw <- PD.frameworks bi ], ghcOptCppOptions = toNubListR $ cppOptions bi, ghcOptCppIncludes = toNubListR $ [autogenModulesDir lbi </> cppHeaderName], @@ -403,6 +408,8 @@ componentGhcOptions verbosity lbi bi clbi odir = ghcOptExtensionMap = M.fromList . compilerExtensions $ (compiler lbi) } where + isOSX = case buildOS of OSX -> True; _ -> False + toGhcOptimisation NoOptimisation = mempty --TODO perhaps override? toGhcOptimisation NormalOptimisation = toFlag GhcNormalOptimisation toGhcOptimisation MaximumOptimisation = toFlag GhcMaximumOptimisation diff --git a/Cabal/Distribution/Simple/PreProcess.hs b/Cabal/Distribution/Simple/PreProcess.hs index eadb148ff0109deeecdbad15786899daed88364f..81fa5e9e5d97b4f23e8d153c716d269d04e7f446 100644 --- a/Cabal/Distribution/Simple/PreProcess.hs +++ b/Cabal/Distribution/Simple/PreProcess.hs @@ -410,6 +410,9 @@ ppHsc2hs bi lbi = | isOSX , opt <- nub (concatMap Installed.frameworkDirs pkgs) , what <- ["--cflag", "--lflag"] ] + ++ [ "--cflag=-I/System/Library/Frameworks/" ++ opt ++ "/Headers" + | isOSX + , opt <- nub (concatMap Installed.frameworks pkgs) ] ++ [ "--lflag=" ++ arg | isOSX , opt <- PD.frameworks bi ++ concatMap Installed.frameworks pkgs diff --git a/Cabal/changelog b/Cabal/changelog index a5f18920ef345269bb89fe36bbca5f3588cf5ec4..7c846d20dab40611e1c874ce10488c38cd95b746 100644 --- a/Cabal/changelog +++ b/Cabal/changelog @@ -10,6 +10,7 @@ respetively (GHC's '-fprof-auto-{exported,top}' flags) (#193). * New 'custom-setup' stanza to specify setup deps. Setup is also built with the cabal_macros.h style macros, for conditional compilation. + * Include Mac OS X framework headers in include path 1.22.0.0 Johan Tibell <johan.tibell@gmail.com> January 2015 * Support GHC 7.10.