title: how to make PKG_CHECK_MODULES work with static libraries?
body: <p>I have in configure.ac:</p>
  
  <pre><code>PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 &gt;= 2.6.26])
  </code></pre>
  
  <p>and I use <code>$(LIBXML2_LIBS)</code> in Makefile.am.</p>
  
  <p>It works if libxml2 is linked dynamically, but now if it's static linking fails because of missing <code>-lz</code>.</p>
  
  <p>A workaround for the user is to set</p>
  
  <pre><code>PKG_CONFIG="pkg-config --static"
  </code></pre>
  
  <p>but I'd rather enhance the configure script in such a way that this workaround is not necessary.</p>
  
  <p>Of course I don't know if libxml2 will be static or DSO, so I can't just hardcode the <code>--static</code> flag. Anyone has a macro for this?</p>