localedir (was Re: [ds6-devel] 4 days to freeze)
Chris Leishman
chris at leishman.org
Sun Jan 12 21:15:19 CET 2003
On Saturday, January 11, 2003, at 07:15 PM, Mauro Tortonesi wrote:
> On Sat, 11 Jan 2003, Simone Piunno wrote:
>> hehe, I'm really close to it.
>> Now I'd need to use $datadir (generated by configure) inside main.c
>> Do you have a preferred way for this kind of variable passing?
>> Placeholder substitution?
>> -D on gcc command line?
>> config.h?
>
> absolutely config.h.
Actually, you can't do it in config.h. It's a common limitation, since
the directories are usually left defined as something like
"${prefix}/share". From the autoconf docs:
A corollary is that you should not use these variables but in
Makefiles. For instance, instead of trying to evaluate `datadir' in
`configure' and hardcoding it in Makefiles using e.g.
`AC_DEFINE_UNQUOTED(DATADIR, "$datadir")', you should add
`-DDATADIR="$(datadir)"' to your `CPPFLAGS'.
Regards,
Chris
More information about the ds6-devel
mailing list