• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:build +full:- +full:options

2 ##===- utils/llvmbuild - Build the LLVM project ----------------*-python-*-===##
9 ##===----------------------------------------------------------------------===##
12 # will build LLVM, Clang and dragonegg as well as run tests on them.
40 # a successful build and test run. A successful build is one in which
44 # A build may be invoked as such:
46 # llvmbuild --src=~/llvm/commit --src=~/llvm/staging --src=~/llvm/official
47 # --build=debug --build=release --build=paranoid
48 # --prefix=/home/greened/install --builddir=/home/greened/build
50 # This will build the LLVM ecosystem, including LLVM, Clangand
51 # dragonegg, putting build results in ~/build and installing tools in
52 # ~/install. llvm-compilers-check creates separate build and install
53 # directories for each source/build flavor. In the above example,
54 # llvmbuild will build debug, release and paranoid (debug+checks)
58 # The user may control parallelism via the --jobs and --threads
59 # switches. --jobs tells llvm-compilers-checl the maximum total
61 # as equivalent to the GNU make -j switch. --threads tells
62 # llvm-compilers-check how many worker threads to use to accomplish
63 # those builds. If --threads is less than --jobs, --threads workers
65 # to build. Then llvm-compilers-check will invoke GNU make with -j
66 # (--jobs / --threads) to use up the remaining job capacity. Once a
67 # worker is finished with a build, it will pick another combination
70 ##===----------------------------------------------------------------------===##
120 parser.add_option("-v", "--verbose", action="store_true",
124 parser.add_option("--src", action="append",
125 help=("Top-level source directory [default: %default]"))
126 parser.add_option("--build", action="append",
127 help=("Build types to run [default: %default]"))
128 parser.add_option("--cc", default=find_executable("cc"),
130 parser.add_option("--cxx", default=find_executable("c++"),
132 parser.add_option("--threads", default=4, type="int",
135 parser.add_option("--jobs", "-j", default=8, type="int",
136 help=("The number of simultaneous build jobs "
138 parser.add_option("--prefix",
140 parser.add_option("--builddir",
141 help=("Root build directory [default: %default]"))
142 parser.add_option("--extra-llvm-config-flags", default="",
144 parser.add_option("--force-configure", default=False, action="store_true",
146 parser.add_option("--no-dragonegg", default=False, action="store_true",
147 help=("Do not build dragonegg"))
148 parser.add_option("--no-install", default=False, action="store_true",
150 parser.add_option("--keep-going", default=False, action="store_true",
152 parser.add_option("--no-flavor-prefix", default=False, action="store_true",
153 help=("Do not append the build flavor to the install path"))
154 parser.add_option("--enable-werror", default=False, action="store_true",
155 help=("Build with -Werror"))
158 def check_options(parser, options, valid_builds): argument
160 for build in options.build:
161 if (build not in valid_builds):
162 parser.error("'" + build + "' is not a valid build flavor "
166 for src in options.src:
174 options.cc = find_executable(options.cc)
175 options.cxx = find_executable(options.cxx)
257 options): argument
261 self.cc = options.cc
262 self.cxx = options.cxx
265 self.build_prefix = options.builddir
266 self.install_prefix = options.prefix
267 self.options = options
274 source, build = self.work_queue.get()
275 self.dobuild(source, build)
282 prefix = self.component_abbrev[component.replace("-", "_")]
305 + str(line, "utf-8").rstrip())
320 command += ["-v", "-x", "c++", "/dev/null", "-fsyntax-only"]
336 includes.append(str(line, "utf-8").strip())
347 def dobuild(self, source, build): argument
352 prefix = "[" + ssabbrev[self.source_abbrev[source]] + "-" + self.build_abbrev[build] + "]"
353 if (not self.options.no_flavor_prefix):
354 self.install_prefix += "/" + self.source_abbrev[source] + "/" + build
356 build_suffix += "/" + self.source_abbrev[source] + "/" + build
369 llvm=dict(debug=["--prefix=" + self.install_prefix,
370 "--enable-assertions",
371 "--disable-optimized",
372 "--with-gcc-toolchain=" + cxxroot],
373 release=["--prefix=" + self.install_prefix,
374 "--enable-optimized",
375 "--with-gcc-toolchain=" + cxxroot],
376 paranoid=["--prefix=" + self.install_prefix,
377 "--enable-assertions",
378 "--enable-expensive-checks",
379 "--disable-optimized",
380 "--with-gcc-toolchain=" + cxxroot]),
385 if (self.options.enable_werror):
386 configure_flags["llvm"]["debug"].append("--enable-werror")
387 configure_flags["llvm"]["release"].append("--enable-werror")
388 configure_flags["llvm"]["paranoid"].append("--enable-werror")
405 llvm=dict(debug=["-j" + str(self.jobs)],
406 release=["-j" + str(self.jobs)],
407 paranoid=["-j" + str(self.jobs)]),
408 dragonegg=dict(debug=["-j" + str(self.jobs)],
409 release=["-j" + str(self.jobs)],
410 paranoid=["-j" + str(self.jobs)]))
417 LLVM_CONFIG=self.install_prefix + "/bin/llvm-config"),
419 LLVM_CONFIG=self.install_prefix + "/bin/llvm-config"),
421 LLVM_CONFIG=self.install_prefix + "/bin/llvm-config")))
458 if (self.options.no_dragonegg):
468 comp_key = comp.replace("-", "_")
470 config_args = configure_flags[comp_key][build][:]
471 config_args.extend(getattr(self.options,
479 configure_env[comp_key][build])
484 if (configrc == 0 or self.options.keep_going) :
486 self.logger.info("Build: make " + str(make_flags[comp_key][build]))
488 make_flags[comp_key][build],
489 make_env[comp_key][build])
492 self.logger.info("[None] Failed to build " + component + " in " + installdir)
494 if (buildrc == 0 or self.options.keep_going) :
497 + str(make_check_flags[comp_key][build]))
499 make_check_flags[comp_key][build],
500 make_check_env[comp_key][build])
505 if ((testrc == 0 or self.options.keep_going)
506 and not self.options.no_install):
509 make_install_flags[comp_key][build],
510 make_install_env[comp_key][build])
515 self.logger.info("Failed to build " + component + " in " + installdir)
521 prefix = self.component_abbrev[component.replace("-", "_")]
523 self.logger.debug("Configure " + str(flags) + " " + str(srcdir) + " -> "
532 for conf, mf in configure_files[component.replace("-", "_")]:
539 return -1
551 if not doconfig and not self.options.force_configure:
557 return -1
560 args += ["--verbose"]
580 # Parse options
583 (options, args) = parser.parse_args()
584 check_options(parser, options, build_abbrev.keys());
586 if options.verbose:
588 format='%(name)-13s: %(message)s')
591 format='%(name)-13s: %(message)s')
593 source_abbrev = get_path_abbrevs(set(options.src))
597 jobs = options.jobs // options.threads
601 numthreads = options.threads
603 logging.getLogger().info("Building with " + str(options.jobs) + " jobs and "
607 logging.getLogger().info("CC = " + str(options.cc))
608 logging.getLogger().info("CXX = " + str(options.cxx))
613 options)
617 for build in set(options.build):
618 for source in set(options.src):
619 work_queue.put((source, build))