title: Relative or independent paths in libtool .la file
body: <p>My <code>.la</code> file has full pathnames in both the <code>dependency_libs=</code> section and the <code>libdir=</code> section which makes it difficult to copy my libraries to a different machine (same arch but different path structure). What is the solution to this, besides having some script to hack the <code>.la</code> file to adjust for the paths on the new machine?</p>
  
  <p><strong>==Details==</strong></p>
  
  <p>When I <code>./configure; make; make install</code> my <code>libfoo</code>, depending on how I use the <code>--prefix</code>, <code>--exec-prefix</code>, and <code>DESTDIR=</code> flags, I'll get an entry in the <code>libfoo.la</code> file that reads <code>libdir=/dir1/lib</code> and I'll have the actual <code>.so</code> files in the same dir as <code>libfoo.la</code>. All is well (in terms of linking something with <code>libfoo</code> as it is) until I package these up and put them on another machine.</p>
  
  <p>Let's say I have <code>libbar</code> on my second machine which depends on <code>libfoo</code>. When I use my <code>-L/dir2/lib</code> flag to look for <code>-lfoo</code>, the <code>libbar</code> compilation/linking fails because of the <code>libfoo.la</code> file is expecting foo to be installed in <code>/dir1/lib</code> (from the first machine) when it's actually in <code>/dir2/lib</code>. I then need to replace all of the <code>dir1</code>'s with the correct path, both of which can be long and complicated.</p>
  
  <p>The <code>dependency_libs=</code> line also comes into play in a similar manner.</p>
  
  <p>How do I avoid this problem?</p>