Re: [PATCH] fix include paths when the kernel source and build directory are different

Jan Kiszka
2009-06-08T09:04:43Z

Avi Kivity wrote:
> James Pike wrote:
>> Use correct architecture includes when kernel source and build directory
>> are different.
>> Signed-off-by: James Pike <james@chilon.net>
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -27,8 +27,9 @@ all:: prerequisite
>> # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
>> $(MAKE) -C $(KERNELDIR) M=`pwd` \
>> LINUXINCLUDE="-I`pwd`/include -Iinclude \
>> - $(if $(KERNELSOURCEDIR),-Iinclude2
>> -I$(KERNELSOURCEDIR)/include) \
>> - -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
>> + $(if $(KERNELSOURCEDIR),\
>> + -Iinclude2 -I$(KERNELSOURCEDIR)/include
>> -I$(KERNELSOURCEDIR)/arch/${ARCH_DIR}/include, \
>> + -Iarch/${ARCH_DIR}/include) -I`pwd`/include-compat \
>> -include include/linux/autoconf.h \
>> -include `pwd`/$(ARCH_DIR)/external-module-compat.h
>> $(module_defines)" \
>> "$$@"
>>
>
> This removes -Iarch/${ARCH_DIR}/include when KERNELSOURCEDIR is not
> defined. What is the reason for this change?
>

As far as I can see (I do wear my glasses today...),
-Iarch/${ARCH_DIR}/include is present in the else part of $(if).

The reason for this change is the missing arch include from the source
directory in case it's separate from the build dir (yeah, the changelog
has room for improvements).

I ran into the same issue after building and installing a recent kernel
tree with O=. The split trees SUSE leaves behind do not suffer from
this, but they also still work after the change. Same for classic
unified trees.

Jan

--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux