forked from cpputest/cpputest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-gcc-macport.sh
executable file
·56 lines (47 loc) · 1.02 KB
/
make-gcc-macport.sh
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
#!/bin/bash
# run from the builds directory
listGccMacVersions()
{
port select --list gcc
}
if [ -z "$1" ]; then
echo "usage: $0 gcc-version\navailable versions:" 1>&2
listGccMacVersions
exit 1
fi
gcc_v=$1
setGccMac()
{
sudo port select --set gcc $1
}
setGccLinux()
{
echo "Not implemented for Linux"
exit 1
# if [ ! -f "/usr/bin/gcc-$1" ] || [ ! -f "/usr/bin/g++-$1" ]; then
# echo "no such version gcc/g++ installed" 1>&2
# exit 1
# fi
# update-alternatives --set gcc "/usr/bin/gcc-$1"
# update-alternatives --set g++ "/usr/bin/g++-$1"
}
if [ "$(uname)" == "Darwin" ]; then
setGccMac $gcc_v
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
setGccLinux $gcc_v
else
echo "can't determine OS"
exit 1
fi
pushd ..
cpputest_home=$(pwd)
popd
mkdir -p $gcc_v
cd $gcc_v
../../configure
make
make check
#these links keep compatibility with makefile worker
ln -s $cpputest_home/include include
ln -s $cpputest_home/build build
ln -s $cpputest_home/scripts scripts