Fix Qt sometimes unintentionally using LLVM.

Moved setting ENV['LD'] = ENV['CXX'] to after ENV.llvm is (possibly) set. Otherwise ENV['LD'] might end up as llvm-gcc rather than the expected CXX version. Verified that this fixed the issue I had installing QT on my machine. Fixes issue Homebrew/homebrew#11202. See also Homebrew/homebrew#11198.

By the comment above where ENV.llvm is set, maybe it was supposed to be using clang rather than llvm-gcc though because my Xcode is 3.2.6. clang is "Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)", and llvm-gcc is "i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.6)".

In any case, moving these two lines made it compile and install fine on my system.

Fixes Homebrew/homebrew#11261, Homebrew/homebrew#11202, Homebrew/homebrew#11198.
This commit is contained in:
quarnster 2012-03-28 22:14:18 +03:00 committed by Mike McQuaid
parent 87c4eeab91
commit 6dff73650e

View file

@ -33,9 +33,6 @@ class Qt < Formula
end
def install
# Needed for Qt 4.8.0 due to attempting to link moc with gcc.
ENV['LD'] = ENV['CXX']
ENV.x11
ENV.append "CXXFLAGS", "-fvisibility=hidden"
args = ["-prefix", prefix,
@ -84,6 +81,9 @@ class Qt < Formula
# shipped with Xcode 4.3+
ENV.llvm if MacOS.clang_version.to_f <= 3.1
# Needed for Qt 4.8.0 due to attempting to link moc with gcc.
ENV['LD'] = ENV['CXX']
system "./configure", *args
system "make"
ENV.j1