diff options
| author | Jack Nagel | 2013-12-27 15:46:36 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-27 15:46:36 -0600 |
| commit | 7bc1538acaa7b6736d0400d3dd1de10dfc26a2e9 (patch) | |
| tree | 7fecc02c1858e3604f8351eed64579e459e3ab0f /Library | |
| parent | 76c0e47d97cb64139134498e23c584446e8ada58 (diff) | |
| download | homebrew-7bc1538acaa7b6736d0400d3dd1de10dfc26a2e9.tar.bz2 | |
Apply the same filtering to -I paths as -L paths
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/ENV/4.3/cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 20c9cc9ae..93f30ec4f 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -134,25 +134,29 @@ class Cmd when /^-I(.+)?/ # Support both "-Ifoo" (one argument) and "-I foo" (two arguments) path = $1.chuzzle || whittler.next - args << "-I#{path}" if iset.add?(path.cleanpath) + args << "-I#{path}" if keep?(path) and iset.add?(path.cleanpath) when /^-L(.+)?/ path = $1.chuzzle || whittler.next - doit = case path.cleanpath - when %r{^#{Regexp.escape(brewfix)}}, %r{^#{Regexp.escape(brewtmp)}} - # maybe homebrew is installed to /sw or /opt/brew - true - when %r{^/opt}, %r{^/sw}, %r{/usr/X11} - false - else - true - end - args << "-L#{path}" if doit and lset.add?(path.cleanpath) + args << "-L#{path}" if keep?(path) and lset.add?(path.cleanpath) else args << arg end end args end + + def keep? path + case path.cleanpath + when %r{^#{Regexp.escape(brewfix)}}, %r{^#{Regexp.escape(brewtmp)}} + # maybe homebrew is installed to /sw or /opt/brew + true + when %r{^/opt}, %r{^/sw}, %r{/usr/X11} + false + else + true + end + end + def cflags args = [] |
