Subject: Re: X library path, etc.
To: Peter Seebach <seebs@plethora.net>
From: Johan Danielsson <joda@pdc.kth.se>
List: current-users
Date: 01/15/2002 20:26:33
seebs@plethora.net (Peter Seebach) writes:

> This has poor scaling.  e.g., I don't want to make a new package for
> every single IOCCC entry I download, but none of them are going to
> have -Wl,-R... in their makefiles just because one system in all the
> world doesn't guess that by default.  :)

There are quite a few systems where -L does not imply -R, it's just
that most have the X directory in the default search path for
libraries.

$ uname -a
OSF1 xx V5.0 1094 alpha
$ echo 'foo(){}' > foo.c
$ echo 'main(){foo();}' > bar.c
$ cc -c foo.c 
$ cc -shared -o libfoo.so foo.o
$ cc -o bar bar.c -L/tmp -lfoo
$ ldd bar
cannot map libfoo.so <-- fatal error
$ cc -o bar bar.c -L/tmp -Wl,-rpath,/tmp -lfoo
$ ldd bar
      Main  => bar
      libfoo.so  => /tmp/libfoo.so
      libc.so  => /usr/shlib/libc.so


/Johan