What you are looking for is called a module . You can tell Autotools to create a static binary (executable) by adding -all-static to the LDFLAGS application. I think this is the preferred way to use the --disable-shared setting flag (which is actually aimed at libraries, not the executable)
Something like this should work:
AM_CPPFLAGS=-I$(top_srcdir)/include lib_LTLIBRARIES = module.la module_la_LDFLAGS = -module -avoid-version -shared module_la_SOURCES = mm_cpp_logger.cpp bin_PROGRAMS = application application_LDFLAGS = -all-static application_SOURCES = main.cpp
The .so file (as usual) .libs/ subdirectory .libs/ (of course, if you do not install it).
And you can build your application and plugins at a time (even with one Makefile.am , so there is no need to call configure several times.
The use of -fPIC (and friends) should be automatically determined by Autotools.
Update : Here's a little trick to making shared libraries available where you expect them. Since all shlibs end in .libs/ , sometimes .libs/ have them in a non-hidden directory.
The following snippet of the makefile creates ancillary links (on platforms that support symbolic links; otherwise, they are copied). Just adding a snippet to your makefile (I usually use -include convenience-link.mk ) should be enough (you might need AC_PROG_LN_S in your configure.ac file)
.PHONY: convenience-link clean-convenience-link convenience-link: $(lib_LTLIBRARIES) @for soname in 'echo | $(EGREP) "^dlname=" $^ | $(SED) -e "s|^dlname='\(.*\)'|\1|"'; do \ echo "$$soname: creating convenience link from $(abs_builddir)/.libs to $(top_builddir)"; \ rm -f $(top_builddir)/$$soname ; \ test -e $(abs_builddir)/.libs/$$soname && \ cd $(top_builddir) && \ $(LN_S) $(abs_builddir)/.libs/$$soname $$soname || true;\ done clean-convenience-link: @for soname in 'echo | $(EGREP) "^dlname=" $(lib_LTLIBRARIES) | $(SED) -e "s|^dlname='\(.*\)'|\1|"'; do \ echo "$$soname: cleaning convenience links"; \ test -L $(top_builddir)/$$soname && rm -f $(top_builddir)/$$soname || true; \ done all-local:: convenience-link clean-local:: clean-convenience-link
umlΓ€ute
source share