When a program or library mixes several languages, Automake choose the linker according to the following priorities. (The names in parentheses are the variables containing the link command.)
GCJLINK
)
OBJCXXLINK
)
CXXLINK
)
F77LINK
)
FCLINK
)
OBJCLINK
)
UPCLINK
)
LINK
)
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
_LDADD
or _LIBADD
variable by the user writing the
Makefile.am.
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
trick with nodist_EXTRA_..._SOURCES
.
A per-target _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.