mirror of
https://github.com/notwa/rc
synced 2024-06-29 02:17:12 -07:00
update and document setup_clang_ubuntu
This commit is contained in:
parent
208dc56791
commit
2c1220e6d1
28
sh/compile
28
sh/compile
|
@ -3,12 +3,32 @@
|
||||||
# NO_BASH
|
# NO_BASH
|
||||||
# NO_DASH
|
# NO_DASH
|
||||||
|
|
||||||
# I'll just leave this here...
|
setup_clang_ubuntu() { ### @-
|
||||||
__setup_clang_ubuntu() { ### @-
|
### print (but don't execute) the commands necessary to install
|
||||||
|
### a fairly recent version of clang on ubuntu-based distros.
|
||||||
|
###
|
||||||
|
### ```sh
|
||||||
|
### $ setup_clang_ubuntu bionic
|
||||||
|
### wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
||||||
|
### echo -n "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main
|
||||||
|
### # deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main
|
||||||
|
### # 12
|
||||||
|
### deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main
|
||||||
|
### # deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main
|
||||||
|
### " > /etc/apt/sources.list.d/llvm-toolchain-bionic.list
|
||||||
|
### apt-get update
|
||||||
|
### apt-get install clang-12
|
||||||
|
### apt-get install lld-12
|
||||||
|
### update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 1200
|
||||||
|
### update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 1200
|
||||||
|
### update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-12 1200
|
||||||
|
### ```
|
||||||
|
|
||||||
local site="http://apt.llvm.org"
|
local site="http://apt.llvm.org"
|
||||||
local name="$(lsb_release -c | cut -f2)"
|
local name="$1"
|
||||||
local version=10 # NOTE: no longer decimal-based
|
local version=12 # NOTE: no longer decimal-based
|
||||||
local priority=$(( version * 100 ))
|
local priority=$(( version * 100 ))
|
||||||
|
[ -n "$name" ] || name="$(lsb_release -c | cut -f2)"
|
||||||
# TODO: use https? this is sketchy
|
# TODO: use https? this is sketchy
|
||||||
echo wget -O - "$site/llvm-snapshot.gpg.key" \| apt-key add -
|
echo wget -O - "$site/llvm-snapshot.gpg.key" \| apt-key add -
|
||||||
echo echo -n \""\
|
echo echo -n \""\
|
||||||
|
|
Loading…
Reference in New Issue
Block a user