-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix-alternatives-llvm
executable file
·63 lines (54 loc) · 1.92 KB
/
mix-alternatives-llvm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
### Package: mix-alternatives-llvm
### Version: v20241201.2300
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: (none)
## OVERRIDES
# MIXTOOLS
if [ -z $MIXTOOLSDIR ]; then
MIXTOOLSDIR="`pwd`"
PATH=$MIXTOOLSDIR:$PATH
fi
echo "*** MIXTOOLSDIR selected is $MIXTOOLSDIR."
# INSTALLDEPS
if [ -z $INSTALLDEPS ]; then
INSTALLDEPS=debian
fi
echo "*** INSTALLDEPS selected is $INSTALLDEPS."
# DEBIANREPO
if [ -z $DEBIANREPO ]; then
DEBIANREPO=unstable
fi
echo "*** DEBIANREPO selected is $DEBIANREPO."
# PKGVER
if [ -z $PKGVER ]; then
PKGVER=19
fi
echo "*** PKGVER selected is $PKGVER."
## INSTALLDEPS
# Debian Dependencies
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y install build-essential coreutils libc-bin
sudo apt-get -y -t $DEBIANREPO install llvm-$PKGVER llvm-$PKGVER-dev \
libomp-$PKGVER-dev
fi
## INSTALL
if [ $INSTALLDEPS = debian ]; then
# LLVM
sudo rm /usr/bin/llvm-config
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-16 16
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-17 17
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-18 18
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-19 19
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-20 20
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /opt/rocm-current/llvm/bin/llvm-config 990
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /opt/llvm-current/bin/llvm-config 997
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/local/llvm-upstream/bin/llvm-config 998
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/local/bin/llvm-config 999
# ALTERNATIVES
sudo update-alternatives --config llvm-config
fi
## EXIT
exit
## ENJOY