Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69ee0b3522428a07ff1765446d631ecc7da6ae0f
Commit:     69ee0b3522428a07ff1765446d631ecc7da6ae0f
Parent:     b4f555081fdd27d13e6ff39d455d5aefae9d2c0c
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Sun Nov 4 19:00:46 2007 +0100
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Sun Nov 4 19:00:46 2007 +0100

    kbuild: do not pick up CFLAGS from the environment
    
    Too many people have CFLAGS set to support building userspace.
    And now Kbuild picks up CFLAGS this caused troubles.
    
    Although people should realise that setting CFLAGS has
    a 'global' effect the impact on the kernel build is a suprise.
    So change kbuild to pick up value from KCFLAGS that is
    much less used.
    
    When kbuild pick up a value it will warn like this:
    Makefile:544: "WARNING: Appending $KCFLAGS (-O3) from environment to kernel 
$CFLAGS"
    
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
    Cc: Thomas B├Ąchler <[EMAIL PROTECTED]>
    Cc: David Miller <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
---
 Makefile |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 188c3b6..cb740d4 100644
--- a/Makefile
+++ b/Makefile
@@ -528,9 +528,22 @@ KBUILD_CFLAGS += $(call 
cc-option,-Wdeclaration-after-statement,)
 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
-KBUILD_CPPFLAGS += $(CPPFLAGS)
-KBUILD_AFLAGS   += $(AFLAGS)
-KBUILD_CFLAGS   += $(CFLAGS)
+# But warn user when we do so
+warn-assign = \
+$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to 
kernel $$$(1)")
+
+ifneq ($(KCPPFLAGS),)
+        $(call warn-assign,CPPFLAGS)
+        KBUILD_CPPFLAGS += $(KCPPFLAGS)
+endif
+ifneq ($(KAFLAGS),)
+        $(call warn-assign,AFLAGS)
+        KBUILD_AFLAGS += $(KAFLAGS)
+endif
+ifneq ($(KCFLAGS),)
+        $(call warn-assign,CFLAGS)
+        KBUILD_CFLAGS += $(KCFLAGS)
+endif
 
 # Use --build-id when available.
 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to