GNU bug report logs - #9855
CFLAGS per source

Previous Next

Package: automake;

Reported by: NightStrike <nightstrike <at> gmail.com>

Date: Mon, 24 Oct 2011 03:20:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: NightStrike <nightstrike <at> gmail.com>
To: 9855 <at> debbugs.gnu.org
Subject: bug#9855: CFLAGS per source
Date: Sun, 23 Oct 2011 23:17:39 -0400
When using automake, I know how to set *FLAGS globally (ie,
AM_*FLAGS), and per binary/lib (ie bin_PROGRAMS=foo ; foo_*FLAGS =
...)  However, those flag variables apply to every source file for a
given primary.  What if I have multiple sources that are compiled
differently?

bin_PROGRAMS = a
a_SOURCES = x.c y.c

I want x.c compiled with -Option1 and y.c compiled with -Option2.

Section 27.8 of the manual, "Per-Object Flags Emulation", describes a
way to accomplish this using libraries, but is that really the ideal
solution?  It seems like a very hacky solution compared to supporting
some syntax for, say, x_c_CFLAGS variables (or something that works
with sources used multiple times.. perhaps a_x_c_CFLAGS), as in my
example above.  That would be much cleaner, I would think, compared to
requiring the user to create and link against useless intermediate
libraries.

Can this be considered for automake 1.12?

Also, has anyone verified that there really is no difference between
adding additional .o's to the link and .a's containing those .o's?
For instance, how does this interact with LTO (link time
optimization)?




This bug report was last modified 13 years and 294 days ago.

Previous Next


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