Best practices for setting -rpath in .pc files?

Nick Mathewson nickm at
Fri Aug 13 10:28:23 PDT 2010


I maintain a library which (for testing and various other reasons)
people often want to install into directories not on their usual
library search path.

When they do this, is there any sense of whether it's reasonable to
include an -rpath flag (or a -Wl,-R flag, or a -R flag, or a
-Wl,-rpath flag as appropriate) in the .pc file?  Or is this a bad
idea for some reason?

If this is a reasonable idea, can anybody point me towards an example
of an autotools-based project that does it correctly, so I can see how
it's done and not reinvent the wheel?

(I've checked the documentation and mailing list archives for info
about this.  If there's anything documented, I'm afraid I haven't
managed to find it.  Of the projects I've looked at, none seem to take
this approach, but I don't know whether that's because it's a bad
idea, or because it's too hard, or whether they just didn't think to
do it.)

many thanks for your time,
Nick Mathewson

More information about the pkg-config mailing list