title: ld can't find a library when using Waf, but it can when not using Waf
body: <p>I'm trying to build my project. I have libuv already compiled in <code>./libuv</code> as <code>libuv.a</code> (so the relative path to the library is <code>./libuv/libuv.a</code>).</p>
  
  <p>When I use clang directly, it works:</p>
  
  <pre><code>$ clang++ src/**/*.cpp -std=c++11 -L./libuv -luv -I./libuv/include -I./include
  </code></pre>
  
  <p>However, when I build using Waf, I get a linker error indicating that ld can't find libuv:</p>
  
  <pre><code>$ CXX=clang++ ./waf configure &amp;&amp; ./waf build
  ...
  [2/2] cxxprogram: build/src/uv/loop.cpp.1.o -&gt; build/a.out
  /usr/bin/ld.gold: error: cannot find -luv
  ...
  Build failed
   -&gt; task in 'a.out' failed (exit status 1): 
      {task 140349441167440: cxxprogram loop.cpp.1.o -&gt; a.out}
  ['clang++', 'src/uv/loop.cpp.1.o', '-o', '~/sf/build/a.out', '-Wl,-Bstatic', '-Llibuv', '-luv', '-Wl,-Bdynamic']
  </code></pre>
  
  <p>My wscript is fairly simple:</p>
  
  <pre><code>def options(opt):
      opt.load('compiler_cxx')
  
  def configure(conf):
      conf.load('compiler_cxx')
  
  def build(bld):
      bld.program(
          source=bld.path.ant_glob('src/**/*.cpp'),
          target='a.out',
  
          includes=['include', 'libuv/include'],
          stlibpath=['libuv'],
          stlib=['uv'],
  
          cxxflags=['-std=c++11']
      )
  </code></pre>
  
  <p>Why can't ld find the library when invoked through Waf, while everything works fine when not using Waf (I suspect it has to do with the <code>-Wl,-Bstatic</code> flag, but I'm not sure)?</p>