diff --git a/BUILD b/BUILD index df78793ae..7240cf803 100644 --- a/BUILD +++ b/BUILD @@ -34,6 +34,10 @@ Example: scons ldflags="-L/foo -L/bar" behalf of the user will use doubles. By default, the code uses 128 integers. Example: scons high-precision-as-double=y +- inheritenv: set to 'y' if you want to make your compiler + execute within the same environment (env vars) as your own + shell. This is typically used to make colorgcc work. +Example: scons inheritenv=y 2) Targets ---------- @@ -136,7 +140,7 @@ core.add_inst_headers ('foo.h') # create a new module. First arg is the name of # the new module. Second arg is the directory in # which all source files for this module reside. -my_module = Ns3Module ('my', 'src/my_dir') +my_module = build.Ns3Module ('my', 'src/my_dir') # add it to build system ns3.add (my_module) # specify module dependencies. Here, depends diff --git a/build.py b/build.py index 461e5d8f9..cc509519a 100644 --- a/build.py +++ b/build.py @@ -299,7 +299,11 @@ class Ns3: outfile.write('#endif /*' + config_file_guard + '*/\n') config.Finish() def generate_dependencies(self): - env = Environment() + inheritenv = (ARGUMENTS.get('inheritenv', 'n') in 'yY1') + if inheritenv: + env = Environment(ENV=os.environ) + else: + env = Environment() self.gen_mod_config(env) cc = env['CC'] cxx = env.subst(env['CXX'])