1
votes

I have a little problem.

I source a script which changes my RedHat environment (PATH, LD_LIBRARY_PATH, etc.i).

When I launch my install with scons, it charges the default Environment from my machine, but not the current that I loaded...

I tried several attempts, but it was not conclusive. Most of the answer on the net are relative to a change on one variable which have to be set in the SConstruct.

How can I tell scons to charge the current Environment, but not the default ?

Thanks in advance !

2

2 Answers

1
votes

The SCons way would be to set these environment variables in your SConstruct/SConscripts so that every user would end up with a reproducible build environment.

Take a read of the FAQ for this: http://scons.org/faq.html#Why_doesn.27t_SCons_find_my_compiler.2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line.

SCons does not automatically propagate the external environment used to execute 'scons' to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked. This also means that if the compiler or other commands that you want to use to build your target files are not in standard system locations, SCons will not find them unless you explicitly set the PATH to include those locations.

1
votes

Already found the solution after some more search : env = Environment(ENV = os.environ)