Lines Matching +full:- +full:- +full:build +full:- +full:options
2 # -*- coding: utf-8 -*-
4 # Use of this source code is governed by a BSD-style license that can be
7 """Script to build the ChromeOS toolchain.
50 self.tag = "%s-%s" % (name, self._ctarget)
55 "etc/portage/package.mask/cross-%s" % self._ctarget,
70 "usr/local/bin/emerge-%s" % self._board,
73 command = "setup_board --board=%s" % self._board
76 def Build(self): member in ToolchainPart
92 "var/tmp/portage/cross-%s" % self._ctarget,
93 "%s-9999" % self._name,
96 command = "rm -f %s" % compiled_file
109 build_suffix = "build-%s" % self._ctarget
110 build_dir = "%s-%s" % (self._source_path, build_suffix)
113 command = "rm -rf %s/*" % build_dir
116 # Create a -build directory for the objects.
117 command = "mkdir -p %s" % build_dir
123 "%s-%s" % (self._chroot_source_path, build_suffix),
148 command = "sudo CLEAN_DELAY=0 emerge -C cross-%s/%s" % (
157 # TODO(shenhan): keep '-sandbox' for a while for compatibility, then remove
160 "nostrip userpriv userfetch -usersandbox -sandbox noclean "
161 "-buildpkg"
178 env["USE"] += " -wrapper_ccache"
185 command = "emerge =cross-%s/%s-9999" % (self._ctarget, self._name)
191 command = "sudo cp -r /usr/lib/gcc/%s %s" % (
216 "-c",
217 "--chromeos_root",
223 "-g",
224 "--gcc_dir",
229 "--binutils_dir",
234 "-x",
235 "--gdb_dir",
240 "-b",
241 "--board",
243 default="x86-alex",
247 "-n",
248 "--noincremental",
255 "--cflags",
258 help="Build a compiler with specified CFLAGS",
261 "--cxxflags",
264 help="Build a compiler with specified CXXFLAGS",
267 "--cflags_for_target",
270 help="Build the target libraries with specified flags",
273 "--cxxflags_for_target",
276 help="Build the target libraries with specified flags",
279 "--ldflags",
282 help="Build a compiler with specified LDFLAGS",
285 "-d",
286 "--debug",
290 help="Build a compiler with -g3 -O0 appended to both"
294 "-m",
295 "--mount_only",
302 "-u",
303 "--unmount_only",
310 "--extra_use_flags",
317 "--gcc_enable_ccache",
324 options = parser.parse_args(argv)
326 chromeos_root = misc.CanonicalizePath(options.chromeos_root)
327 if options.gcc_dir:
328 gcc_dir = misc.CanonicalizePath(options.gcc_dir)
330 if options.binutils_dir:
331 binutils_dir = misc.CanonicalizePath(options.binutils_dir)
333 if options.gdb_dir:
334 gdb_dir = misc.CanonicalizePath(options.gdb_dir)
336 if options.unmount_only:
337 options.mount_only = False
338 elif options.mount_only:
339 options.unmount_only = False
341 if options.cflags:
342 build_env["CFLAGS"] = "`portageq envvar CFLAGS` " + options.cflags
343 if options.cxxflags:
344 build_env["CXXFLAGS"] = "`portageq envvar CXXFLAGS` " + options.cxxflags
345 if options.cflags_for_target:
346 build_env["CFLAGS_FOR_TARGET"] = options.cflags_for_target
347 if options.cxxflags_for_target:
348 build_env["CXXFLAGS_FOR_TARGET"] = options.cxxflags_for_target
349 if options.ldflags:
350 build_env["LDFLAGS"] = options.ldflags
351 if options.debug:
352 debug_flags = "-g3 -O0"
361 if options.extra_use_flags:
362 build_env["USE"] = options.extra_use_flags
366 for board in options.board.split(","):
367 if options.gcc_dir:
373 not options.noincremental,
375 options.gcc_enable_ccache,
379 if options.binutils_dir:
385 not options.noincremental,
390 if options.gdb_dir:
396 not options.noincremental,
406 if options.mount_only or options.unmount_only:
407 tp.MountSources(options.unmount_only)
409 rv = rv + tp.Build()