automake: How the Linker is Chosen
1
1 8.14.3.1 How the Linker is Chosen
1 .................................
1
1 When a program or library mixes several languages, Automake choose the
1 linker according to the following priorities. (The names in parentheses
1 are the variables containing the link command.)
1
1 1. Native Java (‘GCJLINK’)
1 2. Objective C++ (‘OBJCXXLINK’)
1 3. C++ (‘CXXLINK’)
1 4. Fortran 77 (‘F77LINK’)
1 5. Fortran (‘FCLINK’)
1 6. Objective C (‘OBJCLINK’)
1 7. Unified Parallel C (‘UPCLINK’)
1 8. C (‘LINK’)
1
1 For example, if Fortran 77, C and C++ source code is compiled into a
1 program, then the C++ linker will be used. In this case, if the C or
1 Fortran 77 linkers required any special libraries that weren’t included
1 by the C++ linker, then they must be manually added to an ‘_LDADD’ or
1 ‘_LIBADD’ variable by the user writing the ‘Makefile.am’.
1
1 Automake only looks at the file names listed in ‘_SOURCES’ variables
1 to choose the linker, and defaults to the C linker. Sometimes this is
1 inconvenient because you are linking against a library written in
1 another language and would like to set the linker more appropriately.
1 ⇒Libtool Convenience Libraries, for a trick with
1 ‘nodist_EXTRA_..._SOURCES’.
1
1 A per-target ‘_LINK’ variable will override the above selection.
1 Per-target link flags will cause Automake to write a per-target ‘_LINK’
1 variable according to the language chosen as above.
1