From: Guy Harris <guy@netapp.com>

Package: glib
Version: 1.2.4

OS: Solaris 2.5.1
X: X11R6 client libraries that come with Solaris 2.5.1, Exceed X11R6
   server running atop Windows NT

but the problem is with the C compiler and linker.

Bug:

The "-L" flag is insufficient, with Sun's linker (and possibly with the
linker on other systems, e.g. other SVR4 derivatives, IRIX, and even
Linux or BSD systems where the library is being installed in a directory
the run-time linker isn't configured to search by default), to find
libraries; the linker will find the library when it builds a program,
but the run-time linker won't find the library when the program is run,
unless the user sets LD_LIBRARY_PATH or LD_RUN_PATH.

This can get in the way of trying to build and run a program if Glib
isn't installed in one of the directories searched by default.

On Solaris, the "-R" flag should be used, in addition to the "-L" flag;
an IRIX user claims that "-rpath" should be used on IRIX, and indicates
that "--rpath" should be used on FreeBSD - and FreeBSD uses, I think,
the GNU binutils, so "--rpath" is probably what would be used on other
systems using the GNU binutils.

I'll only include the change for Solaris, though, as I don't have an
IRIX system on which to try this, and the Linux and FreeBSD systems I
use are configured to search "/usr/local/lib" for shared libraries, and
I have Glib and GTK+ installed there.

Fix:

In the code that handles "--libs" in "glib-config" (or, rather, in
"glib-config.in"), check the OS on which the script is running and, if
it's SunOS 5.x, echo a "-R" flag as well as a "-L" flag.