Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wishlist] ld.conf location and configuration script. #3107

Closed
vicuna opened this issue Dec 26, 2001 · 5 comments
Closed

[wishlist] ld.conf location and configuration script. #3107

vicuna opened this issue Dec 26, 2001 · 5 comments

Comments

@vicuna
Copy link

vicuna commented Dec 26, 2001

Original bug ID: 755
Reporter: administrator
Status: closed
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hello, ...

The debian policy mandates the location for files such as ld.conf in the /etc
directory structure. As such, it would be very nice (for me and others too i
guess) to be able to choose the location of this file at configuration time.

Also, since the current version of ocaml don't searches $OCAMLDIR and it's
subdirectories by default (contrary to what Xavier wrote to me in a mail, but
i may simply have misunderstood something), it is needed to fill this ld.conf
file accordyingly for each installed library.

It would be nice to have some script or little program that helps adding or
removing entries in this ld.conf file and i will be providing such a one in my
debian packages next week, but to enable such a program or script to handle
multiple libraries using the same directory, it would be really nice to be
able to add a field at the end of the files in the ld.conf file, using it as a
occurence counter or something such. Maybe this is already possible but i have
not looked at it yet, will do the first week of january though.

What do you think about this occurence counter stuff ? Is it a good idea, or
a totally wrong approach ?

Friendly,

Sven Luther

@vicuna
Copy link
Author

vicuna commented Jan 4, 2002

Comment author: administrator

The debian policy mandates the location for files such as ld.conf in the /etc
directory structure. As such, it would be very nice (for me and others too i
guess) to be able to choose the location of this file at configuration time.

Would it really be a good idea? Knowing that ocaml libraries are not binary
compatible between version, keeping everything in the same place seems safer...

It would be nice to have some script or little program that helps adding or
removing entries in this ld.conf file and i will be providing such a one in
my
debian packages next week, but to enable such a program or script to handle
multiple libraries using the same directory, it would be really nice to be
able to add a field at the end of the files in the ld.conf file, using it as
a
occurence counter or something such. Maybe this is already possible but i
have
not looked at it yet, will do the first week of january though.

No, currently you are only allowed a carriage return.
By the way, the following two lines (from labltk) do the job. This works on all
the unixes I know.

if test grep -s -c '^$(LABLTKDIR)$$' $(LIBDIR)/ld.conf = 0;
then echo $(LABLTKDIR) >> $(LIBDIR)/ld.conf; fi

@vicuna
Copy link
Author

vicuna commented Jan 7, 2002

Comment author: administrator

On Fri, Jan 04, 2002 at 10:12:26AM +0100, Jacques Garrigue wrote:

The debian policy mandates the location for files such as ld.conf in the /etc
directory structure. As such, it would be very nice (for me and others too i
guess) to be able to choose the location of this file at configuration time.

Would it really be a good idea? Knowing that ocaml libraries are not binary
compatible between version, keeping everything in the same place seems safer...

huh ?

I suppose you mean so you can install different versions of ocaml into
different directories and have all things work ok, with libraries in different
place.

I understand that moving ld.conf under /etc will not work well with that,
unless we have some /etc/ocaml/3.04/ld.conf scheme or something.

That said, it is not really a problem for debian, since only one version of
the debian package will ever be installed, and a personal installation would,
i guess, still install its stuff under $OCAMLLIB.

The other solution to comply with debian's policy (and maybe even the FHS or
FSSTD, or whatever it is called right now) would be to keep the ld.conf in
$OCAMLLIB and put a symlink into /etc or vice versa. I am not sure this is a
nicer solution.

It would be nice to have some script or little program that helps adding or
removing entries in this ld.conf file and i will be providing such a one in
my
debian packages next week, but to enable such a program or script to handle
multiple libraries using the same directory, it would be really nice to be
able to add a field at the end of the files in the ld.conf file, using it as
a
occurence counter or something such. Maybe this is already possible but i
have
not looked at it yet, will do the first week of january though.

No, currently you are only allowed a carriage return.

Yes, i have seen, but from my reading of the code, it would be almost trivial
to add it, unless some arch where ocaml runs supports path with embedded
spaces (on windows for example, i think this is the case), so a propper
comment separator would be needed.

By the way, the following two lines (from labltk) do the job. This works on all
the unixes I know.

if test grep -s -c '^$(LABLTKDIR)$$' $(LIBDIR)/ld.conf = 0;
then echo $(LABLTKDIR) >> $(LIBDIR)/ld.conf; fi

Will try it out,

Thanks for looking at this.

Friendly,

Sven Luther

@vicuna
Copy link
Author

vicuna commented Jan 11, 2002

Comment author: administrator

