title: gcc include path and symlinks
body: <p>I am trying to compile Macports on Snow Leopard—specifically, the file <code>src/macports1.0/get_systemconfiguration_proxies.c</code>.  This <code>#include</code>s <code>CoreFoundation/CoreFoundation.h</code>, which <code>#include</code>s <code>CoreFoundation/CFBase.h</code>, which … <em>tries</em> to <code>#include</code> <code>CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h</code>.  Now, <code>CoreServices</code> is a symlink:</p>
  
  <pre><code>$ ls -l CoreServices
  lrwxr-xr-x  1 root  wheel  62 Mar 25 17:15 CoreServices -&gt; ../../System/Library/Frameworks/CoreServices.framework/Headers
  </code></pre>
  
  <p>so I suspect that the goal is to get to <code>../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h</code>, which is a perfectly fine thing to do:</p>
  
  <pre><code>$ ls -l ../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h 
  -rw-r--r--  1 root  wheel  30291 Jun 24  2010 ../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h
  </code></pre>
  
  <p>However, <code>gcc</code> doesn't like it:</p>
  
  <pre><code>In file included from $INCLUDE/CoreFoundation/CFBase.h:48,
                   from $INCLUDE/CoreFoundation/CoreFoundation.h:38,
                   from get_systemconfiguration_proxies.c:42:
  $INCLUDE/CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h:20:42: error: CarbonCore/ConditionalMacros.h: No such file or directory
  </code></pre>
  
  <p>which leads me to suspect</p>
  
  <p>(<strong>EDIT</strong>:  But <a href="https://stackoverflow.com/questions/5440300/gcc-include-path-and-symlinks/5440502#5440502">Tom Zych</a> points out that I suspect wrongly, because I didn't finish reading the error message.  <em>Sigh</em>.)</p>
  
  <p>that <code>gcc</code> may not be resolving the symlink, and instead over-smartly collapsing <code>CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h</code> to <code>Frameworks/CarbonCore.framework/Headers/MacTypes.h</code>, which, sure enough, doesn't exist:</p>
  
  <pre><code>$ ls -l Frameworks/CarbonCore.framework/Headers/MacTypes.h
  ls: Frameworks/CarbonCore.framework/Headers/MacTypes.h: No such file or directory
  </code></pre>
  
  <p>Is it possible that I have interpreted the error correctly?  If so, is there any way to talk <code>gcc</code> into following the symlink before <code>cd</code>'ing to <code>..</code>?</p>