This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to include $(CFLAGS) into specflags


Hello, Alexandre!

> > As I already wrote, the current implementation of per-executable flags
> > doesn't include $(CFLAGS) in the command line.
> 
> AFAICT, this is intentional, so that you can actually *replace* a
> generic CFLAGS with a program-specific one.  If you want to *add*, you 
> have to use:
> 
> prog_CFLAGS = $(CFLAGS) -prog-specific-flags

I'm affraid, I cannot agree with you.

The point of using prog_CFLAGS is different. The point is that a program
or a library is linked from object files compiled in turn with the given
flags. This involves using the "compile" script and more complicated names
for the object files.

Let's consider where discarding of CFLAGS could be useful. In most cases
CFLAGS contains flags affecting optimization level and debug information.
If you really want to discard them, you must be compiling some very
fragile assembler constructs, like those in Kaffe. However, even if you
discard CFLAGS, you should not think that all the optimization is
impossible. Optimization flags may be in $CC, or the compiler may be
unable to compile in the way how you want that it does.

In this case, it is better to have a precompiled assembler file in the
distribution, so that only developers and very brave users will rebuild
it. You could also check that e.g. __GNUC__ is defined and __OPTIMIZE__ is
not, so that the risk is minimal.

Anyway, this applies to per-object rather than to per-program files.

If the user specify CFLAGS, [s]he expects that every compiler invocation
is affected. If you are very suspicious about curly hands, use "sed" and
stop if you find a dangerous option.

> > The attached patch simplifies the rules used for compilation of
> > executable-specific objects.

Tom has applied another patch, but I'm content with it.

> Because we really want to remove CFLAGS, we can't use COMPILE and
> LTCOMPILE.  IMO, this is unfortunate, but I don't think we can get
> around this :-(

Why do you want to remove CFLAGS?

Pavel Roskin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]