From: Vadim A. <vad...@ya...> - 2005-02-14 05:22:21
|
> > ACK. AFAICS, other parts of patch are already covered, except for adding > arch/um/include/sysdep to search path. Why do we need that? Files in > there get included as <sysdep/blah.h>, not <blah.h>, so... > > I didn't add arch/um/include/sysdep to search path. I agree that it useless. The only difference in include pass betwenn Al's patch and the mine (Dima) is the fpllowing: Al> ARCH_INCLUDE := -I$(ARCH_DIR)/include Al> +ifneq ($(KBUILD_SRC),) Al> +ARCH_INCLUDE += -I$(ARCH_DIR)/include2 Al> +ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include Al> +MRPROPER_DIRS += $(ARCH_DIR)/include2 Al> +endif Dima> include $(MAKEFILES-INCL) Dima> endif Dima> -ARCH_INCLUDE := -I$(ARCH_DIR)/include Dima> +ARCH_INCLUDE := -I$(ARCH_DIR)/include \ Dima> + $(if $(KBUILD_SRC), -I$(objtree)/$(ARCH_DIR)/include2) Dima> + Dima> SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) Actually: - It's preferable to give an absolute path to include2: it exist only in the build tree. Adding it as a relative path you ask Kbuild to add an absolute path to srctree as well. - we don't need an explicit path to -I$(srctree)/$(ARCH_DIR)/include: Kbuild will do it for us from '-I$(ARCH_DIR)/include'. You certainly added it because of USER_OBJS. To deal with this issue I added -I$(srctree)/$(ARCH_DIR)/include specifically to USER_CFLAGS: Dima> USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) Dima> -USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ Dima> - $(MODE_INCLUDE) $(ARCH_USER_CFLAGS) Dima> +USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) Dima> +# If building the kernel in a separate tree we need to add this path manually. Dima> +# Note, that for CFLAGS it's done in the generic 'scripts/Makefile.lib' Dima> +USER_CFLAGS += $(if $(KBUILD_SRC), -I$(srctree)/$(ARCH_DIR)/include) Dima> +USER_CFLAGS += $(ARCH_INCLUDE) $(MODE_INCLUDE) $(ARCH_USER_CFLAGS) Dima> + Dima |