GNU bug report logs -
#34925
Overwriting target_LDFLAGS within conditionals
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34925 in the body.
You can then email your comments to 34925 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-automake <at> gnu.org
:
bug#34925
; Package
automake
.
(Wed, 20 Mar 2019 17:32:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Дилян Палаузов <dilyan.palauzov <at> aegee.org>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Wed, 20 Mar 2019 17:32:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
my reading of the automake manual is that for an AM_CONDITIONAL Z
AM_LDFLAGS = -flto
if Z
a_LDFLAGS = -O3
endif
means:
if Z is defined, a_LDFLAGS is used and AM_LDFLAGS are not used.
if Z is not defined, a_LDFLAGS is absent and AM_LDFLAGS are used.
But looking in Makefile.in the code looks like this:
@Z_TRUE <at> a_LDFLAGS = -O3
a_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(a_LDFLAGS) $(LDFLAGS) -o $@
which means, that AM_LDFLAGS is always ignored.
The manual says in “Program and Library Variables”:
‘maude_LDFLAGS’
This variable is used to pass extra flags to the link step of a
program or a shared library. It overrides the ‘AM_LDFLAGS’
variable.
Regards
Дилян
Information forwarded
to
bug-automake <at> gnu.org
:
bug#34925
; Package
automake
.
(Tue, 23 Feb 2021 02:25:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 34925 <at> debbugs.gnu.org (full text, mbox):
Hi - replying to this automake bug report from almost two years ago
(sorry) (https://bugs.gnu.org/34925):
AM_LDFLAGS = -flto
if Z
a_LDFLAGS = -O3
endif
...
AM_LDFLAGS is always ignored.
I agree that in the case above it's surprising for AM_LDFLAGS not to be
used. But I worry about changing Automake's behavior at this late date.
The whole question of which ldflags are used is something that different
projects might have carefully tuned to the current behavior for their
needs, and thus newly "inheriting" the AM_LDFLAGS value would cause
unnecessary problems. For the case above, presumably an else clause
defining a_LDFLAGS would yield the desired result.
So instead of changing the code, I merely changed the manual to warn
about this.
Thanks for the report. --best, karl.
diff --git a/doc/automake.texi b/doc/automake.texi
index 5f70e37..8f5a9fc 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -5839,7 +5839,11 @@ of any library built by your package. Doing so will ensure that
@item maude_LDFLAGS
This variable is used to pass extra flags to the link step of a program
-or a shared library. It overrides the @code{AM_LDFLAGS} variable.
+or a shared library. It overrides the @code{AM_LDFLAGS} variable,
+even if it is defined only in a false branch of a conditional; in
+other words, if @code{@var{prog}_LDFLAGS} is defined at all,
+@code{AM_LDFLAGS} will not be used.
+@c https://bugs.gnu.org/34925
@item maude_LIBTOOLFLAGS
This variable is used to pass extra options to @command{libtool}.
compile finished at Mon Feb 22 18:19:56 2021
Reply sent
to
Karl Berry <karl <at> freefriends.org>
:
You have taken responsibility.
(Tue, 23 Feb 2021 22:32:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Дилян Палаузов <dilyan.palauzov <at> aegee.org>
:
bug acknowledged by developer.
(Tue, 23 Feb 2021 22:32:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 34925-done <at> debbugs.gnu.org (full text, mbox):
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 24 Mar 2021 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 33 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.