Re: Proposal: an addition to glib for getting the absolute path of the current binary.
- From: Xavier Bestel <xavier bestel free fr>
- To: Sven Neumann <sven gimp org>
- Cc: gtk-devel-list gnome org
- Subject: Re: Proposal: an addition to glib for getting the absolute path of the current binary.
- Date: Tue, 13 Apr 2004 15:48:01 +0200
On Tue, 2004-04-13 at 14:34 +0200, Sven Neumann wrote:
> Hi,
>
> I am not convinced that locating the binary file does solve the
> problem of locating the data and configuration files. Is there a
> reliable way to determine these directories when the path of the
> executable is known? I don't think so. The software might have been
> compiled with --datadir set to something completely unrelated. Same
> goes for configuration files. It's common practise to call configure
> with --sysconfdir=/etc. How is your proposal for relocatable packages
> going to deal with this?
That would be exactely the point of a glib function:
- under Unix, return the path set at configure time.
- under Windows, compute the path relative to the install path.
That assumes that Unix packages aren't relocatable.
Now, maybe Solaris relocatable packages need a special configure flag to
indicate that datadir (etc.) are relative to the installation path. I
haven't looked at it in detail, but maybe it's possible to use ld.so's
$ORIGIN to find something else than libraries.
Xav
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]