[U-Boot] Regarding the config.mk in U-boot TOP directory

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

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
$(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

On Thursday, December 30, 2010 6:51 PM, Asokan, Shyama Trikkadeeri wrote:
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:
[...]
I had similar issues some time back but the build environment was not Cygwin.
I was working on adding support for a board on one GIT branch and after building an image (without a distclean) shifted to another branch which didn't have the board support added.
Compiling u-boot for a different board on the second branch threw up errors like you mentioned. Even distclean didn't help. This was probably due to the auto-generated files depending on a board config which wasn't in the branch I was working on.
I was able to finally get things working by manually deleting include/config.h, include/config.mk, include/autoconf.mk and include/autoconf.mk.dep
A couple of more instances where I got the errors was when during the course of development directory structure/config filename had to be changed but remnants of a build with old directory structure/config file were present. Again manually deleting the files mentioned above got things working.
Deleting the files manually may not be correct way of fixing this issue but I thought it might help if you are stuck.
Regards, Vaibhav

Thanks Vaibhav! I will check this out. Regards, Shyama.
-----Original Message----- From: Bedia, Vaibhav [mailto:vaibhav.bedia@ti.com] Sent: Friday, December 31, 2010 9:43 AM To: Asokan, Shyama Trikkadeeri; U-Boot@lists.denx.de Subject: RE: [U-Boot] Regarding the config.mk in U-boot TOP directory
On Thursday, December 30, 2010 6:51 PM, Asokan, Shyama Trikkadeeri wrote:
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:
[...]
I had similar issues some time back but the build environment was not Cygwin.
I was working on adding support for a board on one GIT branch and after building an image (without a distclean) shifted to another branch which didn't have the board support added.
Compiling u-boot for a different board on the second branch threw up errors like you mentioned. Even distclean didn't help. This was probably due to the auto-generated files depending on a board config which wasn't in the branch I was working on.
I was able to finally get things working by manually deleting include/config.h, include/config.mk, include/autoconf.mk and include/autoconf.mk.dep
A couple of more instances where I got the errors was when during the course of development directory structure/config filename had to be changed but remnants of a build with old directory structure/config file were present. Again manually deleting the files mentioned above got things working.
Deleting the files manually may not be correct way of fixing this issue but I thought it might help if you are stuck.
Regards, Vaibhav
participants (2)
-
Asokan, Shyama Trikkadeeri
-
Bedia, Vaibhav