Add new command line options --cflags_for_target and --cxxflags_for_target, and pass them into emerge.
Tested:
./build_tc.py -b x86-alex -c ~/cros2/ --cxxflags_for_target="-Wunused-label" -g ~/gcc47cros/
And look at the output to ensure -Wunused-label is actually used.
PRESUBMIT=passed
R=shenhan,yunlian,llozano,asharif,cmtice
CC=c-compiler-chrome
APPROVED=llozano
DELTA=12 (12 added, 0 deleted, 0 changed)
OCL=65833-p2
RCL=65854-p2
RDATE=2013/02/13 15:15:01
P4 change: 42807590
diff --git a/v14/build_tc.py b/v14/build_tc.py
index ea499c3..7138292 100755
--- a/v14/build_tc.py
+++ b/v14/build_tc.py
@@ -194,6 +194,14 @@
dest="cxxflags",
default="",
help="Build a compiler with specified CXXFLAGS")
+ parser.add_option("--cflags_for_target",
+ dest="cflags_for_target",
+ default="",
+ help="Build the target libraries with specified flags")
+ parser.add_option("--cxxflags_for_target",
+ dest="cxxflags_for_target",
+ default="",
+ help="Build the target libraries with specified flags")
parser.add_option("--ldflags",
dest="ldflags",
default="",
@@ -237,6 +245,10 @@
build_env["CFLAGS"] = "`portageq envvar CFLAGS` " + options.cflags
if options.cxxflags:
build_env["CXXFLAGS"] = "`portageq envvar CXXFLAGS` " + options.cxxflags
+ if options.cflags_for_target:
+ build_env["CFLAGS_FOR_TARGET"] = options.cflags_for_target
+ if options.cxxflags_for_target:
+ build_env["CXXFLAGS_FOR_TARGET"] = options.cxxflags_for_target
if options.ldflags:
build_env["LDFLAGS"] = options.ldflags
if options.debug: