title: Checking environment variable in make through automake
body: <p>Is there a way to have a conditional passed through automake so it is passed on to the resulting Makefile.in and Makefile later on?</p>
  
  <p>I check whether JAVA_HOME is defined in the environment in a Makefile using</p>
  
  <pre><code>ifeq (undefined,$(origin JAVA_HOME))
  #CALL with defaults
  else
  #CALL according to the variable
  endif
  </code></pre>
  
  <p>But when I process this in a Makefile.am with automake I get two erros:</p>
  
  <pre><code>else without if
  endif without if
  </code></pre>
  
  <p>Looks like automake does not digest the ifeq. Is there a way to pass this through it (if it makes sense doing so), or is there another autotools-friendly way of getting the same result?</p>
  
  <p>The idea is also to allow setting/changing the variable just before running make to easily  target different JDKs.</p>