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

Benjamin Lindley benjameslindley at gmail.com
Thu May 15 05:31:12 EDT 2014


That will probably help, if I can figure out one more thing. This is
more of a Python question though, so sorry if it's off topic (but maybe
there's a scons specific answer). I guess I need to figure out how (if
it's even possible) to change the default arguments to the Environment
constructor. So, for example, if the SConstruct file has this:

env = Environment()

I want it to be as if it says this:

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

Thanks for the help.


On 5/15/2014 3:12 AM, Björn Pollex wrote:

> 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 <mailto: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 <mailto:Scons-users at scons.org>

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

>

>

>

>

> _______________________________________________

> 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/7905f6e2/attachment.html


More information about the Scons-users mailing list