[Scons-users] Setting environment variables for scons to use globally on my system

Björn Pollex bjoern.pollex at googlemail.com
Thu May 15 04:12:33 EDT 2014


Benjamin,

you could put the system-specific setup into a global site_init.py.
According to the man-page[1], on Windows, SCons will look in the following
locations by default:

%ALLUSERSPROFILE/Application Data/scons/site_scons
%USERPROFILE%/Local Settings/Application Data/scons/site_scons
%APPDATA%/scons/site_scons
%HOME%/.scons/site_scons
./site_scons

If, in any of these locations, it finds a site_init.py, that will be
executed. Does that help you?

Regards,

Björn

[1] http://scons.org/doc/production/HTML/scons-man.html


On Thu, May 15, 2014 at 10:06 AM, Benjamin Lindley <
benjameslindley at gmail.com> wrote:


> Is there any way to set environment variables for my system which scons

> will use, without me having to change the SConstruct file? For example, I

> would like to use MinGW instead of VC++ for my C++ builds on Windows. I

> can, of course, do this in my SConstruct file:

>

> env = Environment(tools = ['mingw'])

>

> But if I do that, then I'm editing things into my build files that make it

> specific to my particular system configuration. That defeats the whole

> purpose of a portable build system, in my opinion. If I upload that as part

> of my repository for others to build, they may not be using MinGW. They may

> want to use VC++, or Clang, and I don't think they should have to modify

> the build file (or anything else in the repository for that matter) in

> order to build the program or library. Ideally, anyone with in an

> environment with a functional C++ toolchain and scons installed *should*be able to just type

> scons on the command line, and things should go smoothly for them. Isn't

> that the (or a) goal of scons? Or am I misunderstanding its purpose?

>

> Another thing is paths. The above line is not even enough, I have to still

> import the path to the MinGW binaries. I've read the justification for

> this. But it's just more system specific information which I have to put in

> my build files, which may be used by others where the chosen paths are not

> applicable.

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140515/d63d4cff/attachment-0001.htm


More information about the Scons-users mailing list