[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] proposed automake.texi patch for "How the Linker is Chosen"
From: |
Alexandre Duret-Lutz |
Subject: |
Re: [patch] proposed automake.texi patch for "How the Linker is Chosen" |
Date: |
Sun, 23 Jan 2005 23:19:18 +0100 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
>>> "Adrian" == Adrian Bunk <address@hidden> writes:
Adrian> Hi,
Adrian> IMHO the big diagram in "How the Linker is Chosen" of automake.texi is
Adrian> harder to understand than simply writing the rules behind.
I agree, and it is also out-of-date. I'm checking this in on
HEAD and branch-1-9.
2005-01-23 Alexandre Duret-Lutz <address@hidden>
* doc/automake.texi (How the Linker is Chosen): Explain how the
linker is chosen without diagram, and update to match the code.
Suggestion from Adrian Bunk.
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.44.2.34
diff -u -r1.44.2.34 automake.texi
--- doc/automake.texi 9 Jan 2005 12:07:03 -0000 1.44.2.34
+++ doc/automake.texi 23 Jan 2005 22:15:33 -0000
@@ -4305,50 +4305,45 @@
@cindex Automatic linker selection
@cindex Selecting the linker automatically
-The following diagram demonstrates under what conditions a particular
-linker is chosen by Automake.
+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.)
-For example, if Fortran 77, C and C++ source code were to be compiled
address@hidden
address@hidden
address@hidden GCJLINK
+Native Java (@code{GCJLINK})
address@hidden
address@hidden CXXLINK
+C++ (@code{CXXLINK})
address@hidden
address@hidden F77LINK
+Fortran 77 (@code{F77LINK})
address@hidden
address@hidden FCLINK
+Fortran (@code{FCLINK})
address@hidden
address@hidden OBJCLINK
+Objective C (@code{OBJCLINK})
address@hidden
address@hidden LINK
+C (@code{LINK})
address@hidden enumerate
+
+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
@code{_LDADD} or @code{_LIBADD} variable by the user writing the
@file{Makefile.am}.
address@hidden
- \ 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 | |
- | | | |
- +---------+---------+---------+
address@hidden example
+Automake only looks at the filenames listed in @file{_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. @xref{Libtool Convenience Libraries}, for a
+trick with @address@hidden
+
@node Fortran 9x Support
@comment node-name, next, previous, up
--
Alexandre Duret-Lutz