Subject: bug#34925: closed ()

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 23 Feb 2021 22:32:02 +0000

Your bug report

#34925: Overwriting target_LDFLAGS within conditionals

which was filed against the automake package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
34925: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34925
GNU Bug Tracking System
Contact [email-masked] with problems

From: Karl Berry <[email-masked]>
To: [email-masked]
Date: Tue, 23 Feb 2021 15:31:25 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Subject: Overwriting target_LDFLAGS within conditionals
From: Дилян Палаузов<[email-masked]>
To: [email-masked]
Date: Wed, 20 Mar 2019 17:26:08 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

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@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
  Дилян