From f3b4702d409996fe7437a1815adda9782be7e4bf Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 11 Oct 2009 13:44:37 +0200 Subject: [PATCH] Improve description of the various *LINK variables. * doc/automake.texi (Program and Library Variables): _LINK also receives libraries to link against. _LINK may be generated. (Program Variables): Document reasons when per-target _LINK is used instead of LINK. (How the Linker is Chosen): Document how a per-target _LINK variable and per-target link flags override linker selection. * THANKS: Update. Report by Dave Korn against gcc/libstdc++-v3. Signed-off-by: Ralf Wildenhues --- ChangeLog | 10 ++++++++++ THANKS | 1 + doc/automake.texi | 20 ++++++++++++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d3a261a4..a00523bd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2009-10-11 Ralf Wildenhues + Improve description of the various *LINK variables. + * doc/automake.texi (Program and Library Variables): _LINK also + receives libraries to link against. _LINK may be generated. + (Program Variables): Document reasons when per-target _LINK is + used instead of LINK. + (How the Linker is Chosen): Document how a per-target _LINK + variable and per-target link flags override linker selection. + * THANKS: Update. + Report by Dave Korn against gcc/libstdc++-v3. + Allow variable override of, rather than by, silent variables. When overriding variables, check the VAR_SILENT status of the old condition, not the new one: we allow non-silent overrides diff --git a/THANKS b/THANKS index 7b8664a23..5789e95ea 100644 --- a/THANKS +++ b/THANKS @@ -65,6 +65,7 @@ Daniel Jacobowitz drow@false.org Daniel Kahn Gillmor dkg@fifthhorseman.net Daniel Richard G. danielg@teragram.com Dave Brolley brolley@redhat.com +Dave Korn dave.korn.cygwin@googlemail.com Dave Morrison dave@bnl.gov David A. Swierczek swiercze@mr.med.ge.com David Byron dbyron@dbyron.com diff --git a/doc/automake.texi b/doc/automake.texi index f6633d8d8..fbfe362e7 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -5612,14 +5612,20 @@ You can override the linker on a per-program basis. By default the linker is chosen according to the languages used by the program. For instance, a program that includes C++ source code would use the C++ compiler to link. The @code{_LINK} variable must hold the name of a -command that can be passed all the @file{.o} file names as arguments. -Note that the name of the underlying program is @emph{not} passed to -@code{_LINK}; typically one uses @samp{$@@}: +command that can be passed all the @file{.o} file names and libraries +to link against as arguments. Note that the name of the underlying +program is @emph{not} passed to @code{_LINK}; typically one uses +@samp{$@@}: @example maude_LINK = $(CCLD) -magic -o $@@ @end example +If a @code{_LINK} variable is not supplied, it may still be generated +and used by Automake due to the use of per-target link flags such as +@code{_CFLAGS}, @code{_LDFLAGS} or @code{_LIBTOOLFLAGS}, in cases where +they apply. + @item maude_CCASFLAGS @itemx maude_CFLAGS @itemx maude_CPPFLAGS @@ -5981,7 +5987,9 @@ preference to the per-executable (or per-library) @code{_LDFLAGS}. This is the command used to actually link a C program. It already includes @samp{-o $@@} and the usual variable references (for instance, @code{CFLAGS}); it takes as ``arguments'' the names of the object files -and libraries to link in. +and libraries to link in. This variable is not used when the linker is +overridden with a per-target @code{_LINK} variable or per-target flags +cause Automake to define such a @code{_LINK} variable. @end vtable @@ -6496,6 +6504,10 @@ 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}. +A per-target @code{_LINK} variable will override the above selection. +Per-target link flags will cause Automake to write a per-target +@code{_LINK} variable according to the language chosen as above. + @node Fortran 9x Support @comment node-name, next, previous, up -- 2.47.2