--- On Thu, 7/7/11, Ralf Wildenhues <[email protected]> wrote:
> From: Ralf Wildenhues <[email protected]>
> # Override CFLAGS if not set by the user.
> test ${CFLAGS+set} = set || CFLAGS=-O0
Ralf,
Thank you. I believe your method does not work when the user has set CFLAGS to
something that has nothing to do with optimizations (e.g. CFLAGS=-I/foo/bar).
Would you please comment on the solution I came up with:
In configure.ac:
CFLAGS_ORIG=${CFLAGS}
AC_PROG_CC
CFLAGS=${CFLAGS_ORIG}
In Makefile.am:
if DEBUG
AM_CFLAGS = -g3 -O0
endif
I believe my approach
1. Allows the user full control via the sacred CFLAGS
2. Does not touch, mutate, or alter the user's sacred CFLAGS
3. Works despite AC_PROG_CC mucking around with CFLAGS
4. Works even when the user specifies CFLAGS that do not change the
optimization level
Thank you all for your help,
Chris
_______________________________________________
Autoconf mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/autoconf