When a program or library mixes several languages, Automake chooses the linker according to the following priorities. (The names in parentheses are the variables containing the link command.)
For example, if Fortran 77, C and C++ source code is compiled
into a program, then the C++ linker will be used. In this case, if the
C or Fortran 77 linkers required any special libraries that weren’t
included by the C++ linker, then they must be manually added to an
_LIBADD variable by the user writing the
Automake only looks at the file names listed in _SOURCES
variables to choose the linker, and defaults to the C linker.
Sometimes this is inconvenient because you are linking against a
library written in another language and would like to set the linker
more appropriately. See Libtool Convenience Libraries, for a
_LINK variable will override the above selection.
Per-target link flags will cause Automake to write a per-target
_LINK variable according to the language chosen as above.