[En-Nut-Discussion] Can't correctly build NutOS 4.8.9 on Fedora 14 for Ethernut 2.1b

Harald Kipp harald.kipp at egnite.de
Sat Apr 16 16:04:11 CEST 2011

Hi Bernard,

On 4/15/2011 3:28 PM, Bernard Fouché wrote:

> My Linux avr-gcc version is based on WinAVR20100110 (used to get the
> correct set of patches but of course the binaries were made on Linux). I
> use the resulting compilation chain for months for other projects and it
> works nicely.

On Ubuntu I simply use
  sudo apt-get install gcc-avr
  sudo apt-get install avr-libc

> - if I enter the 'nut' symlink and then run 'nutconf', just define the
> platform type to 'avr-gcc', then trying to build NutOS result in:


> ../../nut/arch/avr/os/context_gcc.c:114:20: error: cfg/os.h: No such
> file or directory
> ../../nut/arch/avr/os/context_gcc.c:115:24: error: cfg/memory.h: No such
> file or directory
> ../../nut/arch/avr/os/context_gcc.c:119:22: error: sys/atom.h: No such
> file or directory
> ...etc...

Same problem here when using Nut/OS 4.8.9 with avr-gcc 4.3.4 and 
avr-libc 1.6.7. For some reason something is broken with relative paths.

Please try absolute paths

  Repository: /home/bernard/ethernut/nut/conf/repository.nut
  Source Directory: /home/bernard/ethernut/nut
  Platform: avr-gcc
  Build directory: /home/bernard/ethernut/nutbld
  Appl. Directory: /home/bernard/ethernut/nutapp
  Programmer: avr-dude

All other settings should be left empty.

> - the only way I found to be able to build NutOS is to NOT use the 'nut'
> symlink but to enter into 'ethernut-4.8.9' instead, and then running
> 'nutconf' without defining a platform (I just load the .conf file for
> Ethernut 2.1b). Then I have a successful build (well it compiles but I
> did not test the resulting lib) but:

Without defining a platform in the settings page 2? Probably not. The 
platform selection is used in the generated Makefiles of the build 
directory. The statement

  include $(top_srcdir)/Makedefs.<platform>

selects the right compiler settings by including the right Makedefs 
file, in your case

  include $(top_srcdir)/Makedefs.avr-gcc

The idea behind the symlink is, that we have the following directory 
structure on host systems:

  any-directory or home
    ethernut (install dir)
      nut (source dir)
      nutbld (first nutos build)
      nutapp (app build related to first nutos build)
      nutbld_n (more build dirs)
      nutapp_n (related apps)

With these settings you can use the Configurator defaults, only the 
platform and the programmer need to be selected. This user friendly 
should work on Linux, Windows and OS X, as long as the Configurator is 
started in the install directory.

Well, as we found out now, it currently doesn't work on Linux as 
expected. There had been several occurrences of this trouble on various 
platforms in the past. For this reason many users stick with absolute paths.

>       - Entering 'Edit/Settings', I get the settings form but can't exit
> it without clicking 'cancel': for instance 'Build/Source directory' is
> set to 'ethernut-4.8.9' and this value is refused when clicking on 'OK'.

Right. You entered /home/bernard/ethernut/ethernut-4.8.9 before starting 
the Configurator. So it is looking for

>       - when looking at the build directory made by 'nutconf', the
> missing header files like 'cfg/os.h' are not copied into it.

That's by design. The Configurator will not copy any source files into 
the build directory, but use the source tree. It may create files in 
nutbld/include/cfg, which will then replace the files in nut/include/cfg 
because the compiler first looks into the build tree. If the header file 
is found, it will use that one. If not, it will check the source tree.

> I welcome any hint to fix this problem since I'm stuck for hours on this
> one!

Sorry to hear that you wasted that much time. I'm sure that using 
absolute paths will fix it.



More information about the En-Nut-Discussion mailing list