title: Running autotools in Windows (MinGW)
body: <p>I am trying to build the <a href="http://shapelib.maptools.org/" rel="nofollow noreferrer">shapelib</a> from <a href="http://download.osgeo.org/shapelib/shapelib-1.4.1.zip" rel="nofollow noreferrer">source</a> on Windows. The library uses autotools. I have MinGW installed with the appropriate packages. When I run</p>
  
  <pre><code>C:\MinGW\msys\1.0\bin\sh autogen.sh
  </code></pre>
  
  <p>it outputs</p>
  
  <pre><code>autogen.sh: line 4: readlink: command not found
  autogen.sh: line 4: dirname: command not found
  **Error**: Directory `' does not look like the top-level package directory
  </code></pre>
  
  <p>I don't expect readlink to work with Windows so I just skipped right to</p>
  
  <pre><code>C:\MinGW\msys\1.0\bin\sh configure
  </code></pre>
  
  <p>However, that also throws errors</p>
  
  <pre><code>configure: line 478: sed: command not found
  configure: line 477: expr: command not found
  configure: line 478: sed: command not found
  configure: line 492: sed: command not found
  : error: cannot create .lineno; rerun with a POSIX shell
  </code></pre>
  
  <p>Is there any hope of getting this to compile on windows? Am I missing something obvious? I double checked and the sed package is installed.</p>
  
  <p><a href="https://i.stack.imgur.com/wyyDR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wyyDR.png" alt="enter image description here"></a></p>