aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorCaleb Land2009-09-25 17:40:40 -0400
committerMax Howell2009-09-28 00:20:50 +0100
commit17c1eaaf2e6b77738e688774aa0238d097bb1f9d (patch)
treeaad665fdeb47771717e2a761899e1fdb406f4902 /Library/Formula
parent0dcace0b62ffcf866d6ab7cef9d1ad46ab5c3584 (diff)
downloadhomebrew-17c1eaaf2e6b77738e688774aa0238d097bb1f9d.tar.bz2
Fix Spidermonkey formula
The Spidermonkey makefiles hardcoded the compilers that are used. Which broke when used with gcc 4.2 cflags.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/spidermonkey.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Formula/spidermonkey.rb b/Library/Formula/spidermonkey.rb
index 618a68cd5..af93c3d52 100644
--- a/Library/Formula/spidermonkey.rb
+++ b/Library/Formula/spidermonkey.rb
@@ -14,6 +14,13 @@ class Spidermonkey <Formula
def install
ENV.j1
+
+ # Spidermonkey hardsets the CC and CCC environment variables to cc and g++
+ # but homebrew uses compiler flags that aren't available in Apple's default cc (version 4.0.1)
+ # instead use the compilers chosen by homebrew and set in the CC and CXX environment variables
+ inreplace "src/config/Darwin.mk", 'CC = cc', "CC = #{ENV['CC']}"
+ inreplace "src/config/Darwin.mk", 'CCC = g++', "CCC = #{ENV['CXX']}"
+
Dir.chdir "src" do
system "make JS_DIST=#{HOMEBREW_PREFIX} JS_THREADSAFE=1 DEFINES=-DJS_C_STRINGS_ARE_UTF8 -f Makefile.ref"
system "make JS_DIST=#{prefix} -f Makefile.ref export"