4 from optparse import OptionParser, OptionGroup
5 parser = OptionParser("usage: %prog [options]")
6 parser.add_option("", "--source-root", dest="source_root", metavar="PATH",
7 help="Path to the LLVM source (inferred if not given)",
8 action="store", default=None)
9 (opts, args) = parser.parse_args()
11 # Determine the LLVM source path, if not given.
12 source_root = opts.source_root
14 if not os.path.exists(os.path.join(source_root, 'lib', 'VMCore',
16 parser.error('invalid LLVM source root: %r' % source_root)
18 llvmbuild_path = os.path.dirname(__file__)
19 llvm_build_path = os.path.dirname(llvmbuild_path)
20 utils_path = os.path.dirname(llvm_build_path)
21 source_root = os.path.dirname(utils_path)
22 if not os.path.exists(os.path.join(source_root, 'lib', 'VMCore',
24 parser.error('unable to infer LLVM source root, please specify')
26 if __name__=='__main__':