aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-09-04 15:42:19 +0100
committerMax Howell2009-09-04 15:54:27 +0100
commit2142e1823f16fa8b35dc04a280004e9adeda2c30 (patch)
treedbb57443057747a6b74567c1cb990c2d2ee3dd6b /Library
parent6685200998bf24f7028c3244b0f028be3bd30df2 (diff)
downloadhomebrew-2142e1823f16fa8b35dc04a280004e9adeda2c30.tar.bz2
Fixes #30 -- GCC can't create executables
The fix is to error out if GCC isn't installed, and to ensure we aren't setting CC and CXX to something that doesn't exist.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brewkit.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 4c9bdbc26..ce15625a0 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -37,7 +37,7 @@ require 'hardware'
MACOS_VERSION=$1.to_f
ENV['MACOSX_DEPLOYMENT_TARGET']=$1
-# to be consistent with cflags, we ignore the existing environment
+# ignore existing build vars, thus we should have less bugs to deal with
ENV['LDFLAGS']=""
cflags=%w[-O3]
@@ -63,9 +63,12 @@ else
cflags<<"-march=prescott"
end
cflags<<"-mfpmath=sse"
- # gcc 4.0 is the default on Leopard
- ENV['CC']="gcc-4.2"
- ENV['CXX']="g++-4.2"
+
+ # use gcc 4.2 if available (Xcode 3.1 and above)
+ if system "which -s gcc-4.2" and $?.success?
+ ENV['CC']="gcc-4.2"
+ ENV['CXX']="g++-4.2"
+ end
end
cflags<<"-mmmx"