Last active
June 29, 2017 04:22
-
-
Save sergey-shambir/a075161d774e211e1a423826764c7d33 to your computer and use it in GitHub Desktop.
Install scripts for LLVM/Clang 4.0 - run "get_clang.sh" then "sudo install_clang.sh"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# You can enable development branch with SVN_BRANCH=trunk | |
# You can enable release 4.0 branch with SVN_BRANCH=branches/release_40 | |
SVN_BRANCH=trunk | |
llvm_get () { | |
mkdir -p "$2" | |
svn co http://llvm.org/svn/llvm-project/$1/$SVN_BRANCH "$2" | |
} | |
enter_dir () { | |
mkdir -p "$1" | |
cd "$1" | |
} | |
BASEDIR=$(dirname $(realpath "$0")) | |
SRCDIR=$BASEDIR/llvm-src | |
BUILDDIR=$BASEDIR/llvm-src/build | |
mkdir -p "$BUILDDIR" | |
enter_dir "$SRCDIR" | |
llvm_get llvm llvm | |
enter_dir "$SRCDIR/llvm/tools" | |
llvm_get cfe clang | |
llvm_get lldb lldb | |
enter_dir "$SRCDIR/llvm/projects" | |
llvm_get compiler-rt compiler-rt | |
llvm_get openmp openmp | |
llvm_get libcxx libcxx | |
llvm_get libcxxabi libcxxabi | |
cd "$BUILDDIR" | |
cmake "$SRCDIR/llvm" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_BUILD_TESTS=NO \ | |
-DLLVM_INCLUDE_TESTS=NO \ | |
-DLIBCXX_ENABLE_STATIC=YES \ | |
-DLIBCXX_ENABLE_SHARED=NO \ | |
-DCLANG_DEFAULT_CXX_STDLIB=libc++ \ | |
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ | |
-DLIBCXX_INCLUDE_BENCHMARKS=OFF | |
cmake --build . -- -j8 VERBOSE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
BASEDIR=$(dirname $(realpath "$0")) | |
BUILDDIR=$BASEDIR/llvm-src/build | |
cp postinstall-pak "$BUILDDIR" | |
cp preremove-pak "$BUILDDIR" | |
cd "$BUILDDIR" | |
checkinstall -D \ | |
-y --strip --stripso --nodoc \ | |
--pkgname=llvm-clang-custom \ | |
--provides="clang" \ | |
--pkgversion=5.0.0 \ | |
--pkgrelease=svn \ | |
--deldesc=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh -e | |
prio=10 | |
update-alternatives --quiet \ | |
--install /usr/bin/c++ \ | |
c++ \ | |
/usr/local/bin/clang++ \ | |
$prio | |
update-alternatives --quiet \ | |
--install /usr/bin/cc \ | |
cc \ | |
/usr/local/bin/clang \ | |
$prio | |
update-alternatives --quiet \ | |
--install /usr/bin/c89 \ | |
c89 \ | |
/usr/local/bin/clang \ | |
$prio | |
update-alternatives --quiet \ | |
--install /usr/bin/c99 \ | |
c99 \ | |
/usr/local/bin/clang \ | |
$prio | |
#DEBHELPER# | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then | |
update-alternatives --quiet --remove cc /usr/local/bin/clang | |
update-alternatives --quiet --remove c89 /usr/local/bin/clang | |
update-alternatives --quiet --remove c99 /usr/local/bin/clang | |
update-alternatives --quiet --remove c++ /usr/local/bin/clang++ | |
fi | |
#DEBHELPER# | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment