[Top][All Lists]

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

CFLAGS is for the user in GNU

From: Karl Berry
Subject: CFLAGS is for the user in GNU
Date: Sun, 1 Feb 2009 18:12:13 -0600

The description of CFLAGS in the Autoconf manual omits the most
important point about it.  To quote the coding standards

    If there are C compiler options that @emph{must} be used for proper
    compilation of certain files, do not include them in @code{CFLAGS}.
    Users expect to be able to specify @code{CFLAGS} freely themselves.

I would write a patch for it, but I'm not sure if there is a variable to
suggest for such required options for the C compiler proper these days.
Maybe it never comes up in practice?


(autoconf)Preset Output Variables:
 -- Variable: CFLAGS
     Debugging and optimization options for the C compiler.  If it is
     not set in the environment when `configure' runs, the default
     value is set when you call `AC_PROG_CC' (or empty if you don't).
     `configure' uses this variable when compiling or linking programs
     to test for C features.

     If a compiler option affects only the behavior of the preprocessor
     (e.g., `-D NAME'), it should be put into `CPPFLAGS' instead.  If
     it affects only the linker (e.g., `-L DIRECTORY'), it should be
     put into `LDFLAGS' instead.  If it affects only the compiler
     proper, `CFLAGS' is the natural home for it.  If an option affects
     multiple phases of the compiler, though, matters get tricky.  One
     approach to put such options directly into `CC', e.g., `CC='gcc
     -m64''.  Another is to put them into both `CPPFLAGS' and
     `LDFLAGS', but not into `CFLAGS'.

reply via email to

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