The debian policy mandates the location for files such as ld.conf in the /etc
directory structure. As such, it would be very nice (for me and others too i
guess) to be able to choose the location of this file at configuration time.

Right. In the meantime, it's always possible to move ld.conf after
installation to /etc, and put a symbolic link to it.

Also, since the current version of ocaml don't searches $OCAMLDIR and it's
subdirectories by default (contrary to what Xavier wrote to me in a mail, but
i may simply have misunderstood something)

Maybe I haven't been clear enough: the ld.conf file itself is looked up in
$OCAMLDIR, but there is no recursive traversal of $OCAMLDIR searching
for .so files.

, it is needed to fill this ld.conf
file accordyingly for each installed library.

Depends on your installation policy for libraries: e.g. you could decide
to have a single directory /usr/local/lib/ocaml/site-dlls where all
libs install their DLLs.

Generally speaking, the ld.conf mechanism is modeled exactly after the
/etc/ld.so.conf mechanism used by the Unix dynamic loader. Linux
distributions seem to have no problems with the latter; just follow
the same model for the former.

It would be nice to have some script or little program that helps
adding or removing entries in this ld.conf file and i will be
providing such a one in my debian packages next week, but to enable
such a program or script to handle multiple libraries using the same
directory, it would be really nice to be able to add a field at the
end of the files in the ld.conf file, using it as a occurence
counter or something such. Maybe this is already possible but i have
not looked at it yet, will do the first week of january though.
What do you think about this occurence counter stuff ? Is it a good
idea, or a totally wrong approach ?

One has to find a suitable syntax for ld.conf: lines of the form

aren't quite enough since can contain blanks...

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jan 11, 2002

Comment author: administrator

On Fri, Jan 11, 2002 at 02:15:33PM +0100, Xavier Leroy wrote:

The debian policy mandates the location for files such as ld.conf in the /etc
directory structure. As such, it would be very nice (for me and others too i
guess) to be able to choose the location of this file at configuration time.

Right. In the meantime, it's always possible to move ld.conf after
installation to /etc, and put a symbolic link to it.

Yes, but i have looked around a bit, it would be nice to have a -ldconf
configure option to specify were someone want to put it or even better yet,
the full name of the ld.conf file. I could even provide a small patch which
hopefully does something such.

Also, since the current version of ocaml don't searches $OCAMLDIR and it's
subdirectories by default (contrary to what Xavier wrote to me in a mail, but
i may simply have misunderstood something)

Maybe I haven't been clear enough: the ld.conf file itself is looked up in
$OCAMLDIR, but there is no recursive traversal of $OCAMLDIR searching
for .so files.

Well, from my experimentation, it seem that not even a non recursive traversal
of ]OCAMLDIR is done, (for files in $OCAMLDIR, not a subdir of it). But then,
i may be remembvering wrong, will test again.

, it is needed to fill this ld.conf
file accordyingly for each installed library.

Depends on your installation policy for libraries: e.g. you could decide
to have a single directory /usr/local/lib/ocaml/site-dlls where all
libs install their DLLs.

No, we put them as the current packages put them in $OCAMLDIR/package_name
mostly.

Generally speaking, the ld.conf mechanism is modeled exactly after the
/etc/ld.so.conf mechanism used by the Unix dynamic loader. Linux
distributions seem to have no problems with the latter; just follow
the same model for the former.

Yes, i guessed so.

It would be nice to have some script or little program that helps
adding or removing entries in this ld.conf file and i will be
providing such a one in my debian packages next week, but to enable
such a program or script to handle multiple libraries using the same
directory, it would be really nice to be able to add a field at the
end of the files in the ld.conf file, using it as a occurence
counter or something such. Maybe this is already possible but i have
not looked at it yet, will do the first week of january though.
What do you think about this occurence counter stuff ? Is it a good
idea, or a totally wrong approach ?

One has to find a suitable syntax for ld.conf: lines of the form

aren't quite enough since can contain blanks...

Yes, under windows they contain names, i don't think unix supports unescaped
blanks in paths.

That said, the best would be to choose a charactert to be used as comment
starting char, and to use it to add other kind of stuff. It needs to be a char
not supported in path names. Maybe # would be fine (as in shell scripts), but
then i don't know all the odd arches were ocaml runs and how they behave with
regard to chars valid for path names.

Another solution would be to maintain a ld.conf.count file, which would mirror
the ld.conf file, and add a count field, probably at the begining of each
line.

Friendly,

Sven Luther

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 7, 2002

Comment author: administrator

We finally agreed on putting Caml shared libs in one or two conventional
directories, and not in one directory per library. Thus, there should be no
need to change ld.conf on a regular basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant