Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Unified Diff: pylib/gyp/generator/make.py

Issue 10833021: Honor $CC/$CC_host and friends in make generator. (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: ninja: don't run manifest tool when LD_target is overridden Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pylib/gyp/generator/ninja.py » ('j') | pylib/gyp/generator/ninja.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/make.py
diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py
index 2954cae64eb3e223c43c3aa18afb199c177d2934..8332fef4dac13e947619fec9a0f737e2797c9e98 100644
--- a/pylib/gyp/generator/make.py
+++ b/pylib/gyp/generator/make.py
@@ -60,7 +60,6 @@ generator_extra_sources_for_rules = []
def CalculateVariables(default_variables, params):
"""Calculate additional variables for use in the build (called by gyp)."""
- cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc'))
flavor = gyp.common.GetFlavor(params)
if flavor == 'mac':
default_variables.setdefault('OS', 'mac')
@@ -255,11 +254,11 @@ all_deps :=
# This will allow make to invoke N linker processes as specified in -jN.
LINK ?= %(flock)s $(builddir)/linker.lock $(CXX)
-CC.target ?= $(CC)
+CC.target ?= %(CC.target)s
CFLAGS.target ?= $(CFLAGS)
-CXX.target ?= $(CXX)
+CXX.target ?= %(CXX.target)s
CXXFLAGS.target ?= $(CXXFLAGS)
-LINK.target ?= $(LINK)
+LINK.target ?= %(LINK.target)s
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
ARFLAGS.target ?= %(ARFLAGS.target)s
@@ -1891,8 +1890,8 @@ def RunSystemTests(flavor):
# Compute flags used for building static archives.
# N.B.: this fallback logic should match the logic in SHARED_HEADER.
# See comment there for more details.
- ar_target = os.environ.get('AR.target', os.environ.get('AR', 'ar'))
- cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc'))
+ ar_target = GetEnv('AR.target', 'AR_target', 'ar')
+ cc_target = GetEnv('CC.target', 'CC_target', 'cc')
arflags_target = 'crs'
# ar -T enables thin archives on Linux. OS X's ar supports a -T flag, but it
# does something useless (it limits filenames in the archive to 15 chars).
@@ -1915,6 +1914,11 @@ def RunSystemTests(flavor):
'ARFLAGS.host': arflags_host }
+def GetEnv(primary, secondary, default):
+ """Look up a key in the environment, falling back to a secondary key
+ and finally falling back to a default value."""
+ return os.environ.get(primary, os.environ.get(secondary, default))
+
def GenerateOutput(target_list, target_dicts, data, params):
options = params['options']
flavor = gyp.common.GetFlavor(params)
@@ -1994,7 +1998,14 @@ def GenerateOutput(target_list, target_dicts, data, params):
header_params.update({
'flock': 'lockf',
})
+
header_params.update(RunSystemTests(flavor))
+ header_params.update({
+ 'CC.target': GetEnv('CC.target', 'CC_target', '$(CC)'),
+ 'AR.target': GetEnv('AR.target', 'AR_target', '$(AR)'),
+ 'CXX.target': GetEnv('CXX.target', 'CXX_target', '$(CXX)'),
+ 'LINK.target': GetEnv('LINK.target', 'LD_target', '$(LINK)'),
+ })
build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])
make_global_settings_dict = data[build_file].get('make_global_settings', {})
« no previous file with comments | « no previous file | pylib/gyp/generator/ninja.py » ('j') | pylib/gyp/generator/ninja.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698