title: BASH/SH/ .. AutoConf: Wrapping string comparison
body: <p>I am modifying a configure.ac for use with AutoConf: <a href="http://mathpad.wikidot.com/acousto-configure-ac" rel="nofollow">http://mathpad.wikidot.com/acousto-configure-ac</a></p>
  
  <p>The script points out that it needs to run on darwin, solaris, cygwin and linux.</p>
  
  <p>I assume this is why it uses an arcane method of comparing strings:</p>
  
  <pre><code>foo="1"
  if test "x$foo" != "x0"; then
  </code></pre>
  
  <p>This double negative makes it difficult to read through the code. Can I clean it up?</p>
  
  <p>How might I implement a string comparison macro:</p>
  
  <pre><code>if STR_EQUAL( $foo, "1" ); then
  </code></pre>
  
  <p>Or:  </p>
  
  <pre><code>if TRUE( $foo ); then
  </code></pre>
  
  <p>And this is the best way of solving the problem?</p>
  
  <p>EDIT: apparently this script is written in M4 <a href="http://www.gnu.org/software/m4/manual/m4.html" rel="nofollow">http://www.gnu.org/software/m4/manual/m4.html</a></p>