From a79bd39e6940857bb76d7414177b0ff56a653185 Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Tue, 28 Oct 2014 19:43:27 -0400 Subject: ghc: search $HOMEBREW_PREFIX/lib Adds compiler options to GHC's settings file to add $HOMEBREW_PREFIX/lib to the library search path when linking Haskell programs. --- Library/Formula/ghc.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb index cc3de3e38..6dabfda0e 100644 --- a/Library/Formula/ghc.rb +++ b/Library/Formula/ghc.rb @@ -106,6 +106,15 @@ class Ghc < Formula arch = "x86_64" end + # These will find their way into ghc's settings file, ensuring + # that ghc will look in the Homebrew lib dir for native libs + # (e.g., libgmp) even if the prefix is not /usr/local. Both are + # necessary to avoid problems on systems with custom prefixes: + # ghci fails without the first, compiling packages that depend + # on native libs fails without the second. + ENV["CONF_CC_OPTS_STAGE2"] = "-B#{HOMEBREW_PREFIX}/lib" + ENV["CONF_GCC_LINKER_OPTS_STAGE2"] = "-L#{HOMEBREW_PREFIX}/lib" + # ensure configure does not use Xcode 5 "gcc" which is actually clang system "./configure", "--prefix=#{prefix}", "--build=#{arch}-apple-darwin", -- cgit v1.2.3