[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: config variables in config.h
From: |
Alexandre Duret-Lutz |
Subject: |
Re: config variables in config.h |
Date: |
Thu, 05 Sep 2002 10:04:26 +0200 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) |
>>> "Viktor" == Viktor Pavlenko <address@hidden> writes:
[...]
Viktor> I tried the following in configure.in:
Viktor> AC_DEFINE_UNQUOTED(MYPROG_DATA_DIR,$datadir,[myprog data directory])
Viktor> but it doesn't work ($prefix/share is inserted and not expanded). I
Viktor> would appreciate it if someone could tell me how to do this properly.
Here is yet another different answer, so you can't say you
don't have the choice :)
I've stopped hard-coding absolute paths in my package because it
hinders relocation of binary packages.
Instead, at configure-time (not everybody will like this) I turn
each pathname into a path relative to $(prefix), and guess
$(prefix) at run-time.
See the following macros
http://ac-archive.sourceforge.net/Miscellaneous/relpath.html
http://ac-archive.sourceforge.net/Miscellaneous/normpath.html
and
http://ac-archive.sourceforge.net/Miscellaneous/stdrelpaths.html
for an example.
(Obviously there are situation wheres computing relative paths is not
always possible -- think A:\foo C:\bar -- but I can live with that.)
--
Alexandre Duret-Lutz
Re: config variables in config.h, Dan Kegel, 2002/09/05