aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorRyan Hendrickson2014-10-28 19:43:27 -0400
committerMike McQuaid2014-10-29 14:04:07 +0000
commita79bd39e6940857bb76d7414177b0ff56a653185 (patch)
tree306c9aac049432eea329acbaa34516d69e865960 /Library/Formula
parent01cf6061a12616536e88a31ab91da03fb7568fb6 (diff)
downloadhomebrew-a79bd39e6940857bb76d7414177b0ff56a653185.tar.bz2
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.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ghc.rb9
1 files changed, 9 insertions, 0 deletions
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",