title: How to set flags for library objects using libtool
body: <p>I want to use libtool in order to build my library. My <strong>Makefile.am</strong> looks like this: </p>
  
  <pre><code>lib_LTLIBRARIES = mylib.la
  
  mylib_la_SOURCES = source1.c source2.c
  mylib_la_LIBADD = -lXLibray
  </code></pre>
  
  <p>The problem is that <code>source1</code> depends on <code>XLibrary</code> and when it tries to compile it in order to obtain the library object (<code>source1.lo</code>) it don't use the <code>-XLibrary</code> flag and it returns with error. </p>
  
  <p>Do you have any idea about how can I solve this?</p>