title: How to eliminate /usr/local from pre compiler and linker paths?
body: <p>I am trying to build an open source package and running into trouble involving a conflict with a prototype library I have installed in <code>/usr/local</code>, where the "right" version resides in <code>/usr</code>.</p>
  
  <pre><code>% (make distclean&gt;/dev/null; ./configure &gt; no_env_conf.log 2&gt;&amp; 1; make &gt; no_env_make.log 2&gt;&amp;1 &amp;&amp; echo Success || echo 'Build Error')
  Build Error
  </code></pre>
  
  <p>I want to configure and compile without <code>/usr/local</code> in the precompile or linker paths. I thought I could do that by specifying the appropriate environment variables, but that does not quite work:</p>
  
  <pre><code>% (make distclean&gt;/dev/null; CFLAGS=-I/usr/include LDFLAGS=-L/usr/lib ./configure &gt; no_env_conf.log 2&gt;&amp; 1; make &gt; no_env_make.log 2&gt;&amp;1 &amp;&amp; echo Success || echo 'Build Error')
  Build Error
  </code></pre>
  
  <p>But if I simply remove <code>/usr/local</code> from the filesystem then everything works:</p>
  
  <pre><code>% (sudo mv /usr/local /usr/local_off; make distclean&gt;/dev/null; ./configure &gt; no_env_conf.log 2&gt;&amp; 1; make &gt; no_env_make.log 2&gt;&amp;1 &amp;&amp; echo Success || echo 'Compile Error'; sudo mv /usr/local_off /usr/local )
  Success
  </code></pre>
  
  <p>Is there a way to eliminate <code>/usr/local</code> from the paths used by the pre compiler and linker?  I would especially like something that could be handled by <code>configure</code> options or environment variables.</p>
  
  <p><em>Specific context: I am building <code>ccache</code> on OSX Lion where I have installed v1.2.6 of <code>zlib</code> in <code>/usr/local</code>, while the required one in <code>/usr</code> happens to be 1.2.5.  This build actually happens as part of a wider script-controlled build of MythTV and all its dependencies including <code>ccache</code>.</em></p>