File: make-gcc-macport.sh

package info (click to toggle)
cpputest 4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,688 kB
  • sloc: cpp: 31,212; sh: 4,978; ansic: 1,360; makefile: 775; ruby: 676; xml: 8; sed: 1
file content (56 lines) | stat: -rwxr-xr-x 1,045 bytes parent folder | download | duplicates (4)
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