Add GCC 4.0 info to --config output.

* Adds GCC 4.0 version info to --config output.
* Splits gcc_build into gcc_40_build and gcc_42_build.
* Adds alias gcc_build to gcc_42_build for compatibility.
* Updates Xcode checking to also check GCC 4.0 version.

These changes are a combination of work by AdamV and my work
on my Tiger branch. This information would be useful for all
installs since some formulae compile with GCC 4.0.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Robert Shaw 2010-03-16 13:08:32 -07:00 committed by Adam Vandenberg
parent 098b97801b
commit ca313defe4
2 changed files with 16 additions and 4 deletions

View File

@ -494,7 +494,7 @@ private
end
end
def gcc_build
def gcc_42_build
`/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/
if $1
$1.to_i
@ -508,6 +508,16 @@ def gcc_build
nil
end
end
alias :gcc_build :gcc_42_build # For compatibility
def gcc_40_build
`/usr/bin/gcc-4.0 -v 2>&1` =~ /build (\d{4,})/
if $1
$1.to_i
else
nil
end
end
def llvm_build
if MACOS_VERSION >= 10.6

View File

@ -43,7 +43,8 @@ def dump_config
bits = Hardware.bits
cores = Hardware.cores_as_words
llvm = llvm_build
gcc = gcc_build
gcc_42 = gcc_42_build
gcc_40 = gcc_40_build
sha = `cd #{HOMEBREW_REPOSITORY} && git rev-parse --verify HEAD 2> /dev/null`.chomp
kernel_arch = `uname -m`.chomp
@ -59,7 +60,8 @@ Hardware: #{cores}-core #{bits}-bit #{Hardware.intel_family}
OS X: #{MACOS_FULL_VERSION}
Kernel Architecture: #{kernel_arch}
Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}
GCC-4.2: #{gcc ? "build #{gcc}" : "N/A"} (5577 or newer recommended)
GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"} (5493 or newer recommended)
GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"} (5577 or newer recommended)
LLVM: #{llvm ? "build #{llvm}" : "N/A" } #{llvm ? "(2206 or newer recommended)" : "" }
MacPorts or Fink? #{macports_or_fink_installed?}
X11 installed? #{x11_installed?}
@ -256,7 +258,7 @@ begin
if MACOS_VERSION >= 10.6
opoo "You should upgrade to Xcode 3.2.1" if llvm_build < 2206
else
opoo "You should upgrade to Xcode 3.1.4" if gcc_build < 5577
opoo "You should upgrade to Xcode 3.1.4" if (gcc_40_build < 5493) or (gcc_42_build < 5577)
end
rescue
# the reason we don't abort is some formula don't require Xcode