lkml.org 
[lkml]   [2004]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] kbuild: Unmangle include options for gcc
When utilising the make O=... option the include options for gcc were 
mangled even when absolute paths was used.
Also remove duplication of CPPFLAGS. They were assigned twice.
[It is still possible for architectures to modify CPPFLAGS].

This patch allows xconfig to be build with make O=... xconfig.It will also help development of external modules with absolute paths for their -I options.

Note: As a side effect a full recompile of the kernel takes place due to
changes in number of gcc options.

Sam

===== Makefile 1.446 vs edited =====
--- 1.446/Makefile Fri Jan 9 07:57:28 2004
+++ edited/Makefile Tue Jan 13 22:13:00 2004
@@ -404,10 +404,6 @@

include $(srctree)/arch/$(ARCH)/Makefile

-# Let architecture Makefiles change CPPFLAGS if needed
-CFLAGS := $(CPPFLAGS) $(CFLAGS)
-AFLAGS := $(CPPFLAGS) $(AFLAGS)
-
core-y += kernel/ mm/ fs/ ipc/ security/ crypto/

SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
===== scripts/Makefile.lib 1.22 vs edited =====
--- 1.22/scripts/Makefile.lib Sat Sep 20 21:03:00 2003
+++ edited/scripts/Makefile.lib Fri Jan 16 23:46:27 2004
@@ -144,8 +144,7 @@


# If building the kernel in a separate objtree expand all occurrences
-# of -Idir to -Idir -I$(srctree)/dir.
-# hereby allowing gcc to locate files in both trees. Local tree first.
+# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').

ifeq ($(KBUILD_SRC),)
__c_flags = $(_c_flags)
@@ -154,15 +153,16 @@
__hostcxx_flags = $(_hostcxx_flags)
else
flags = $(foreach o,$($(1)),\
- $(if $(filter -I%,$(o)),$(patsubst -I%,-I$(srctree)/%,$(o)),$(o)))
+ $(if $(filter -I%,$(filter-out -I/%,$(o))), \
+ $(patsubst -I%,-I$(srctree)/%,$(o)),$(o)))

-# -I$(obj) locate generated .h files
-# -I$(srctree)/$(src) locate .h files in srctree, from generated .c files
-# FIXME: Replace both with specific EXTRA_CFLAGS statements
+# -I$(obj) locates generated .h files
+# -I$(srctree)/$(src) locates .h files in srctree, from generated .c files
+# FIXME: Replace both with specific EXTRA_CFLAGS statements in the makefiles
__c_flags = -I$(obj) -I$(srctree)/$(src) $(call flags,_c_flags)
__a_flags = $(call flags,_a_flags)
__hostc_flags = -I$(obj) $(call flags,_hostc_flags)
-__hostcxx_flags = $(call flags,_hostcxx_flags)
+__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags)
endif

c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.029 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site