title: libtool python module linking and installation
body: <p>I work on a project written in C, using the autotools, that produces a static library. Am also providing a Python interface to the C API in the context of the same project. I did not have permission until recently to introduce libtool in the project, in order to be able to provide both static and dynamic libraries in a portable fashion. So far, I'd produce the Python shared module using the distutils, and link the python module to the project's C static library. Again, that's because I was not allowed to introduce libtool/shared libraries into the ecuation. Now that I want to put libtool in, I am facing the following two problematic scenarios:</p>
  
  <ol>
  <li><p>If I keep producing the Python shared module using the distutils, since the distutils and the autotools do not talk to eachother, I need to tell the distutils what C library to link to. So far, I cannot think of any way of doing that but parsing the .la file to get the name and path of the library libtool was able to produce. Does libtool provide any information with regards to what type of library it was able to produce on a system ?</p></li>
  <li><p>If I move the Python module production to automake, that's fine, until I reach the installation process. I have not idea how to tell libtool I want my Python module somewhere else but the lib folder, i.e. 'lib/python2.5/site-packages/myproject'. I tried to
  just copy the library in the Makefile however that did not work properly as the library had the wrong rpath (that of the build and not that of the install). Why do I want it there ? Because there I also have the .py wrappers. So, is there any way to tell libtool to install my module somewhere else and properly set the rpath ?</p></li>
  </ol>
  
  <p>I guess I'm just looking for an elegant solution, or maybe the solution is there and it's simple but I can't see it as I'm not experienced enough. Any help ?</p>
  
  <p>P.S. Would prefer option 2, if I could make it work, since that way I would not have to pass information from the autotools to the distutils.</p>