[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Per-library CFLAGS to appear after user-defined CFLAGS
From: |
Daniel Drake |
Subject: |
Per-library CFLAGS to appear after user-defined CFLAGS |
Date: |
Fri, 15 Sep 2006 15:19:34 -0400 |
Hi,
I'd like to force a compiler flag on a certain library in my Makefile.am
and ensure that the user cannot override it's behaviour. I want to do
something like:
mylib_la_CFLAGS = -O0
to disable optimization.
However, automake puts mylib_la_CFLAGS *before* the user-defined CFLAGS
so it ends up using:
-O0 -some-user-flag -O2 -other-user-flags
and this isn't what I want, since my flag is overridden.
To get around this, I am forced to do:
override CFLAGS := `echo @CFLAGS@ | sed 's/-O[0-9]//g'`
mylib_la_CFLAGS = -O0
(and then if I want any other libraries in the same Makefile.am
optimized I must explicitly set an optimization level for each one..)
Is there a nicer way?
Thanks,
Daniel
- Per-library CFLAGS to appear after user-defined CFLAGS,
Daniel Drake <=