From fdadd7e9dd1e833ce55554249d82e1513b906efb Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 3 Sep 2012 13:24:38 -0400 Subject: [PATCH] Fix linking against X11 cairo in preference to ours Amateur mistake where I forgot that the system library path is read AFTER the -L library path, so /usr/local/lib was after /opt/X11/lib and the wrong cairo was used. This only affects CLT /usr/local installs with XQuartz installed. Fixes Homebrew/homebrew#14639. --- Library/ENV/4.3/cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 027587b4e7..12cbb5bf53 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -17,7 +17,6 @@ end def cmake_prefixes @prefixes ||= ENV['CMAKE_PREFIX_PATH'].split(':').reject do |path| case path - when '/usr/local' then !nclt? when '/usr', '/', "#$sdkroot/usr" then true end end @@ -131,6 +130,9 @@ class Cmd end def cppflags all = cmake_prefixes.map{|prefix| "#{prefix}/include" } + # we need to do this for cppflags and not ldflags as here we use -isystem + # but with ld we can only set -L. + all.delete('/usr/local') unless nclt? opt = all.select{|prefix| prefix =~ %r{^#$brewfix/opt} } sys = all - opt + ENV['CMAKE_INCLUDE_PATH'].split(':') # we want our keg-only includes to be found before system includes so that