2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00

allow CCFLAGS to be passed on command line or through construction variable; default is now '-O2 -g'

This commit is contained in:
Jim Bosch
2012-04-17 10:00:36 -04:00
parent 1d3a535e53
commit d61d41a786
2 changed files with 9 additions and 4 deletions

View File

@@ -176,9 +176,12 @@ def setupOptions():
metavar="DIR", help="location of Boost libraries")
AddOption("--rpath", dest="custom_rpath", type="string", action="append",
help="runtime link paths to add to libraries and executables; may be passed more than once")
variables = Variables()
variables.Add("CCFLAGS", default=os.environ.get("CCFLAGS", "-O2 -g"), help="compiler flags")
return variables
def makeEnvironment():
env = Environment()
def makeEnvironment(variables):
env = Environment(variables=variables)
if os.environ.has_key("PATH"):
env["ENV"]["PATH"] = os.environ["PATH"]
if os.environ.has_key("LD_LIBRARY_PATH"):
@@ -187,6 +190,8 @@ def makeEnvironment():
env["ENV"]["DYLD_LIBRARY_PATH"] = os.environ["DYLD_LIBRARY_PATH"]
if os.environ.has_key("PYTHONPATH"):
env["ENV"]["PYTHONPATH"] = os.environ["PYTHONPATH"]
if os.environ.has_key("CCFLAGS"):
env.AppendUnique(CCFLAGS = os.environ["CCFLAGS"])
custom_rpath = GetOption("custom_rpath")
if custom_rpath is not None:
env.AppendUnique(RPATH=custom_rpath)

View File

@@ -1,9 +1,9 @@
# -*- python -*-
setupOptions, makeEnvironment, setupTargets, checks = SConscript("SConscript")
setupOptions()
variables = setupOptions()
env = makeEnvironment()
env = makeEnvironment(variables)
env.AppendUnique(CPPPATH="#.")
if not GetOption("help") and not GetOption("clean"):