
Hi Wolfgang,
I have been facing an issue while building u-boot for AT91SAM9263ek board. The environment I am using is CYGWIN and toolchain is the Code sourcery toolchain.
The make configuration step works fine while "make CROSS_COMPILE " step throws the following error:
make CROSS_COMPILE=arm-none-linux-gnueabi-
Generating include/autoconf.mk
include/common.h:37: fatal error: config.h: No such file or directory
compilation terminated.
Generating include/autoconf.mk.dep
include/common.h:37: fatal error: config.h: No such file or directory
compilation terminated.
make: *** [include/autoconf.mk.dep] Error 1
While going through the files in u-boot I made the following observations:
The config.mk available in the TOPDIR of the u-boot folder has the following variable definition:
gccincdir := $(shell $(CC) -print-file-name=include)
CPPFLAGS += -I$(TOPDIR)/include
CPPFLAGS += -fno-builtin -ffreestanding -nostdinc \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
Where $(TOPDIR)/include = /u-boot-2010.09-rc2/include
(AND)
$(gccincdir) = is the cross compiler's include library, which in my case is, c:/cygwin/home/e458110/linuxproj/tools/bin/../lib/gcc/arm-none-linux-gnu eabi/4.4.1/include
From what I can understand from this, the -I flag makes the u-boot
/INCLUDE directory to be the first in list to search for header files while preprocessing and -isystem flag asks the compiler to consider the cross compiler's as the system directory or search for system headers.
Now I went make to common.h file which is throwing the error given above and observed that config.h is defined in angle brackets:
i.e. #include <config.h>
So what I feel is happening here is that the compiler only searches its own include directory for headers since the files are in < > brackets. When I copy all the files in the uboot /include directory to the compiler's include the build process starts while fails at some point since some autogenerated header files are created in the u-boot/include by default and needs to be moved to the compiler's include each time proceed.
I could go about changing the #include <config.h> to #include "config.h" but this is going to be very tedious and time consuming as the entire u-boot code needs to be changed for this.
I tried various combinations of gcc flags for the variable CPPFLAGS, all failed for reasons which I was able to trace back.
Has this condition been observed before and is there any work around for it? Also, please correct me if my understanding is wrong. I am at crucial point in my project would be delighted to have support at the earliest.
Regards,
Shyama