[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Per-target CXXFLAGS in the linker command
From: |
Ralf Wildenhues |
Subject: |
Re: Per-target CXXFLAGS in the linker command |
Date: |
Thu, 8 Jun 2006 11:19:15 +0200 |
User-agent: |
Mutt/1.5.11 |
Hi Eric,
* Eric PAIRE wrote on Thu, Jun 08, 2006 at 11:09:27AM CEST:
>
> Is there any reason why the CXXLINK macro embeds [AM_]CXXFLAGS &
> [AM_]LDFLAGS macros, and the actual per-target command line using
> CXXLINK does *not* embed <target>_CXXFLAGS, but only <target>_LDFLAGS ?
> I think that there is a coherency problem of the use of "global" and
> "per-target" CXXFLAGS & LDFLAGS macros.
Not completely sure, but I think this issue has been fixed in CVS
Automake. Quoting from NEWS:
- Per-target flags are now correctly handled in link rules.
For instance maude_CFLAGS correctly overrides AM_CFLAGS; likewise
for maude_LDFLAGS and AM_LDFLAGS. Previous versions bogusly
preferred AM_CFLAGS over maude_CFLAGS while linking, and they
used both AM_LDFLAGS and maude_LDFLAGS on the same link command.
The fix for compiler flags (i.e., using maude_CFLAGS instead of
AM_CFLAGS) should not hurt any package since that is how _CFLAGS
is expected to work (and actually works during compilation).
However using maude_LDFLAGS "instead of" AM_LDFLAGS rather than
"in addition to" breaks backward compatibility with older versions.
If your package used both variables, as in
AM_LDFLAGS = common flags
bin_PROGRAMS = a b c
a_LDFLAGS = more flags
...
and assumed *_LDFLAGS would sum up, you should rewrite it as
AM_LDFLAGS = common flags
bin_PROGRAMS = a b c
a_LDFLAGS = $(AM_LDFLAGS) more flags
...
This new behavior of *_LDFLAGS is more coherent with other
per-target variables, and the way *_LDFLAGS variables were
considered internally.
Cheers,
Ralf