<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Wed, 2011-12-07 at 21:10 -0800, Alan Coopersmith wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 12/07/11 10:39, Gaetan Nadon wrote:
> DATADIR, like any installation variable, is not known at configure time.
> This is by design to allow setting the variable at make time.
> The AX_DEFINE_DIR macro worked around this design and consequently
> cancelled an Automake feature.
>
> The alternative method suggested by Automake ends up being simpler
> while providing the same result as AX_DEFINE_DIR but without cancelling
> any feature. It is used in the xserver for the parser and in xquartz.
>
> The AX_DEFINE_DIR macro has been removed from the Autoconf Archive.
> There are no official providers for this macro anymore.
Before automake 1.11 doing this would have contributed a lot of noise to
the build logs, but silent mode should cover this.
</PRE>
</BLOCKQUOTE>
Many -Ds would be noisy and could overflow command limits in some cases.
<BLOCKQUOTE TYPE=CITE>
<PRE>
For simple cases like this it seems okay - in cases where we were
exporting the definition in a .h file a more complex solution may
be required.
</PRE>
</BLOCKQUOTE>
There is another Automake proposed alternative:<BR>
<BLOCKQUOTE>
Alternatively, create a dedicated header file:
<PRE>
DISTCLEANFILES = myprog-paths.h
myprog-paths.h: Makefile
echo '#define DATADIR "$(datadir)"' >$@
</PRE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
One nit/question, should it be CPPFLAGS instead of CFLAGS?
</PRE>
</BLOCKQUOTE>
See patch v2<BR>
<BR>
Thanks.<BR>
<BR>
</BODY>
</HTML>