title: How to create a shared library (.so) in an automake script?
body: <p>Given some source file test.cpp I would like to create a shared library libtest.so .  I am trying to do this within the scope of an automake file however I cannot seem to get this to work.</p>
  <p>For example under g++ I do the following:</p>
  <pre><code>g++ -shared -fPIC test.cpp -o libtest.so
  </code></pre>
  <p>Then I can create another file that will depend on the shared library as follows:</p>
  <pre><code>g++ mytest.cpp libtest.so -o blah
  </code></pre>
  <hr />
  <p>I have read that automake only supports making shared libraries via libtool.  I have tried to get my automake script to work as follows but it never seems to produce an .so .  The closest I have gotten is for it to produce an .la and .o file:</p>
  <p>In configure.ac:</p>
  <pre><code>AC_ENABLE_SHARED
  AC_DISABLE_STATIC
  AC_PROG_LIBTOOL(libtool)
  </code></pre>
  <p>in Makefile.am</p>
  <pre><code>lib_LTLIBRARIES=libtest.la
  libtest_la_SOURCES=test.cpp
  libtest_la_CFLAGS=-fPIC
  libtest_la_CPPFLAGS=-fPIC
  libtest_la_CXXFLAGS=-fPIC
  libtest_la_LDFLAGS= -shared -fPIC
  </code></pre>
  <hr />
  <p>Could someone give me an example of building an .so based on the above?</p>