From c540f91d8950f170fa8c0f0b91de6f1505e12118 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 1 Dec 2020 22:42:17 +0100 Subject: Document better where to put -m32 or -m64 compiler options. * doc/autoconf.texi (Preset Output Variables): Clarify that options -m32 or -m64 must go into CC, not CFLAGS and not CPPFLAGS either. This is needed because on bi-arch platforms, config.guess runs $CC without $CFLAGS nor $CPPFLAGS. --- doc/autoconf.texi | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 9ba182af..d0865c1e 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -2605,9 +2605,18 @@ instead. If it affects only the linker (e.g., @option{-L@var{directory}}), it should be put into @code{LDFLAGS} instead. If it affects only the compiler proper, @code{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 -@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}. +matters get tricky: + +@itemize @bullet +@item +If an option selects a 32-bit or 64-bit build on a bi-arch system, it +must be put direcly into @code{CC}, e.g., @code{CC='gcc -m64'}. This is +necessary for @code{config.guess} to work right. +@item +Otherwise one approach is to put the option into @code{CC}. Another is +to put it into both @code{CPPFLAGS} and @code{LDFLAGS}, but not into +@code{CFLAGS}. +@end itemize However, remember that some @file{Makefile} variables are reserved by the GNU Coding Standards for the use of the ``user''---the person -- cgit v1.2.1