Dec
30
2009

libtool silently skips shared libraries without -rpath

Ouch! This is the second time I am running into this so I’ll write it up this time.

I used libtool via automake for building a python module. Quite unhelpfully, libtool happens to build only the static library. It does that even though I passed the -module option, which should make it clear that a static library does not help at all. There is also no mention why it skips the shared library.

After some research, my memory came back: libtool requires to pass the -rpath option to actually build shared libraries. I did not want to pass that options, since it is considered harmful where multiple variants of a library are available. It is even less useful in my specific case, as the module is only used inside the source tree for unit testing.

Solution: I changed the Makefile.am to use

1
_helper_la_LDFLAGS = -module -rpath /freaking/libtool/requires/at/least/a/dummy/path

Interestingly, the same scheme (apart from the wording) is used in libtool’s own source.

tags:
posted in Observations by admin

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

You must be logged in to post a comment.

 
Powered by Wordpress and MySQL. Theme by openark.org