build: Stub out llvm-build utility tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2011-11-03 17:56:03 +00:00
parent cf427c2db4
commit ad5e0122c1
4 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,5 @@
==============================
llvm-build - LLVM Build Tool
==============================
`llvm-build` is a tool for helping build the LLVM project.

6
utils/llvm-build/llvm-build Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python
import llvmbuild
if __name__ == '__main__':
llvmbuild.main()

View File

@ -0,0 +1 @@
from main import main

View File

@ -0,0 +1,27 @@
import os
def main():
from optparse import OptionParser, OptionGroup
parser = OptionParser("usage: %prog [options]")
parser.add_option("", "--source-root", dest="source_root", metavar="PATH",
help="Path to the LLVM source (inferred if not given)",
action="store", default=None)
(opts, args) = parser.parse_args()
# Determine the LLVM source path, if not given.
source_root = opts.source_root
if source_root:
if not os.path.exists(os.path.join(source_root, 'lib', 'VMCore',
'Function.cpp')):
parser.error('invalid LLVM source root: %r' % source_root)
else:
llvmbuild_path = os.path.dirname(__file__)
llvm_build_path = os.path.dirname(llvmbuild_path)
utils_path = os.path.dirname(llvm_build_path)
source_root = os.path.dirname(utils_path)
if not os.path.exists(os.path.join(source_root, 'lib', 'VMCore',
'Function.cpp')):
parser.error('unable to infer LLVM source root, please specify')
if __name__=='__main__':
main()