Skip to content

Instantly share code, notes, and snippets.

@lodle
Created October 27, 2015 21:04
Show Gist options
  • Save lodle/e24a80907bbf7a7b72f6 to your computer and use it in GitHub Desktop.
Save lodle/e24a80907bbf7a7b72f6 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -f /opt/rh/devtoolset-2/enable ]; then
source /opt/rh/devtoolset-2/enable
fi
if [ -f /opt/rh/python27/enable ]; then
source /opt/rh/python27/enable
fi
PYTHON_BIN=
if [ -f /usr/local/bin/python2.7 ]; then
PYTHON_BIN=`echo "-DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python2.7"`
fi
if [ ! -f cmake/bin/cmake ]; then
rm -fr cmake*
mkdir cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz -O cmake.tar.gz
tar -zxvf cmake.tar.gz -C cmake --strip-components 1
pushd cmake
./bootstrap
make -j 8
popd
fi
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
pushd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
cd lldb
PACKAGE_VERSION=`svn info -r HEAD | grep Revision | awk '{print $2}'`
popd
rm -fr build
mkdir build
pushd build
../cmake/bin/cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_TARGETS_TO_BUILD="X86;x86-64" -DLLDB_DISABLE_PYTHON=true -DLLDB_DISABLE_LIBEDIT=true $PYTHON_BIN ../llvm
make -j 8
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment