Out of tree builds with waf?

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Nov 5 18:02:44 UTC 2020

On 05/11/2020 18:27, Sebastian Huber wrote:

> On 05/11/2020 18:22, Sebastian Huber wrote:
>> On 05/11/2020 18:16, Andrew Butterfield wrote:
>>>  I'm not a waf expert, but might this section in their book help?
>>> https://waf.io/book/#_fundamental_waf_commands 
>>> <https://waf.io/book/#_fundamental_waf_commands>
>>> Can variables `top` and `out` in the example there be manipulated to 
>>> do want you want?
>> Yes, the --top and --out options works somehow, but I get a warning 
>> like this:
>> Waf: Entering directory 
>> `/home/EB/sebastian_h/src/rtems-source-builder/tmp/build/sparc/erc32'
>> CWD /home/EB/sebastian_h/src/rtems-source-builder/tmp is not under 
>> /home/EB/sebastian_h/src/rtems, forcing --targets=* (run distclean?)
>> Also the documentation says "Though Waf may be called from any folder 
>> containing a /wscript/ file,", so I am not sure if this is really 
>> supported what I am doing.
> What works is something like this:
> ./waf configure --out $PWD/tmp/xxx/build
> called from the source tree. However, this has some side-effects.
> 1. A .waf* directory is created in the source tree (this is an issue 
> with a read-only source tree).
> 2. Waf somehow remembers this configuration. You can call "./waf" to 
> build it. So, there must be some hidden state in the source tree. This 
> is not really an out of tree build. You cannot have multiple 
> independent build trees.

This happens if I use a read-only source tree:

~/tmp/out-of-tree > pwd
~/tmp/out-of-tree > ~/src/rtems/waf --top $HOME/src/rtems-read-only 
--out $PWD/build configure --rtems-config $PWD/config.ini
Setting top to                           : 
Setting out to                           : 
Configure board support package (BSP)    : sparc/erc32
Checking for program 'sparc-rtems6-gcc'  : 
Checking for program 'sparc-rtems6-g++'  : 
Checking for program 'sparc-rtems6-ar'   : /opt/rtems/6/bin/sparc-rtems6-ar
Checking for program 'sparc-rtems6-ld'   : /opt/rtems/6/bin/sparc-rtems6-ld
Checking for program 'ar'                : /opt/rtems/6/bin/sparc-rtems6-ar
Checking for program 'g++, c++'          : 
Checking for program 'ar'                : /opt/rtems/6/bin/sparc-rtems6-ar
Checking for program 'gas, gcc'          : 
Checking for program 'ar'                : /opt/rtems/6/bin/sparc-rtems6-ar
Checking for program 'gcc, cc'           : 
Checking for program 'ar'                : /opt/rtems/6/bin/sparc-rtems6-ar
Checking for asm flags '-MMD'            : yes
Checking for c flags '-MMD'              : yes
Checking for cxx flags '-MMD'            : yes
Traceback (most recent call last):
line 119, in waf_entry_point
line 182, in run_commands
line 173, in run_command
line 101, in execute
line 146, in store
line 160, in writef
     with open(fname,m)as f:
IOError: [Errno 13] Permission denied: 

embedded brains GmbH
Sebastian HUBER
Dornierstr. 4
82178 Puchheim
email: sebastian.huber at embedded-brains.de
Phone: +49-89-18 94 741 - 16
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

embedded brains GmbH
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/

More information about the devel mailing list