Re: Setting optimizations without violating autotools principles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Thu, 7/7/11, Ralf Wildenhues <Ralf.Wildenhues@xxxxxx> wrote:
> From: Ralf Wildenhues <Ralf.Wildenhues@xxxxxx>
> # 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
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux