[Scons-users] Mixing configuration and nodes

Paweł Tomulik ptomulik at meil.pw.edu.pl
Thu Oct 8 12:32:46 EDT 2015


W dniu 08.10.2015 o 17:48, Ludovic Courtès pisze:
> Hello,
> 
> I’m trying to achieve the following: My software project has a
> dependency D; if D is present on the system then use it, otherwise
> download it and build it.
> 
> In addition, I want to check whether an optional header of D is
> available or not, using ‘CheckCXXHeader’.  This check must be performed
> either on the system’s D, or on the just-downloaded D.
> 
> I implemented the download-and-build-D part using nodes, via
> ‘env.Command’.
> 
> However, my understanding is that configuration necessarily happens
> _before_ nodes are considered.  Ideally, I would like to make the check
> for D’s header happen _after_ the download-and-build-D nodes have
> completed, but that does not seem to be feasible.
> 
> Any suggestions?
> 
> Thanks in advance,
> Ludovic.


Hello,

except there is a reason to use scons for downloads, I'd rather suggest
to provide a bash or python script that downloads D. The scripts should
be independent of the SConscript and should be run once by user
(manually) before the build. It should download D to a known predefined
place in the project tree. Documentation (README) should mention that D
might be downloaded by running the script. Finally, SConstruct should
define clear policy which version of D (system-wide or local) is
preferred when both are present. SCons configuration may just check for
D and if it's absent print a message instructing user to run the
download script.


Regards!
-- 
Pawel Tomulik


More information about the Scons-users mailing list