Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ldconfig and ld.so.conf on Solaris

892 views
Skip to first unread message

Sébastien Brault

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
Hello,

I would like to write a script to automaticly compile and install
a software on Solaris or Linux.

I need to specify to use a special library path after installing
the software, so for Linux I add this path to /etc/ld.so.conf**
and run ldconfig**. I don't know the equivalent command and file
with Solaris. I know that I can set the LD_LIBRARY_PATH, but I do
not like this soltuion very much.

Is there a file on Solaris containing all paths containing dynamics
libraries ?

Thanks for your help.
Best regards.

Sebastien Brault.

** ldconfig creates the necessary links and cache (for use by
the run-time linker, ld.so) to the most recent shared
libraries found in the directories specified on the com­
mand line, in the file /etc/ld.so.conf.

Max Pashkov

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
SИbastien Brault wrote:

> Hello,
>
> I would like to write a script to automaticly compile and install
> a software on Solaris or Linux.
>
> I need to specify to use a special library path after installing
> the software, so for Linux I add this path to /etc/ld.so.conf**
> and run ldconfig**. I don't know the equivalent command and file
> with Solaris. I know that I can set the LD_LIBRARY_PATH, but I do
> not like this soltuion very much.
>
> Is there a file on Solaris containing all paths containing dynamics
> libraries ?

Solaris 8 have such opportunity to configure runtime ld.so.1
environment. See crle(1).


Sébastien Brault

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
My main target is Solaris 6 ... :-(

Max Pashkov wrote:

Sébastien Brault

unread,
May 30, 2000, 3:00:00 AM5/30/00
to

Sébastien Brault

unread,
May 30, 2000, 3:00:00 AM5/30/00
to

Willard Dawson

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
It looks to me like you are trying to build Gnome. Me, too, right now,
actually. What I've done is to define and export LD_LIBRARY_PATH, then
run ./configure, then manually edit the Makefiles to modify the library
definitions to say '-L/usr/local/lib -R/usr/local/lib -letc...', so that
building the executables has no stupid dependency on that damned
environment variable.

It's a little extra work at compile time, but probably worth it.


=?iso-8859-1?Q?S=E9bastien?= Brault <sebastie...@online.fr> writes:

>Hello,

>I would like to write a script to automaticly compile and install
>a software on Solaris or Linux.

>I need to specify to use a special library path after installing =

>the software, so for Linux I add this path to /etc/ld.so.conf** =

>and run ldconfig**. I don't know the equivalent command and file =

>with Solaris. I know that I can set the LD_LIBRARY_PATH, but I do =

>not like this soltuion very much. =


>Is there a file on Solaris containing all paths containing dynamics

>libraries ? =


>Thanks for your help.
>Best regards.

>Sebastien Brault.

>** ldconfig creates the necessary links and cache (for use by
>the run-time linker, ld.so) to the most recent shared

>libraries found in the directories specified on the com=AD


>mand line, in the file /etc/ld.so.conf.

--
Willard Francis Otto Dawson +1 770 814 5099 / +1 770 814 5202 FAX
Siemens Business Services, ENS mailto:willard...@sbs.siemens.com
4570 River Green Pkwy, Ste 140 http://www.sbs.siemens.com/
Duluth, GA 30096-2564 Standard disclaimer applies.

James Lockwood

unread,
Jun 9, 2000, 3:00:00 AM6/9/00
to
In comp.sys.sun.admin S?bastien Brault <sebastie...@online.fr> wrote:
: Hello,

: I would like to write a script to automaticly compile and install
: a software on Solaris or Linux.

: I need to specify to use a special library path after installing

: the software, so for Linux I add this path to /etc/ld.so.conf**
: and run ldconfig**. I don't know the equivalent command and file
: with Solaris. I know that I can set the LD_LIBRARY_PATH, but I do
: not like this soltuion very much.

: Is there a file on Solaris containing all paths containing dynamics
: libraries ?

The "right" way to do this is to specify your library path when you link
your application. This is typically done with the -R option to ld, and
requires no system-wide changes or root privs.

Solaris 8 introduces an alternate method of configuring the runtime linker
via crle(1), but setting rpath is generally preferable when possible (you
have control of the linking process) and more portable.

-James

Christoph Litauer

unread,
Jun 14, 2000, 3:00:00 AM6/14/00
to
Willard Dawson wrote:
>
> It looks to me like you are trying to build Gnome. Me, too, right now,
> actually. What I've done is to define and export LD_LIBRARY_PATH, then
> run ./configure, then manually edit the Makefiles to modify the library
> definitions to say '-L/usr/local/lib -R/usr/local/lib -letc...', so that
> building the executables has no stupid dependency on that damned
> environment variable.
>

Depends on the configure script and Makefile template, but most of the
time it helps to just unset LD_LIBRARY_PATH and instead export
LD_RUN_PATH. So you don't have to modify the Makefiles.

Regards
Christoph
_______________________________________________________________________
Christoph Litauer lit...@uni-koblenz.de
Universitaet Koblenz, Rechenzentrum, http://www.uni-koblenz.de/~litauer
Rheinau 1, D-56075 Koblenz, Germany Fon: +49 261 287-1311, Fax: -1355

Drazen Kacar

unread,
Jun 14, 2000, 3:00:00 AM6/14/00
to
Christoph Litauer wrote:
> Willard Dawson wrote:
> >
> > It looks to me like you are trying to build Gnome. Me, too, right now,
> > actually. What I've done is to define and export LD_LIBRARY_PATH, then
> > run ./configure, then manually edit the Makefiles to modify the library
> > definitions to say '-L/usr/local/lib -R/usr/local/lib -letc...', so that
> > building the executables has no stupid dependency on that damned
> > environment variable.
>
> Depends on the configure script and Makefile template, but most of the
> time it helps to just unset LD_LIBRARY_PATH and instead export
> LD_RUN_PATH. So you don't have to modify the Makefiles.

You can't use LD_RUN_PATH with configure scripts which check for X libs
on Solaris, because configure finds them in /usr/openwin/lib and then
adds -R/usr/openwin/lib when linking applications. If -R is in use, the
linker ignores LD_RUN_PATH.

You can use LD_OPTIONS instead.

--
.-. .-. I don't work for my employer.
(_ \ / _)
| da...@srce.hr
| da...@fly.srk.fer.hr

be...@clark.net

unread,
Jul 1, 2000, 3:00:00 AM7/1/00
to
In article <3947705B...@uni-koblenz.de>,

Christoph Litauer <lit...@uni-koblenz.de> wrote:
> Willard Dawson wrote:
> >
> > It looks to me like you are trying to build Gnome. Me, too, right
now,
> > actually. What I've done is to define and export LD_LIBRARY_PATH,
then
> > run ./configure, then manually edit the Makefiles to modify the
library
> > definitions to say '-L/usr/local/lib -R/usr/local/lib -letc...', so
that
> > building the executables has no stupid dependency on that damned
> > environment variable.
> >
>
> Depends on the configure script and Makefile template, but most of the
> time it helps to just unset LD_LIBRARY_PATH and instead export
> LD_RUN_PATH. So you don't have to modify the Makefiles.

I agree with leaving LD_LIBRARY_PATH unset. Part of the other problem
is most of the gnome-*config files don't have the proper compile flags
listed. They always have -L<dir> but never have -R<dir> so I usually
fix those before generating a package.

Ben


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages