title: Alternatives to the --sysroot switch of gcc?
body: <p>The <code>--sysroot</code> switch is useful when you don't want the headers/libraries in the standard paths affect your build.</p>
  
  <blockquote>
    <p><code>--sysroot=dir</code>: Use dir as the logical root directory for headers and
    libraries. For example, if the
    compiler would normally search for
    headers in /usr/include and libraries
    in /usr/lib, it will instead search
    dir/usr/include and dir/usr/lib. <a href="http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Directory-Options.html#Directory-Options" rel="noreferrer">[ref]</a></p>
  </blockquote>
  
  <p>Can the same thing be accomplished through the use of environment variables, the <em>gcc specs</em> file, or any other methods that do not require command line switches?</p>