diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-11-03 17:56:03 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-11-03 17:56:03 +0000 |
commit | ad5e0122c1e7f5d8a92cad7086a2f232748ba3ce (patch) | |
tree | 81d6bf502b9a1274920f14cb2b40411efb8cbcef /utils/llvm-build | |
parent | cf427c2db413de84bb4d7526a033ae22ff146c25 (diff) |
build: Stub out llvm-build utility tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/llvm-build')
-rw-r--r-- | utils/llvm-build/README.txt | 5 | ||||
-rwxr-xr-x | utils/llvm-build/llvm-build | 6 | ||||
-rw-r--r-- | utils/llvm-build/llvmbuild/__init__.py | 1 | ||||
-rw-r--r-- | utils/llvm-build/llvmbuild/main.py | 27 |
4 files changed, 39 insertions, 0 deletions
diff --git a/utils/llvm-build/README.txt b/utils/llvm-build/README.txt new file mode 100644 index 0000000000..b6bcaae0f1 --- /dev/null +++ b/utils/llvm-build/README.txt @@ -0,0 +1,5 @@ +============================== + llvm-build - LLVM Build Tool +============================== + +`llvm-build` is a tool for helping build the LLVM project. diff --git a/utils/llvm-build/llvm-build b/utils/llvm-build/llvm-build new file mode 100755 index 0000000000..7377e3d3fe --- /dev/null +++ b/utils/llvm-build/llvm-build @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import llvmbuild + +if __name__ == '__main__': + llvmbuild.main() diff --git a/utils/llvm-build/llvmbuild/__init__.py b/utils/llvm-build/llvmbuild/__init__.py new file mode 100644 index 0000000000..7760218973 --- /dev/null +++ b/utils/llvm-build/llvmbuild/__init__.py @@ -0,0 +1 @@ +from main import main diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py new file mode 100644 index 0000000000..0d990a78f6 --- /dev/null +++ b/utils/llvm-build/llvmbuild/main.py @@ -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() |