automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/N] LIBTOOLFLAGS, and *_LINK fixes for Automake 1.11


From: Ralf Wildenhues
Subject: Re: [PATCH 2/N] LIBTOOLFLAGS, and *_LINK fixes for Automake 1.11
Date: Sun, 11 Oct 2009 13:48:34 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

<http://thread.gmane.org/gmane.comp.gcc.patches/191228/focus=20062>

* Ralf Wildenhues wrote on Thu, Sep 03, 2009 at 10:01:17PM CEST:
> * Dave Korn wrote on Fri, Aug 28, 2009 at 03:55:29PM CEST:
> > > Automake handling of per-target LDFLAGS rules changed which means
> > > that if you override *_LINK manually, you have to ensure that they
> > > are used, too.
> 
> Unfortunately, (out of necessity) it changed much more than I figured it
> did, and the NEWS entry that I quoted described, and the Automake manual
> that document *LINK variables don't reflect reality fully any more
> either.  We need to address this upstream.

Done with the patch below, Automake master and branch-1.11; adding Dave
to THANKS.

> Anyway, the gist is the following:
> 
>   As soon as <target>_LDFLAGS or <target>_LIBTOOLFLAGS are used now,
>   automake will generate a <target>_LINK variable which is used to link.
>   This <target>_LINK variable will however not reference $(LINK) or
>   $(CXXLINK) any more.
> 
> So in some cases our overriding of LINK, CXXLINK was not sufficient.

Cheers,
Ralf

    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.

diff --git a/doc/automake.texi b/doc/automake.texi
index cfed344..884caa3 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -5651,14 +5651,20 @@ Program and Library Variables
 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
address@hidden; 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
address@hidden@@}:
 
 @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
address@hidden, @code{_LDFLAGS} or @code{_LIBTOOLFLAGS}, in cases where
+they apply.
+
 @item maude_CCASFLAGS
 @itemx maude_CFLAGS
 @itemx maude_CPPFLAGS
@@ -6022,7 +6028,9 @@ Program Variables
 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
 
 
@@ -6574,6 +6582,10 @@ How the Linker is Chosen
 more appropriately.  @xref{Libtool Convenience Libraries}, for a
 trick with @address@hidden
 
+A per-target @code{_LINK} variable will override the above selection.
+Per-target link flags will cause Automake to write a per-target
address@hidden variable according to the language chosen as above.
+
 
 @node Fortran 9x Support
 @comment  node-name,  next,  previous,  up




reply via email to

[Prev in Thread] Current Thread [Next in Thread]