public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] standards/conventions? (LDPATH, include files)
@ 2001-12-06 18:51 Zach Forrest
  0 siblings, 0 replies; 12+ messages in thread
From: Zach Forrest @ 2001-12-06 18:51 UTC (permalink / raw
  To: gentoo-dev

Are there any conventions on where to store include files? Also, when 
should one not store files in /usr/lib and instead put a file in 
/etc/env.d that sets LDPATH? The current package I'm working on defaults 
to /usr/lib and /usr/include. I've looked in both of these directories 
and it seems like it should be fine. Is this correct?

Zach



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
@ 2001-12-06 19:33 tneidt
  2001-12-06 19:43 ` Dan Armak
  2001-12-07 10:10 ` Juergen Ilse
  0 siblings, 2 replies; 12+ messages in thread
From: tneidt @ 2001-12-06 19:33 UTC (permalink / raw
  To: gentoo-dev

Hi!

Good questions. I've been wondering the same thing myself.

I also have a somewhat related question.  Gentoo Linux doesn't seem to set a 
global LD_LIBRARY_PATH environmental variable like most mainstream linux 
distributions (RedHat, Debian, etc.) do.  I far as I can tell, this is a _good_ 
thing. (see http://www.visi.com/~barr/ldpath.html).  However, some applications 
look for this variable.  Is there a way, around this?  Specifically, I've been 
looking into Webmin (http://www.webmin.com/webmin/), and trying to work up some 
gentoo config files for it.  The top level config file seems to want 
LD_LIBRARY_PATH.  At least that is what is in the config files for the other 
distributions.

tod

> Are there any conventions on where to store include files? Also, when 
> should one not store files in /usr/lib and instead put a file in 
> /etc/env.d that sets LDPATH? The current package I'm working on defaults 
> to /usr/lib and /usr/include. I've looked in both of these directories 
> and it seems like it should be fine. Is this correct?
> 
> Zach
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
> 


---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-06 19:33 tneidt
@ 2001-12-06 19:43 ` Dan Armak
  2001-12-06 20:47   ` Zach Forrest
  2001-12-07 10:56   ` Juergen Ilse
  2001-12-07 10:10 ` Juergen Ilse
  1 sibling, 2 replies; 12+ messages in thread
From: Dan Armak @ 2001-12-06 19:43 UTC (permalink / raw
  To: gentoo-dev

On Thursday 06 December 2001 21:33, you wrote:
> Hi!
>
> Good questions. I've been wondering the same thing myself.
>
> I also have a somewhat related question.  Gentoo Linux doesn't seem to set
> a global LD_LIBRARY_PATH environmental variable like most mainstream linux
> distributions (RedHat, Debian, etc.) do.  I far as I can tell, this is a
> _good_ thing. (see http://www.visi.com/~barr/ldpath.html).  However, some
> applications look for this variable.  Is there a way, around this? 
> Specifically, I've been looking into Webmin
> (http://www.webmin.com/webmin/), and trying to work up some gentoo config
> files for it.  The top level config file seems to want LD_LIBRARY_PATH.  At
> least that is what is in the config files for the other distributions.
Hi,

In Gentoo LD_LIBRARY_PATH is called simply LDPATH. Legend has it drobbins 
simply renamed it because he was tired of typing the longer version :-) Under 
/etc/env.d you will see a lot of files setting that variable.

However, it doesn't actually get exported to your shell. Instead, env-update 
changes /etc/ld.so.conf to include those dirs.

So if you app is well written just let it think LD_LIBRARY_PATH is empty and 
that everything is ni standard dirs - it is. Is that approach problematic?

I believe that's all, have I missed something?

-- 

Dan Armak
Gentoo Linux Developer, Desktop Team
Matan, Israel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-06 19:43 ` Dan Armak
@ 2001-12-06 20:47   ` Zach Forrest
  2001-12-06 20:53     ` Dan Armak
  2001-12-07 10:56   ` Juergen Ilse
  1 sibling, 1 reply; 12+ messages in thread
From: Zach Forrest @ 2001-12-06 20:47 UTC (permalink / raw
  To: gentoo-dev

Missed one thing...

When should a file be added to env.d? The package I'm putting together, 
by default, puts its libraries in /usr/lib? I've noticed that packages 
like mozilla put their libraries in something like /usr/lib/mozilla/lib. 
I know when unpacking mozilla it stores its libraries in the lib 
subdirectory of mozilla, so would this be an indication of when to add a 
file to env.d? In other words, should I accept the default location and 
then, if the default is not the standard /usr/lib, add a file to env.d?

Thanks.

Dan Armak wrote:

> On Thursday 06 December 2001 21:33, you wrote:
> 
>>Hi!
>>
>>Good questions. I've been wondering the same thing myself.
>>
>>I also have a somewhat related question.  Gentoo Linux doesn't seem to set
>>a global LD_LIBRARY_PATH environmental variable like most mainstream linux
>>distributions (RedHat, Debian, etc.) do.  I far as I can tell, this is a
>>_good_ thing. (see http://www.visi.com/~barr/ldpath.html).  However, some
>>applications look for this variable.  Is there a way, around this? 
>>Specifically, I've been looking into Webmin
>>(http://www.webmin.com/webmin/), and trying to work up some gentoo config
>>files for it.  The top level config file seems to want LD_LIBRARY_PATH.  At
>>least that is what is in the config files for the other distributions.
>>
> Hi,
> 
> In Gentoo LD_LIBRARY_PATH is called simply LDPATH. Legend has it drobbins 
> simply renamed it because he was tired of typing the longer version :-) Under 
> /etc/env.d you will see a lot of files setting that variable.
> 
> However, it doesn't actually get exported to your shell. Instead, env-update 
> changes /etc/ld.so.conf to include those dirs.
> 
> So if you app is well written just let it think LD_LIBRARY_PATH is empty and 
> that everything is ni standard dirs - it is. Is that approach problematic?
> 
> I believe that's all, have I missed something?
> 
> 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-06 20:47   ` Zach Forrest
@ 2001-12-06 20:53     ` Dan Armak
  2001-12-06 22:05       ` Zach Forrest
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Armak @ 2001-12-06 20:53 UTC (permalink / raw
  To: gentoo-dev

On Thursday 06 December 2001 22:47, you wrote:
> Missed one thing...
>
> When should a file be added to env.d? The package I'm putting together,
> by default, puts its libraries in /usr/lib? I've noticed that packages
> like mozilla put their libraries in something like /usr/lib/mozilla/lib.
> I know when unpacking mozilla it stores its libraries in the lib
> subdirectory of mozilla, so would this be an indication of when to add a
> file to env.d? In other words, should I accept the default location and
> then, if the default is not the standard /usr/lib, add a file to env.d?
Generally speaking you put a file in /etc/env.d whenever you want to change a 
global environment variable, mainly for extending various PATH settings. But 
yuo already know that. In the case of LDPATH, use a /etc/env.d file to add 
your libdir to LDPATH if it's in a non-standard location.

As to how to decide where to install: use /usr if at all possible. Use 
something like /usr/lib/yourlib/lib (like mozilla does) if: 
a. Your package has a non standard dir structure (i.e. ither than ./bin, 
./lib, ./include...)
b. Various versions of your package are likely to be installed, and can't 
live in one dir.
c. Any other good reason.

-- 

Dan Armak
Gentoo Linux Developer, Desktop Team
Matan, Israel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-06 20:53     ` Dan Armak
@ 2001-12-06 22:05       ` Zach Forrest
  0 siblings, 0 replies; 12+ messages in thread
From: Zach Forrest @ 2001-12-06 22:05 UTC (permalink / raw
  To: gentoo-dev

Thanks.

Dan Armak wrote:

> On Thursday 06 December 2001 22:47, you wrote:
> 
>>Missed one thing...
>>
>>When should a file be added to env.d? The package I'm putting together,
>>by default, puts its libraries in /usr/lib? I've noticed that packages
>>like mozilla put their libraries in something like /usr/lib/mozilla/lib.
>>I know when unpacking mozilla it stores its libraries in the lib
>>subdirectory of mozilla, so would this be an indication of when to add a
>>file to env.d? In other words, should I accept the default location and
>>then, if the default is not the standard /usr/lib, add a file to env.d?
>>
> Generally speaking you put a file in /etc/env.d whenever you want to change a 
> global environment variable, mainly for extending various PATH settings. But 
> yuo already know that. In the case of LDPATH, use a /etc/env.d file to add 
> your libdir to LDPATH if it's in a non-standard location.
> 
> As to how to decide where to install: use /usr if at all possible. Use 
> something like /usr/lib/yourlib/lib (like mozilla does) if: 
> a. Your package has a non standard dir structure (i.e. ither than ./bin, 
> ./lib, ./include...)
> b. Various versions of your package are likely to be installed, and can't 
> live in one dir.
> c. Any other good reason.
> 
> 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-06 19:33 tneidt
  2001-12-06 19:43 ` Dan Armak
@ 2001-12-07 10:10 ` Juergen Ilse
  2001-12-07 14:33   ` Tod M. Neidt
  1 sibling, 1 reply; 12+ messages in thread
From: Juergen Ilse @ 2001-12-07 10:10 UTC (permalink / raw
  To: gentoo-dev

Hello,

On Thu, Dec 06, 2001 at 07:33:15PM +0000, tneidt@mail.fidnet.com wrote:

> > Are there any conventions on where to store include files? Also, when
> > should one not store files in /usr/lib and instead put a file in
> > /etc/env.d that sets LDPATH? The current package I'm working on defaults
> > to /usr/lib and /usr/include. I've looked in both of these directories
> > and it seems like it should be fine. Is this correct?

If you need to include files from other directories, you should use
the "-I<directory>" compiler-Option, otherwise your source seems to
be buggy (only my opinion) ...

> I also have a somewhat related question.  Gentoo Linux doesn't seem to set a 
> global LD_LIBRARY_PATH environmental variable like most mainstream linux 
> distributions (RedHat, Debian, etc.) do.

It is unnecessary. Using LD_LIBRARY_PATH is also dangerous. It is nothing
more than a workaround (except for cases, where a user wants to use his
own libraries, which are not installed at the "official places). 
The "clean way" is to include the library-directories in /etc/ld.so.conf
and to use "ldconfig" to update the cache-file (in this case, setting
LD_LIBRARY_PATH should be unnecessary for using the system-libraries).

> I far as I can tell, this is a _good_ thing.

I don't think so.

> (see http://www.visi.com/~barr/ldpath.html).

It looks to me, that the author of this website thinks, that "LD_LIBRARY_PATH"
ist a very bad idea at all ...

> However, some applications look for this variable.

If an application itself (not only the shared library loader) looks for
LD_LIBRARY_PATH, may be this application is *broken* ...

> Is there a way, around this?  Specifically, I've been looking into Webmin
> (http://www.webmin.com/webmin/), and trying to work up some gentoo config
> files for it.  The top level config file seems to want LD_LIBRARY_PATH.

Than fix this config file or fix the application. *DON'T TRY TO FIX THINGS
THAT ARE NOT BROKEN!* Setting LD_LIBRARY_PATH globally will IMHO do so ...

> At least that is what is in the config files for the other 
> distributions.

Not all, what you will find in other distributions is really good ...

ciao,
	Juergen Ilse					(ilse@asys-h.de)
-- 
Wenn ich auch nur aus jedem 1000. Bug in einem M$ Produkt|Juergen Ilse
einen Tag trauern wollte, also da muesste ich 300 Jahre  |Internet POP Hannover
alt werden und wuerde mehrere Dutzend schwarze Anzuege   |Vahrenwalder Str. 205
aufbrauchen. (Detlef Bosau in dcoulm)                    |30165 Hannover


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-06 19:43 ` Dan Armak
  2001-12-06 20:47   ` Zach Forrest
@ 2001-12-07 10:56   ` Juergen Ilse
  2001-12-07 14:54     ` Tod M. Neidt
  2001-12-07 21:31     ` Daniel Robbins
  1 sibling, 2 replies; 12+ messages in thread
From: Juergen Ilse @ 2001-12-07 10:56 UTC (permalink / raw
  To: gentoo-dev

Hello,

On Thu, Dec 06, 2001 at 09:43:16PM +0200, Dan Armak wrote:
> In Gentoo LD_LIBRARY_PATH is called simply LDPATH.

I don't think so. LD_LIBRARY_PATH ist relevant for the shared library loader
ld.so (see also "man ld.so"). LDPATH is (as far as i know) not relevant for
ld.so. LDPATH and LD_LIBRARY_PATH are IMHO totally different things (and
IMHO should LD_LIBRARY_PATH not be set to a default value).

> Legend has it drobbins simply renamed it because he was tired of typing
> the longer version :-)

Is it some kind of "urban legend"? ;-)
I also did a "strings /lib/ld.so | grep LD" to see, if ld.so was modified
to accept LDPATH instead of "LD_LIBRARY_PATH" and i saw no "LDPATH" in,
so the meaning of LD_LIBRARY_PATH seems not to be modified and LDPATH seems
not to "replace" LD_LIBRARY_PATH ...

> Under /etc/env.d you will see a lot of files setting that variable.
 
... which is not the same as LD_LIBRARY_PATH ...

> However, it doesn't actually get exported to your shell. Instead, env-update 
> changes /etc/ld.so.conf to include those dirs.
 
IMHO is that "the right thing" to do.

> So if you app is well written just let it think LD_LIBRARY_PATH is empty and 
> that everything is ni standard dirs - it is. Is that approach problematic?
 
No.

ciao,
	Juergen Ilse					(ilse@asys-h.de)
-- 
Wenn ich auch nur aus jedem 1000. Bug in einem M$ Produkt|Juergen Ilse
einen Tag trauern wollte, also da muesste ich 300 Jahre  |Internet POP Hannover
alt werden und wuerde mehrere Dutzend schwarze Anzuege   |Vahrenwalder Str. 205
aufbrauchen. (Detlef Bosau in dcoulm)                    |30165 Hannover


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-07 10:10 ` Juergen Ilse
@ 2001-12-07 14:33   ` Tod M. Neidt
  2001-12-07 21:33     ` Daniel Robbins
  0 siblings, 1 reply; 12+ messages in thread
From: Tod M. Neidt @ 2001-12-07 14:33 UTC (permalink / raw
  To: gentoo-dev

Hi!

I think you may have misunderstood what I was saying.  I should have
made my comments more explicit.

On Fri, 2001-12-07 at 04:10, Juergen Ilse wrote:

> > I also have a somewhat related question.  Gentoo Linux doesn't seem to set a 
> > global LD_LIBRARY_PATH environmental variable like most mainstream linux 
> > distributions (RedHat, Debian, etc.) do.
> 
> It is unnecessary. Using LD_LIBRARY_PATH is also dangerous. It is nothing
> more than a workaround (except for cases, where a user wants to use his
> own libraries, which are not installed at the "official places). 
> The "clean way" is to include the library-directories in /etc/ld.so.conf
> and to use "ldconfig" to update the cache-file (in this case, setting
> LD_LIBRARY_PATH should be unnecessary for using the system-libraries).
I agree.

> 
> > I far as I can tell, this is a _good_ thing.
> 
> I don't think so.
> 
I meant it is a _good_ thing that Gentoo Linux does _not_ use
LD_LIBRARY_PATH.
> > (see http://www.visi.com/~barr/ldpath.html).
> 
> It looks to me, that the author of this website thinks, that "LD_LIBRARY_PATH"
> ist a very bad idea at all ...
> 
Exactly, which is why I cited the webpage.  It seems to explain why
LD_LIBRARY_PATH should not bet used well.
> > However, some applications look for this variable.
> 
> If an application itself (not only the shared library loader) looks for
> LD_LIBRARY_PATH, may be this application is *broken* ...
> 
> > Is there a way, around this?  Specifically, I've been looking into Webmin
> > (http://www.webmin.com/webmin/), and trying to work up some gentoo config
> > files for it.  The top level config file seems to want LD_LIBRARY_PATH.
> 
> Than fix this config file or fix the application. *DON'T TRY TO FIX THINGS
> THAT ARE NOT BROKEN!* Setting LD_LIBRARY_PATH globally will IMHO do so ...
Let me provide a little more information.  Webmin is a web application
for configuring and administering Unix boxes remotely.  It is
essentially a bunch of perl scripts.
> > At least that is what is in the config files for the other 
> > distributions.
> 
> Not all, what you will find in other distributions is really good ...
> 

Here is an example top-level config file for Redhat:
******config-redhat-linux******

find_pid_command=ps auwwwx | grep NAME | grep -v grep | awk '{ print $2
}'
path=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
ld_env=LD_LIBRARY_PATH

*************************

In fact, the toplevel webmin config files for redhat, debian, mandrake,
slackeware, suse, and linux from scratch as well at openbsd, netbsd and
even soloaris all have ld_env=LD_LIBRARY_PATH (the path variable changes
though).  Interestingly, the solaris config also uses
ld_path=/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib which isn't in the
linux configs.

Let me sum up.  I am not saying that Gentoo Linux should or even needs
LD_LIBRARY_PATH.  I am just trying to figure out how to configure webmin
for Gentoo.  It should be relatively painless because all you need to do
is add config-gentoo-linux files describing the Gentoo environment to
the top-level and the module subdirectories.  I just happen to be stuck
on how to set ld_env.  Webmin is actually a very nice application, so I
think it is worth it.

tod



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-07 10:56   ` Juergen Ilse
@ 2001-12-07 14:54     ` Tod M. Neidt
  2001-12-07 21:31     ` Daniel Robbins
  1 sibling, 0 replies; 12+ messages in thread
From: Tod M. Neidt @ 2001-12-07 14:54 UTC (permalink / raw
  To: gentoo-dev

On Fri, 2001-12-07 at 04:56, Juergen Ilse wrote:
> Hello,
> 
> On Thu, Dec 06, 2001 at 09:43:16PM +0200, Dan Armak wrote:
> > In Gentoo LD_LIBRARY_PATH is called simply LDPATH.
> 
> I don't think so. LD_LIBRARY_PATH ist relevant for the shared library loader
> ld.so (see also "man ld.so"). LDPATH is (as far as i know) not relevant for
> ld.so. LDPATH and LD_LIBRARY_PATH are IMHO totally different things (and
> IMHO should LD_LIBRARY_PATH not be set to a default value).
> 
> > Legend has it drobbins simply renamed it because he was tired of typing
> > the longer version :-)
> 
> Is it some kind of "urban legend"? ;-)
> I also did a "strings /lib/ld.so | grep LD" to see, if ld.so was modified
> to accept LDPATH instead of "LD_LIBRARY_PATH" and i saw no "LDPATH" in,
> so the meaning of LD_LIBRARY_PATH seems not to be modified and LDPATH seems
> not to "replace" LD_LIBRARY_PATH ...
> 
> > Under /etc/env.d you will see a lot of files setting that variable.
>  
> ... which is not the same as LD_LIBRARY_PATH ...
> 
> > However, it doesn't actually get exported to your shell. Instead, env-update 
> > changes /etc/ld.so.conf to include those dirs.
>  
> IMHO is that "the right thing" to do.
> 
I believe LDPATH is internal to portage.  Like dan said, it doesn't get
exported. It's used to generate ld.so.cache.

tod



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-07 10:56   ` Juergen Ilse
  2001-12-07 14:54     ` Tod M. Neidt
@ 2001-12-07 21:31     ` Daniel Robbins
  1 sibling, 0 replies; 12+ messages in thread
From: Daniel Robbins @ 2001-12-07 21:31 UTC (permalink / raw
  To: gentoo-dev

On Fri, Dec 07, 2001 at 11:56:17AM +0100, Juergen Ilse wrote:

> > However, it doesn't actually get exported to your shell. Instead, env-update 
> > changes /etc/ld.so.conf to include those dirs.
>  
> IMHO is that "the right thing" to do.

Agreed. :)

-- 
Daniel Robbins                                  <drobbins@gentoo.org>
Chief Architect/President                       http://www.gentoo.org 
Gentoo Technologies, Inc.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] standards/conventions? (LDPATH, include files)
  2001-12-07 14:33   ` Tod M. Neidt
@ 2001-12-07 21:33     ` Daniel Robbins
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Robbins @ 2001-12-07 21:33 UTC (permalink / raw
  To: gentoo-dev

On Fri, Dec 07, 2001 at 08:33:35AM -0600, Tod M. Neidt wrote:

> Let me sum up.  I am not saying that Gentoo Linux should or even needs
> LD_LIBRARY_PATH.  I am just trying to figure out how to configure webmin
> for Gentoo.  It should be relatively painless because all you need to do
> is add config-gentoo-linux files describing the Gentoo environment to
> the top-level and the module subdirectories.  I just happen to be stuck
> on how to set ld_env.  Webmin is actually a very nice application, so I
> think it is worth it.

Sorry for the misunderstanding :)

-- 
Daniel Robbins                                  <drobbins@gentoo.org>
Chief Architect/President                       http://www.gentoo.org 
Gentoo Technologies, Inc.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-12-07 21:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-06 18:51 [gentoo-dev] standards/conventions? (LDPATH, include files) Zach Forrest
  -- strict thread matches above, loose matches on Subject: below --
2001-12-06 19:33 tneidt
2001-12-06 19:43 ` Dan Armak
2001-12-06 20:47   ` Zach Forrest
2001-12-06 20:53     ` Dan Armak
2001-12-06 22:05       ` Zach Forrest
2001-12-07 10:56   ` Juergen Ilse
2001-12-07 14:54     ` Tod M. Neidt
2001-12-07 21:31     ` Daniel Robbins
2001-12-07 10:10 ` Juergen Ilse
2001-12-07 14:33   ` Tod M. Neidt
2001-12-07 21:33     ` Daniel Robbins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox