<p>On Sep 17, 2011 9:54 AM, &quot;Chase Douglas&quot; &lt;<a href="mailto:chase.douglas@canonical.com">chase.douglas@canonical.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On 09/17/2011 06:53 AM, Gaetan Nadon wrote:<br>
&gt; &gt; On Sat, 2011-09-17 at 06:52 +1000, Peter Hutterer wrote:<br>
&gt; &gt;&gt; On Wed, Sep 14, 2011 at 10:33:56PM -0700, Chase Douglas wrote:<br>
&gt; &gt;&gt; &gt; Signed-off-by: Chase Douglas &lt;<a href="mailto:chase.douglas@canonical.com">chase.douglas@canonical.com</a> &lt;mailto:<a href="mailto:chase.douglas@canonical.com">chase.douglas@canonical.com</a>&gt;&gt;<br>

&gt; &gt;&gt; &gt; ---<br>
&gt; &gt;&gt; &gt;  <a href="http://configure.ac">configure.ac</a> |    3 +++<br>
&gt; &gt;&gt; &gt;  1 files changed, 3 insertions(+), 0 deletions(-)<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; diff --git a/<a href="http://configure.ac">configure.ac</a> b/<a href="http://configure.ac">configure.ac</a><br>
&gt; &gt;&gt; &gt; index 6c2f731..f3d6d8e 100644<br>
&gt; &gt;&gt; &gt; --- a/<a href="http://configure.ac">configure.ac</a><br>
&gt; &gt;&gt; &gt; +++ b/<a href="http://configure.ac">configure.ac</a><br>
&gt; &gt;&gt; &gt; @@ -39,6 +39,9 @@ if ! test &quot;x$UNSTABLE_LIB&quot; = xyes; then<br>
&gt; &gt;&gt; &gt;      AC_MSG_ERROR([This branch contains elements which have not yet been finalised.  When this branch is updated, you will probably need to recompile both the any clients using the library, and may experience crashes or undefined behaviour if you do not.])<br>

&gt; &gt;&gt; &gt;  fi<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; +# Define macros for compiling with unstable protocols<br>
&gt; &gt;&gt; &gt; +AC_SUBST(CFLAGS, &quot;-DXINPUT2_1_USE_UNSTABLE_PROTOCOL -DXINPUT2_2_USE_UNSTABLE_PROTOCOL&quot;)<br>
&gt; &gt; CFLAGS is a user environment and should never be set in <a href="http://configure.ac">configure.ac</a>. In<br>
&gt; &gt; some case it is, for a configure test, but restored to the original<br>
&gt; &gt; value. Refer to Automake documentation for a complete discussion on env<br>
&gt; &gt; variable usage.<br>
&gt;<br>
&gt; A couple points:<br>
&gt;<br>
&gt; * This is only temporary while the protocol is under development. It<br>
&gt; will not be part of any official libXi release.<br>
&gt;<br>
&gt; * When I have used AC_SUBST before, it has only appended flags to the<br>
&gt; CFLAGS env var. This is exactly what we want.</p>
<p>I suggest just using AC_DEFINE for macros. Then it doesn&#39;t toy with environment variables and the setting is stored in a file (config.h) for you. This will break with &quot;make CFLAGS=-O&quot; or anything like that. Carl Worth has said some words on this before, but I&#39;m on my phone right now.</p>

<p>--<br>
Dan</p>