mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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:
parent
cf427c2db4
commit
ad5e0122c1
5
utils/llvm-build/README.txt
Normal file
5
utils/llvm-build/README.txt
Normal 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
6
utils/llvm-build/llvm-build
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import llvmbuild
|
||||
|
||||
if __name__ == '__main__':
|
||||
llvmbuild.main()
|
1
utils/llvm-build/llvmbuild/__init__.py
Normal file
1
utils/llvm-build/llvmbuild/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from main import main
|
27
utils/llvm-build/llvmbuild/main.py
Normal file
27
utils/llvm-build/llvmbuild/main.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user