Fixes Homebrew/homebrew#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.
This commit is contained in:
parent
4d940628cc
commit
d11165cd97
@ -37,7 +37,7 @@ require 'hardware'
|
|||||||
MACOS_VERSION=$1.to_f
|
MACOS_VERSION=$1.to_f
|
||||||
ENV['MACOSX_DEPLOYMENT_TARGET']=$1
|
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']=""
|
ENV['LDFLAGS']=""
|
||||||
|
|
||||||
cflags=%w[-O3]
|
cflags=%w[-O3]
|
||||||
@ -63,9 +63,12 @@ else
|
|||||||
cflags<<"-march=prescott"
|
cflags<<"-march=prescott"
|
||||||
end
|
end
|
||||||
cflags<<"-mfpmath=sse"
|
cflags<<"-mfpmath=sse"
|
||||||
# gcc 4.0 is the default on Leopard
|
|
||||||
ENV['CC']="gcc-4.2"
|
# use gcc 4.2 if available (Xcode 3.1 and above)
|
||||||
ENV['CXX']="g++-4.2"
|
if system "which -s gcc-4.2" and $?.success?
|
||||||
|
ENV['CC']="gcc-4.2"
|
||||||
|
ENV['CXX']="g++-4.2"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
cflags<<"-mmmx"
|
cflags<<"-mmmx"
|
||||||
|
7
bin/brew
7
bin/brew
@ -75,14 +75,19 @@ begin
|
|||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require 'brewkit'
|
||||||
|
|
||||||
if ARGV.verbose?
|
if ARGV.verbose?
|
||||||
require 'brewkit'
|
|
||||||
ohai "Build Environment"
|
ohai "Build Environment"
|
||||||
%w[CFLAGS LDFLAGS CPPFLAGS MAKEFLAGS CC CXX].each do |f|
|
%w[CFLAGS LDFLAGS CPPFLAGS MAKEFLAGS CC CXX].each do |f|
|
||||||
puts "#{f}: #{ENV[f]}" unless ENV[f].to_s.empty?
|
puts "#{f}: #{ENV[f]}" unless ENV[f].to_s.empty?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless system "which #{ENV['CC'] or 'cc'} &> /dev/null" and $?.success?
|
||||||
|
raise "We cannot find a c compiler, have you installed the latest Xcode?"
|
||||||
|
end
|
||||||
|
|
||||||
# we need to ensure a pristine ENV for each process or the formula
|
# we need to ensure a pristine ENV for each process or the formula
|
||||||
# will start with the ENV from the previous build
|
# will start with the ENV from the previous build
|
||||||
ARGV.formulae.each do |f|
|
ARGV.formulae.each do |f|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user