diff options
| author | Max Howell | 2012-08-31 09:18:05 -0400 |
|---|---|---|
| committer | Max Howell | 2012-08-31 10:22:10 -0400 |
| commit | 470c44dfa8636b1600c148dd52acc442bc3e4b80 (patch) | |
| tree | d8e234629ea026c8f85ba696fd101c3e0e1f09de | |
| parent | d4674292f0764f32c544ed1db006a89b6aa8f128 (diff) | |
| download | homebrew-470c44dfa8636b1600c148dd52acc442bc3e4b80.tar.bz2 | |
Consider superenv “servile” during configure
superenv defaults to servile mode. In servile mode:
* If 'gcc' is called, then 'gcc' is run (we ignore HOMEBREW_CC)
* CFLAGS (optimizations) are not applied
* ARGV is not mangled (TODO though we should apply fixes)
* -I and -L environment is still forcibly inserted.
This fixes, eg. jack which was still broken with stdenv. Jack was broken because we set CC in stdenv, and Jack has a stupid build-system. Unsetting CC allowed Jack to find and use the gcc tool it so demanded, but (previously) we would then substitute clang under its nose. The configure still failed. In servile mode (llvm-)gcc is used and Jack compiles.
In normal circumstances clang would then be inserted again during the make phase. But Jack uses the niche-wag build tool that we don't support for setting the O HOMEBREW_CCCFG flag that disables servile mode.
| l--------- | Library/ENV/4.3/bsdmake | 1 | ||||
| -rwxr-xr-x | Library/ENV/4.3/cc | 29 |
2 files changed, 19 insertions, 11 deletions
diff --git a/Library/ENV/4.3/bsdmake b/Library/ENV/4.3/bsdmake new file mode 120000 index 000000000..ac08cdcf9 --- /dev/null +++ b/Library/ENV/4.3/bsdmake @@ -0,0 +1 @@ +make
\ No newline at end of file diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index ffd15f2e3..324f47d4a 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -15,6 +15,13 @@ require 'set' def cccfg? flags flags.split('').all?{|c| ENV['HOMEBREW_CCCFG'].include? c } if ENV['HOMEBREW_CCCFG'] end +def servile? + # we are servile when we are called from configure etc. + # * we give the callee the tools it asks for + # * we leave ARGV alone + # when callee is make we optimize and force HOMEBREW_CC + not cccfg? 'O' +end def nclt? $sdkroot != nil end @@ -29,12 +36,12 @@ end class Cmd def initialize path, args - @cmd = path.basename.freeze + @arg0 = path.basename.freeze @args = args.freeze end def mode - if @cmd == 'cpp' or @cmd == 'ld' - @cmd.to_sym + if @arg0 == 'cpp' or @arg0 == 'ld' + @arg0.to_sym elsif @args.include? '-c' :cc elsif @args.include? '-E' @@ -44,25 +51,25 @@ class Cmd end end def tool - @tool ||= if @cmd.include? '++' + @tool ||= if servile? or @arg0 == 'ld' + @arg0 + elsif @arg0.include? '++' if ENV['HOMEBREW_CC'].chuzzle =~ /gcc/ 'g++' else 'clang++' end - elsif @cmd == 'ld' - 'ld' else ENV['HOMEBREW_CC'].chuzzle or 'clang' end end def args - args = if cccfg? 'O' and tool != 'ld' - refurbished_args - else + args = if servile? or tool == 'ld' @args.dup + else + refurbished_args end - if @cmd != 'ld' + if tool != 'ld' args.unshift("--sysroot=#$sdkroot") else args.unshift($sdkroot).unshift("-syslibroot") @@ -152,7 +159,7 @@ class Cmd end ####################################################################### sanity -abort "The build-tool has reset ENV. --lame-env required." unless ENV['HOMEBREW_BREW_FILE'] +abort "The build-tool has reset ENV. --env=std required." unless ENV['HOMEBREW_BREW_FILE'] ######################################################################### main cmd = Cmd.new($0, ARGV) |
