Well, that simply does not answer my question, so I will give some
background:
I have a nice system compiled by hand, from source, and ... well, I have
broken it somewhat by upgrading a major system library. I want to prevent
this same mishap from recurring, so I will explain my problem, propose my
solution, and ask how to implement my solution.
I want to know how to make the linker dereference symbolic links when
compiling. For instance, gimp is linked to libglib-2.0.so.0, and
libpng15.so.15:
# ldd `which gimp`
<snip>
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb6f50000)
<snip>
libpng15.so.15 => /usr/lib/libpng15.so.15 (0xb6a5e000)
<snip>
However, I have several versions of libglib-2.0.so.0, and 2 of
libpng15.so.15:
# ls -l /usr/lib/{libglib-2.0.so.0,libpng15.so.15}*
/usr/lib/libglib-2.0.so.0 -> libglib-2.0.so.0.3303.0
/usr/lib/libglib-2.0.so.0.1300.0
/usr/lib/libglib-2.0.so.0.1800.4
/usr/lib/libglib-2.0.so.0.3200.0
/usr/lib/libglib-2.0.so.0.3303.0
/usr/lib/libpng15.so.15 -> libpng15.so.15.9.0
/usr/lib/libpng15.so.15.6.0
/usr/lib/libpng15.so.15.9.0
Gimp now segfaults when I try to save as a .PNG format, and several other
programs are sketchy too. So I want to rebuild my system; however, I
would like to avoid this pitfall. If I could, for instance, cause gimp to
link only to /usr/lib/libpng15.so.15.6.0 (or whatever version was, when
gimp was built), instead of whatever the most recent version of
libpng15.so.15 on my system is, then gimp will continue to work even after
I upgrade my libpng15.so.15, and whatever other libraries I need to
upgrade (for programs which need more recent versions of libraries, for eg.)
I know that GNU protocols specify that a minor version change
shouldn't break library compatibility, but in practice it is not
always so. So, my question is, how do I get my linker to dereference
symbolic links at compile time?
--
dave
Mon Mar 4 20:02:56 AST 2013