GNU bug report logs - #61278
improve diagnostics for LDFLAGS used on static archives

Previous Next

Package: automake;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Sat, 4 Feb 2023 18:28:02 UTC

Severity: minor

To reply to this bug, email your comments to 61278 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#61278; Package automake. (Sat, 04 Feb 2023 18:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Sat, 04 Feb 2023 18:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-automake <bug-automake <at> gnu.org>
Subject: Automake warns about LDFLAGS for defined library
Date: Sat, 4 Feb 2023 18:27:40 +0000
[Message part 1 (text/plain, inline)]
Using automake 1.16.5, in my Makefile.am, I have the following lines:

noinst_LTLIBRARIES = liba2ps.la
liba2ps_la_LDFLAGS = $(LIBGC_LIBS)
liba2ps_la_SOURCES = $(liba2pssources) $(libitsources) $(mylibitsources)
liba2ps_la_LIBADD = ../lib/libgnu.la $(LIBINTL) $(LIBSOCKET)
$(GETHOSTNAME_LIB)

noinst_LIBRARIES = libnowarnings.a
libnowarnings_a_CFLAGS = $(LIBGC_FLAGS)
libnowarnings_a_LDFLAGS = $(LIBGC_LIBS)
libnowarnings_a_SOURCES = fonts.l lexppd.l parseppd.y regex.c regex.h
confg.c confg.h

(This is from GNU a2ps <https://savannah.gnu.org/projects/a2ps>'s
liba2ps/Makefile.am.)

When automake is run, it warns:

liba2ps/Makefile.am:63: warning: variable 'libnowarnings_a_LDFLAGS' is
defined but no program or
liba2ps/Makefile.am:63: library has 'libnowarnings_a' as canonical name
(possible typo)

I don't understand this, because libnowarnings.a is defined as the
canonical name of a library.

In src/Makfile.am, I have the following lines:

noinst_LIBRARIES = libparse.a
libparse_a_SOURCES = parsessh.y lexssh.l lexps.l sheets-map.l
libparse_a_CFLAGS = $(LIBGC_FLAGS)

and I get no warnings. I have no LTLIBRARIES in this Makefile.am.

If in the first Makefile.am I change the convenience library
"libnowarnings.a" to a libtool library "libnowarnings.la", and add it to
noinst_LTLIBRARIES, and rename the other variables accordingly, then again
I get no warnings.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#61278; Package automake. (Sun, 05 Feb 2023 06:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 61278 <at> debbugs.gnu.org (full text, mbox):

From: Nick Bowler <nbowler <at> draconx.ca>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 61278 <at> debbugs.gnu.org
Subject: Re: bug#61278: Automake warns about LDFLAGS for defined library
Date: Sun, 5 Feb 2023 01:09:07 -0500
On 2023-02-04, Reuben Thomas via Bug reports for Automake
<bug-automake <at> gnu.org> wrote:
> When automake is run, it warns:
>
> liba2ps/Makefile.am:63: warning: variable 'libnowarnings_a_LDFLAGS' is
> defined but no program or
> liba2ps/Makefile.am:63: library has 'libnowarnings_a' as canonical name
> (possible typo)
>
> I don't understand this, because libnowarnings.a is defined as the
> canonical name of a library.

Indeed, this message does not seem very accurate.

What Automake is trying to tell you is that LDFLAGS is meaningless
on a static library.  This message could definitely be improved!

> If in the first Makefile.am I change the convenience library
> "libnowarnings.a" to a libtool library "libnowarnings.la", and add it
> to noinst_LTLIBRARIES, and rename the other variables accordingly,
> then again I get no warnings.

Unlike with a static library, LDFLAGS is used with libtool libraries, so
it is good that there is no warning.

Cheers,
  Nick




Information forwarded to bug-automake <at> gnu.org:
bug#61278; Package automake. (Sun, 05 Feb 2023 06:39:01 GMT) Full text and rfc822 format available.

Message #11 received at 61278 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Nick Bowler <nbowler <at> draconx.ca>
Cc: 61278 <at> debbugs.gnu.org
Subject: Re: bug#61278: Automake warns about LDFLAGS for defined library
Date: Sun, 5 Feb 2023 06:37:52 +0000
[Message part 1 (text/plain, inline)]
On Sun, 5 Feb 2023 at 06:09, Nick Bowler <nbowler <at> draconx.ca> wrote:

>
> What Automake is trying to tell you is that LDFLAGS is meaningless
> on a static library.  This message could definitely be improved!
>

Of course, thanks! I was confused because  in another Makefile.am that had
only a static library I did not get this message, but I did not set LDFLAGS
there.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Changed bug title to 'improve diagnostics for LDFLAGS used on static archives' from 'Automake warns about LDFLAGS for defined library' Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Sun, 03 Dec 2023 03:56:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Sun, 03 Dec 2023 03:56:02 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.