On Wed, Mar 09, 2005 at 08:06:18PM +0100, Baurjan Ismagulov wrote:
> What I don't understand is why the manual states that AC_DEFINE_DIR does
> not conform with GNU codings standards.
>
> If I define DATADIR in CPPFLAGS, it is hard-coded into the binary, and
> the user can override the prefix during make install. This behaviour is
> not declared non-conforming.
If you set
CPPFLAGS="$CPPFLAGS -DDATADIR='\$(datadir)'"
or
CPPFLAGS="$CPPFLAGS "'-DDATADIR="$(datadir)"'
in your configure.ac, then the $(datadir) part is expanded by make.
So you can do
./configure --prefix=oneprefix
make prefix=anotherprefix
make prefix=yetanother install
Your config.h approach doesn't allow the user to redifine prefix for
"make all", even though it allows them to redefine it for "make install".
(Not that I know what is this requirment good for. I don't advocate the
standard, I just explain what conforms to it and what doesn't.)
Have a nice day,
Stepan