Add framework flags when linking a dynamic library
ClosedPublic

Authored by christiaanb on Jul 31 2015, 5:00 AM.

Details

Summary

This fixes the GHC side of trac Trac #10568. So cabal install --ghc-options="-framework GLUT" GLUT creates a correctly linked GLUT.dylib. We still need to explictly pass --ghc-options="-framework GLUT" because the Cabal side Trac #10568 is not fixed.

Update: the Cabal side of Trac #10568 is fixed by Cabal#2747

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
christiaanb updated this revision to Diff 3719.Jul 31 2015, 5:00 AM
christiaanb retitled this revision from to Add framework flags when linking a dynamic library.
christiaanb updated this object.
christiaanb edited the test plan for this revision. (Show Details)
christiaanb added reviewers: austin, bgamari.
christiaanb updated the Trac tickets for this revision.
bgamari edited edge metadata.Jul 31 2015, 7:37 AM

@christiaanb, might it also make sense to handle Cabal issue 2689 (ensuring framework headers are in the include path) here as well? Or will this be taken care of for us by -framework?

rwbarton requested changes to this revision.Jul 31 2015, 10:37 AM
rwbarton added a reviewer: rwbarton.
rwbarton added a subscriber: rwbarton.

Since I gather you have an OS X machine to test on, could you simplify the implementations of getPkgFrameworkOpts and getFrameworkOpts? With a guard | platformUsesFrameworks = ..., and one do block per function rather than three.

Otherwise LGTM though.

This revision now requires changes to proceed.Jul 31 2015, 10:37 AM
christiaanb updated this revision to Diff 3727.Aug 1 2015, 4:35 AM
christiaanb edited edge metadata.
  • Refactor get(Pkg)FrameworkOpts

@christiaanb, might it also make sense to handle Cabal issue 2689 (ensuring framework headers are in the include path) here as well? Or will this be taken care of for us by -framework?

Cabal issue 2689 was closed without needing any change to either GHC or Cabal.

rwbarton requested changes to this revision.Aug 1 2015, 11:12 AM
rwbarton edited edge metadata.
rwbarton added inline comments.
compiler/main/SysTools.hs
1667

This should just be [] not return [] (which is [""])... though the SysTools.run* commands filter out empty arguments, which is why the build didn't break on Harbormaster I guess.

This revision now requires changes to proceed.Aug 1 2015, 11:12 AM
christiaanb updated this revision to Diff 3729.Aug 1 2015, 2:03 PM
christiaanb edited edge metadata.
  • Remove copy-paste error
christiaanb updated this object.Aug 1 2015, 2:14 PM
christiaanb edited edge metadata.
bgamari accepted this revision.Aug 4 2015, 5:29 PM
bgamari edited edge metadata.

@rwbarton, thanks for the careful review.

This looks good to me.. Thanks again!

This revision was automatically updated to reflect the committed changes.