Skip to content

Instantly share code, notes, and snippets.

@EricWF
Last active August 29, 2015 14:04
Show Gist options
  • Save EricWF/e029ad95713eb33b76fb to your computer and use it in GitHub Desktop.
Save EricWF/e029ad95713eb33b76fb to your computer and use it in GitHub Desktop.
LIBCXX=$HOME/workspace/libcxx
BUILDLIBCXX=$HOME/workspace/build-libcxx
LIBCXXABI_INCLUDE_PATH="/home/eric/workspace/libcxxabi/include"
rm -rf $BUILDLIBCXX
rm -f $LIBCXX/test/lit.site.cfg
mkdir $BUILDLIBCXX
cd $BUILDLIBCXX
cmake -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_LIBCXXABI_INCLUDE_PATHS=$LIBCXXABI_INCLUDE_PATH\
"$@"\
$LIBCXX
make -j8
cp $BUILDLIBCXX/test/lit.site.cfg $LIBCXX/test/
cd -
LIBCXX=$HOME/workspace/libcxx
BUILDLIBCXX=$HOME/workspace/build-libcxx
LIBSUPCXX_INCLUDE_PATHS="/usr/include/c++/4.9;/usr/include/c++/4.9/x86_64-unknown-linux-gnu"
rm -rf $BUILDLIBCXX
rm -f $LIBCXX/test/lit.site.cfg
mkdir $BUILDLIBCXX
cd $BUILDLIBCXX
cmake -DLIBCXX_CXX_ABI=libstdc++ \
-DLIBCXX_LIBSUPCXX_INCLUDE_PATHS=$LIBSUPCXX_INCLUDE_PATHS
"$@"\
$LIBCXX
make -j8
cp $BUILDLIBCXX/test/lit.site.cfg $LIBCXX/test/
cd -
LIBCXX=$HOME/workspace/libcxx
LIBCXXABI=$HOME/workspace/libcxxabi
BUILDLIBCXXABI=$HOME/workspace/build-libcxxabi
rm -rf $BUILDLIBCXXABI
mkdir $BUILDLIBCXXABI
cd $BUILDLIBCXXABI
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DLIBCXXABI_LIBCXX_INCLUDES=$LIBCXX/include "$@" $LIBCXXABI
make
#!/usr/bin/python
import sys
import os
import subprocess
def checkout_repo(name, suffix, out, out_suffix):
repo_path = 'http://llvm.org/svn/llvm-project/' + name + '/' + suffix
out_path = os.path.join(out, out_suffix)
command = ['svn', 'co', repo_path, out_path]
print('repo_path = ' + repo_path)
print('out_path = ' + out_path)
print('command = ' + str(command))
print('\n')
subprocess.call(command)
def checkout_llvm(release_suffix, out_path, patch_suffix=None):
if patch_suffix != None:
final_suffix = release_suffix + '/final'
llvm_suffix = release_suffix + '/' + patch_suffix
else:
final_suffix = release_suffix
llvm_suffix = release_suffix
checkout_repo('llvm', llvm_suffix, out_path, '')
checkout_repo('cfe', llvm_suffix, out_path, 'tools/clang')
checkout_repo('clang-tools-extra', final_suffix, out_path,'tools/clang/tools/extra')
checkout_repo('compiler-rt', final_suffix, out_path, 'projects/compiler-rt')
#checkout_repo('libcxxabi', final_suffix, out_path, 'projects/libcxxabi')
#checkout_repo('libcxx', final_suffix, out_path, 'projects/libcxx')
#checkout_repo('test-suite', final_suffix, out_path, 'projects/test-suite')
def get_llvm(release_suffix, out, patch_suffix=None):
out_path = os.path.realpath(out)
checkout_llvm(release_suffix, out_path, patch_suffix)
def main():
if len(sys.argv) == 1:
get_llvm("trunk", "llvm-tot")
elif len(sys.argv) == 3:
get_llvm(sys.argv[1], sys.argv[2], 'final')
elif len(sys.argv) == 4:
get_llvm(sys.argv[1], sys.argv[2], sys.argv[3])
else:
print("usage: get-llvm.py [branch output]")
sys.exit(1)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment