Re: finding datadir from executable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 11 Sep 2004, Daniel Jacobowitz wrote:
That, unfortunately, is too convoluted to figure out without real study.
Without a clear example, I simply find the full, real path of the executable
and presume that the standard ../share/${program}/ is correct.  Probably
an illuminating example would make life easier.....  :-)

If a GPL'd solution is OK, I recommend libiberty. I moved GCC's make_relative_prefix into libiberty some time ago because I kept needing this functionality elsewhere.

You give it argv[0], BINDIR, and OTHERDIR; it computes the relative
path between bindir and otherdir, finds your application in $PATH or
similar, and works out the likely location of otherdir.

Similar code is currently embedded in libtool in order to support wrappers for executables under Cygwin. The code should be portable.


Bob
======================================
Bob Friesenhahn
bfriesen@xxxxxxxxxxxxxxxxxxx
http://www.simplesystems.org/users/bfriesen


_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux