From bf9349266bd3c4d80b27d7668fc03869df404924 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 3 Feb 2009 09:15:54 -0700 Subject: [PATCH] Mention that packagers should not pre-set CFLAGS. * doc/autoconf.texi (Preset Output Variables) : Copy advice given by automake on handling variables reserved by GNU Coding Standards. Reported by Karl Berry. Signed-off-by: Eric Blake --- ChangeLog | 6 ++++++ doc/autoconf.texi | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7ae64b948..3d1cea4d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-02-03 Eric Blake + Mention that packagers should not pre-set CFLAGS. + * doc/autoconf.texi (Preset Output Variables) : Copy + advice given by automake on handling variables reserved by GNU + Coding Standards. + Reported by Karl Berry. + Document lib64 in config.site. * doc/autoconf.texi (Site Defaults): Fix typo in FHS sample file. Mention use of lib64. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 4e487df00..a8cf779f9 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -2351,6 +2351,22 @@ matters get tricky. One approach to put such options directly into @code{CC}, e.g., @code{CC='gcc -m64'}. Another is to put them into both @code{CPPFLAGS} and @code{LDFLAGS}, but not into @code{CFLAGS}. +However, remember that some @file{Makefile} variables are reserved by +the GNU Coding Standards for the use of the ``user''---the person +building the package. For instance, @code{CFLAGS} is one such variable. + +Sometimes package developers are tempted to set user variables such as +@code{CFLAGS} because it appears to make their job easier. However, the +package itself should never set a user variable, particularly not to +include switches that are required for proper compilation of the +package. Since these variables are documented as being for the package +builder, that person rightfully expects to be able to override any of +these variables at build time. If the package developer needs to add +switches without interfering with the user, the proper way to do that is +to introduce an additional variable. Automake makes this easy by +introducing @code{AM_CFLAGS} (@pxref{Flag Variables Ordering, , , +automake, @acronym{GNU} Automake}), but the concept is the same even if +Automake is not used. @end defvar @defvar configure_input -- 2.47.3