The solution is to not specify; use libtool. Look at
info libtool, which should also have some info in
info automake. libtool will determine the "best type" of library to use based on the system because some systems don't use dynamic linking. Here's an example from one of my projects:
Code:
STANDARD_INCLUDES=-I/usr/include -I/usr/local/include
ALL_INCLUDES=$(STANDARD_INCLUDES) -I$(srcdir)/../.. -I$(srcdir)/../../include/rservr -I$(srcdir)/../../include -I$(srcdir)/../include
AM_CPPFLAGS=-DENABLE_VIRT_ARRAY_ALL $(ALL_INCLUDES)
AM_CXXFLAGS=-ansi -Wall
AM_CFLAGS=-Wall
STANDARD_LIBS=-L/lib -L/usr/lib -L/usr/local/lib
AM_LDFLAGS=--version-info 1:1:0 $(STANDARD_LIBS)
lib_LTLIBRARIES=librservr-filter.la
librservr_filter_la_SOURCES=filter-main.c api-filter.c api-filter.h
librservr_filter_la_LIBADD=
The .la files are just text files used by libtool at link time. You shouldn't ever have to deal with real extensions.
ta0kira
PS You use the .la file when linking within Makefile.am, e.g. if the library above needed to link to libdependency.(so|a) you would add libdependency.la to *_LIBADD, using a path prefix if it's part of the same project and therefore isn't installed yet. libtool will always give you a static library at installation time and a shared library if possible and if not disabled; therefore, normal linking can still be done with -l outside of automake (or within it, but that would be nonstandard.)
This might be a better example:
Code:
STANDARD_INCLUDES=-I/usr/include -I/usr/local/include
ALL_INCLUDES=$(STANDARD_INCLUDES) -I$(srcdir)/../.. -I$(srcdir)/../../include/rservr -I$(srcdir)/../../include -I$(srcdir)/../include
AM_CPPFLAGS=-DENABLE_VIRT_ARRAY_ALL -DRSERVR_RESTRICT_COMMAND_INTERFACE $(ALL_INCLUDES)
AM_CXXFLAGS=-ansi -Wall
AM_CFLAGS=-Wall
STANDARD_LIBS=-L/lib -L/usr/lib -L/usr/local/lib
AM_LDFLAGS=--version-info 1:1:0 $(STANDARD_LIBS)
lib_LTLIBRARIES=librsvp-rqsrvc.la librsvp-rqsrvc-auto.la
librsvp_rqsrvc_la_SOURCES=api-rqsrvc.cpp plugin-rqsrvc.cpp api-rqsrvc.h plugin-rqsrvc.hpp
librsvp_rqsrvc_la_LIBADD=../../libs/command/librservr-command.la
librsvp_rqsrvc_auto_la_SOURCES=rqsrvc-auto.cpp
librsvp_rqsrvc_auto_la_LIBADD=librsvp-rqsrvc.la ../../libs/client/librservr-client.la