-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix-alternatives-gcc
executable file
·75 lines (64 loc) · 2.24 KB
/
mix-alternatives-gcc
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
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
### Package: mix-alternatives-gcc
### Version: v20241208.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."
# DEBVER
if [ -z $DEBVER ]; then
DEBVER=unstable
fi
echo "*** DEBVER selected is $DEBVER."
# PKGVER
if [ -z $PKGVER ]; then
PKGVER=14
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 install -t $DEBVER gcc g++ gcc-$PKGVER g++-$PKGVER \
gcc-$PKGVER-multilib g++-$PKGVER-multilib
fi
## INSTALL
if [ $INSTALLDEPS = debian ]; then
# GCC
sudo rm /usr/bin/gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-upstream/bin/gcc 998
sudo update-alternatives --install /usr/bin/gcc gcc /usr/local/bin/gcc 999
# G++
sudo rm /usr/bin/g++
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14
sudo update-alternatives --install /usr/bin/g++ g++ /usr/local/gcc-upstream/bin/g++ 998
sudo update-alternatives --install /usr/bin/g++ g++ /usr/local/bin/g++ 999
# ALTERNATIVES
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
fi
## EXIT
exit
## ENJOY