title: How to use pkg-config to link a library statically
body: <p>I'd like to link libpng found by pkg-config statically.</p>
  
  <pre><code>pkg-config --libs --static libpng
  </code></pre>
  
  <p>outputs</p>
  
  <blockquote>
    <p>-L/usr/local/Cellar/libpng/1.6.15/lib -lpng16 -lz</p>
  </blockquote>
  
  <p>I have both <code>libpng16.a</code> <code>libpng16.dylib</code> in that directory, and if I use these flags the library gets linked dynamically. </p>
  
  <p>How can I tell either pkg-config or the linker (preferably in some portable-ish way) that I really want it linked statically?</p>
  
  <p>I've tried adding <code>-static</code> before pkg-config's flags, but that makes clang's <code>ld</code> try and fail to link "crt0.o".</p>