[llvm-commits] [llvm] r143620 - in /llvm/trunk/utils/llvm-build: ./ README.txt llvm-build llvmbuild/ llvmbuild/__init__.py llvmbuild/main.py
Daniel Dunbar
daniel at zuster.org
Thu Nov 3 10:56:03 PDT 2011
Author: ddunbar
Date: Thu Nov 3 12:56:03 2011
New Revision: 143620
URL: http://llvm.org/viewvc/llvm-project?rev=143620&view=rev
Log:
build: Stub out llvm-build utility tool.
Added:
llvm/trunk/utils/llvm-build/
llvm/trunk/utils/llvm-build/README.txt
llvm/trunk/utils/llvm-build/llvm-build (with props)
llvm/trunk/utils/llvm-build/llvmbuild/
llvm/trunk/utils/llvm-build/llvmbuild/__init__.py
llvm/trunk/utils/llvm-build/llvmbuild/main.py
Added: llvm/trunk/utils/llvm-build/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/README.txt?rev=143620&view=auto
==============================================================================
--- llvm/trunk/utils/llvm-build/README.txt (added)
+++ llvm/trunk/utils/llvm-build/README.txt Thu Nov 3 12:56:03 2011
@@ -0,0 +1,5 @@
+==============================
+ llvm-build - LLVM Build Tool
+==============================
+
+`llvm-build` is a tool for helping build the LLVM project.
Added: llvm/trunk/utils/llvm-build/llvm-build
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvm-build?rev=143620&view=auto
==============================================================================
--- llvm/trunk/utils/llvm-build/llvm-build (added)
+++ llvm/trunk/utils/llvm-build/llvm-build Thu Nov 3 12:56:03 2011
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+import llvmbuild
+
+if __name__ == '__main__':
+ llvmbuild.main()
Propchange: llvm/trunk/utils/llvm-build/llvm-build
------------------------------------------------------------------------------
svn:executable = *
Added: llvm/trunk/utils/llvm-build/llvmbuild/__init__.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/__init__.py?rev=143620&view=auto
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/__init__.py (added)
+++ llvm/trunk/utils/llvm-build/llvmbuild/__init__.py Thu Nov 3 12:56:03 2011
@@ -0,0 +1 @@
+from main import main
Added: llvm/trunk/utils/llvm-build/llvmbuild/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/main.py?rev=143620&view=auto
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/main.py (added)
+++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Thu Nov 3 12:56:03 2011
@@ -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()
More information about the llvm-commits
mailing list