diff options
| author | Misty De Meo | 2013-08-27 18:23:34 -0700 |
|---|---|---|
| committer | Misty De Meo | 2013-08-27 18:24:08 -0700 |
| commit | dca89db55189a34f1c02d3f12a84eda8d81fd6d1 (patch) | |
| tree | 1c9c367b024b7972d3acd950167a4d0d6660e097 /Library | |
| parent | e277fa434b639a1fd5bdce3a7a3f6db3fa496683 (diff) | |
| download | homebrew-dca89db55189a34f1c02d3f12a84eda8d81fd6d1.tar.bz2 | |
superenv: fix cpp shim
This sets cpp to use the compiler as cpp, and works with scripts which
pass values to cpp on stdin as well as with file arguments.
Closes #22155.
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/ENV/4.3/cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index fd22bb373..4a626c77a 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -6,6 +6,7 @@ #TODO create mechanism to specify build effects like %w{-O0 -O4 vanilla-arg-parsing sdk=10.6} etc. require "#{File.dirname __FILE__}/../libsuperenv" +require 'io/wait' require 'set' def cccfg? flags @@ -55,8 +56,7 @@ class Cmd def tool @tool ||= case @arg0 when 'ld' then 'ld' - when 'cpp' then 'cpp' - when 'cc', 'c99', 'c89' + when 'cc', 'cpp', 'c99', 'c89' # Ideally we would run `cx9`, however these tools are POSIX compliant # and don't support many flags. We need -isystem for instance, but also # reliability is generally much higher if we just get clang/gcc to do @@ -90,7 +90,8 @@ class Cmd end if nclt? case mode when :cpp - %w{-E} + args + cppflags + args = %w{-E} + args + cppflags + STDIN.ready? ? args + %w{-} : args when :ld ldflags + args when :cc |
