autoconf
[Top][All Lists]
Advanced

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

Re: CFLAGS default values


From: Bob Friesenhahn
Subject: Re: CFLAGS default values
Date: Sun, 30 Nov 2003 09:56:56 -0600 (CST)

On Sun, 30 Nov 2003, Matze Braun wrote:

> > There's no universally-acceptable default.  Generally speaking, the
> > old UNIX tradition (namely, no debugging and no optimization) is less
> > suitable these days than the autoconf default (debugging and a
> > reasonable level of optimization).
> You're missing the point of my last mail. I agree that -g -O2 is a better
> default. But I don't think it's a good idea that autoconf enforces this
> default. The point here is usability:
>
> As a new user I don't expect autoconf to set CFLAGS in a macro whose main
> purpose is to detect the name of the compiler. Why is this macro more
> complicated than it could be? Why mess with such things as compiler
> defaults here?

Perhaps because different compilers accept different options.  If the
configure script supplies unsupported options, configure will fail
entirely.

> AC_PROG_CC
> CFLAGS=-O3 -g
> AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],
>     [build with debugging information (default NO)])],
>     [test "$enableval" = "yes" && CFLAGS="-O0 -g3"])

Apparently this configure script only works with one compiler.  Too
bad.  Hopefully it doesn't assume just one operating system as well.

> However if autoconf wouldn't set default, the example just wouldn't
> need the extra workaround, while the simple case would still be be easy to
> understand at the first place:
>
> AC_PROG_CC
> CFLAGS=-O2 -g

A configure script like this will go "poof" as soon as it is used with
a compiler that doesn't support -O2, or -O simultaneous with -g.

Bob
======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]