> From: Viktor Pavlenko <[EMAIL PROTECTED]> > Date: Wed, 4 Sep 2002 20:39:48 -0400 > > I would like my program to know where it has been installed, in > particular, the location of $datadir. Looks like a natural way to do > it is to have a #define in config.h, like this: > > /* > * myprog data directory > */ > #define MYPROG_DATA_DIR "/usr/local/share/myprog" > > I tried the following in configure.in: > > AC_DEFINE_UNQUOTED(MYPROG_DATA_DIR,$datadir,[myprog data directory]) > > but it doesn't work ($prefix/share is inserted and not expanded). I > would appreciate it if someone could tell me how to do this properly.
What I do for this situation is to put something like this in my Makefile.am: DISTCLEANFILES = localedir.h localedir.h: Makefile echo '#define LOCALEDIR "$(localedir)"' >$@ and then include "localedir.h" separately as needed. Admittedly this is a bit awkward, but it does the job.