title: How can I compile with shared library if I use Autotools
body: <p>I have two C programs named <code>drive.c</code> and <code>mylib.c</code>.</p>
  
  <p><code>drive.c</code> is main module <code>mylib.c</code> is sub modulle that I want work as shared library .</p>
  
  <p>I can compile them with following step and run.</p>
  
  <pre><code>gcc –fPIC –g –c –Wall mylib.c 
  
  gcc -shared -Wl,-soname,libmylib.so.1 -o /c/opt/lib/libmylib.so.1.0.1 mylib.o -lc
  
  gcc -g -Wall -Wextra -pedantic  -I./ -L/c/opt/lib -o drive.exe drive.c –l:libmylib.so.1
  </code></pre>
  
  <p>Now I want know is How can I compile them by <code>autotools</code> as same effect of above way ?</p>
  
  <p>What and how do I have to edit <code>configure.ac</code> and <code>Makefile.am</code> for compile them?</p>