From: Alexandre Duret-Lutz Date: Sun, 23 Jan 2005 22:19:36 +0000 (+0000) Subject: * doc/automake.texi (How the Linker is Chosen): Explain how the X-Git-Tag: Release-1-9b~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5aee628ce4efea4153d343dba6ae25bc4b743b7;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index ce2f539bb..bdeb90fa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-23 Alexandre Duret-Lutz + + * 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. + 2005-01-16 Alexandre Duret-Lutz * lib/am/subdirs.am ($(RECURSIVE_TARGETS), $(RECURSIVE_CLEAN_TARGETS)): diff --git a/doc/automake.texi b/doc/automake.texi index 764f76734..09f008b44 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -4482,50 +4482,45 @@ Automake would have issued a warning. @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 +@enumerate +@item +@vindex GCJLINK +Native Java (@code{GCJLINK}) +@item +@vindex CXXLINK +C++ (@code{CXXLINK}) +@item +@vindex F77LINK +Fortran 77 (@code{F77LINK}) +@item +@vindex FCLINK +Fortran (@code{FCLINK}) +@item +@vindex OBJCLINK +Objective C (@code{OBJCLINK}) +@item +@vindex LINK +C (@code{LINK}) +@end 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}. -@example - \ 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 | | - | | | | - +---------+---------+---------+ -@end 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 @code{nodist_EXTRA_@dots{}_SOURCES}. + @node Fortran 9x Support @comment node-name, next, previous, up diff --git a/doc/stamp-vti b/doc/stamp-vti index 484a7adab..0e5329811 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 9 January 2005 +@set UPDATED 23 January 2005 @set UPDATED-MONTH January 2005 @set EDITION 1.9a @set VERSION 1.9a diff --git a/doc/version.texi b/doc/version.texi index 484a7adab..0e5329811 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 9 January 2005 +@set UPDATED 23 January 2005 @set UPDATED-MONTH January 2005 @set EDITION 1.9a @set VERSION 1.9a