title: m4 - executing a shell command
body: <p>I'm new to m4 and am trying to set up a macro which allows the user to specify the location of a library at configure-time <code>./configure --with-mylib=/path/to/lib.so</code>.</p>
  
  <p>In the m4 macro using <code>AC_ARG_WITH</code>, I'll check that the given file actually exists, and then store the path to said lib. <code>MYLIB_PATH=esyscmd([dirname $withval])</code>. This produces the error: <pre>dirname: missing operand</pre></p>
  
  <p>The shell doesn't seem to know about <code>$withval</code>. How do I get it through to execute this command?</p>
  
  <p>Thanks,</p>
  
  <p>Andrew</p>