Node: How the Linker is Chosen, Previous: Mixing Fortran 77 With C and C++, Up: Mixing Fortran 77 With C and C++



How the Linker is Chosen

The following diagram demonstrates under what conditions a particular linker is chosen by Automake.

For example, if Fortran 77, C and C++ source code were to be 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.

                          \              Linker
               source      \
                code        \     C        C++     Fortran
          -----------------  +---------+---------+---------+
                             |         |         |         |
          C                  |    x    |         |         |
                             |         |         |         |
                             +---------+---------+---------+
                             |         |         |         |
              C++            |         |    x    |         |
                             |         |         |         |
                             +---------+---------+---------+
                             |         |         |         |
                    Fortran  |         |         |    x    |
                             |         |         |         |
                             +---------+---------+---------+
                             |         |         |         |
          C + C++            |         |    x    |         |
                             |         |         |         |
                             +---------+---------+---------+
                             |         |         |         |
          C +       Fortran  |         |         |    x    |
                             |         |         |         |
                             +---------+---------+---------+
                             |         |         |         |
              C++ + Fortran  |         |    x    |         |
                             |         |         |         |
                             +---------+---------+---------+
                             |         |         |         |
          C + C++ + Fortran  |         |    x    |         |
                             |         |         |         |
                             +---------+---------+---------+